From d21b644d05d4d3073f766592e2cd477fa5058d57 Mon Sep 17 00:00:00 2001 From: Matt Surabian Date: Thu, 28 Sep 2017 01:19:19 -0400 Subject: [PATCH 1/3] Roll back webpack dev server version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0308bf4..4e82300 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "script-loader": "^0.7.0", "tween.js": "^16.6.0", "webpack": "^2.2.1", - "webpack-dev-server": "^2.3.0" + "webpack-dev-server": "2.2.1" } } From d78de601fb3df2c99b3abc65c435e9705935c12d Mon Sep 17 00:00:00 2001 From: Matt Surabian Date: Thu, 28 Sep 2017 01:45:59 -0400 Subject: [PATCH 2/3] Show replay message with score commentary and reload the page when clicked. Fix #29 --- src/modules/Game.js | 53 +++++++++++++++++++++++++++++++++++++++----- src/modules/Stage.js | 19 +++++++++++++--- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/modules/Game.js b/src/modules/Game.js index 4e70e08..49050e9 100644 --- a/src/modules/Game.js +++ b/src/modules/Game.js @@ -343,21 +343,64 @@ class Game { win() { sound.play('champ'); this.gameStatus = 'You Win!'; + this.showReplay(this.getScoreMessage()); } loss() { sound.play('loserSound'); this.gameStatus = 'You Lose!'; + this.showReplay(this.getScoreMessage()); + } + + getScoreMessage() { + let scoreMessage; + + if (this.score === 9400) { + scoreMessage = 'Flawless victory.'; + } + + if (this.score < 9400) { + scoreMessage = 'Close to perfection.'; + } + + if (this.score <= 9000) { + scoreMessage = 'Truly impressive score.'; + } + + if (this.score <= 8000) { + scoreMessage = 'Solid score.' + } + + if (this.score <= 6000) { + scoreMessage = 'Yikes.'; + } + + return scoreMessage; + } + + showReplay(replayText) { + this.stage.hud.createTextBox('replayButton', { + location: Stage.replayButtonLocation() + }); + this.stage.hud.replayButton = replayText + ' Play Again?'; + this.bindInteractions(); + } handleClick(event) { - if (!this.outOfAmmo()) { - sound.play('gunSound'); - this.bullets -= 1; - this.updateScore(this.stage.shotsFired({ + let clickPoint = { x: event.data.global.x, y: event.data.global.y - })); + }; + + if (!this.stage.hud.replayButton && !this.outOfAmmo()) { + sound.play('gunSound'); + this.bullets -= 1; + this.updateScore(this.stage.shotsFired(clickPoint)); + } + + if (this.stage.hud.replayButton && this.stage.clickedReplay(clickPoint)) { + window.location.reload(); } } diff --git a/src/modules/Stage.js b/src/modules/Stage.js index c956925..61056f5 100644 --- a/src/modules/Stage.js +++ b/src/modules/Stage.js @@ -23,6 +23,7 @@ const HUD_LOCATIONS = { SCORE: new Point(MAX_X - 10, 10), WAVE_STATUS: new Point(MAX_X - 10, MAX_Y - 20), GAME_STATUS: new Point(MAX_X / 2, MAX_Y * 0.45), + REPLAY_BUTTON: new Point(MAX_X / 2, MAX_Y * 0.56), BULLET_STATUS: new Point(10, 10), DEAD_DUCK_STATUS: new Point(10, MAX_Y * 0.91), MISSED_DUCK_STATUS: new Point(10, MAX_Y * 0.95) @@ -75,6 +76,10 @@ class Stage extends Container { return HUD_LOCATIONS.GAME_STATUS; } + static replayButtonLocation() { + return HUD_LOCATIONS.REPLAY_BUTTON; + } + static bulletStatusBoxLocation() { return HUD_LOCATIONS.BULLET_STATUS; } @@ -185,12 +190,10 @@ class Stage extends Container { this.flashScreen.visible = false; }, FLASH_MS); - clickPoint.x /= this.scale.x; - clickPoint.y /= this.scale.y; let ducksShot = 0; for (let i = 0; i < this.ducks.length; i++) { const duck = this.ducks[i]; - if (duck.alive && Utils.pointDistance(duck.position, clickPoint) < 60) { + if (duck.alive && Utils.pointDistance(duck.position, this.getScaledClickLocation(clickPoint)) < 60) { ducksShot++; duck.shot(); duck.timeline.add(() => { @@ -201,6 +204,16 @@ class Stage extends Container { return ducksShot; } + clickedReplay(clickPoint) { + return Utils.pointDistance(this.getScaledClickLocation(clickPoint), HUD_LOCATIONS.REPLAY_BUTTON) < 200; + } + + getScaledClickLocation(clickPoint) { + return { + x: clickPoint.x / this.scale.x, + y: clickPoint.y / this.scale.y + }; + } /** * flyAway * Helper method that causes the sky to change color and the ducks to fly away From 9bf0d472cd4736e57b0cfc3eb22d9e544e30944a Mon Sep 17 00:00:00 2001 From: Matt Surabian Date: Thu, 28 Sep 2017 01:50:39 -0400 Subject: [PATCH 3/3] Add built files for replay feature --- dist/duckhunt.js | 41118 ++++++++++++++++++++++------------------- dist/duckhunt.js.map | 2 +- 2 files changed, 22343 insertions(+), 18777 deletions(-) diff --git a/dist/duckhunt.js b/dist/duckhunt.js index 7c29675..502a6c5 100644 --- a/dist/duckhunt.js +++ b/dist/duckhunt.js @@ -6,9 +6,9 @@ /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) +/******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; -/******/ +/******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, @@ -63,7 +63,7 @@ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 605); +/******/ return __webpack_require__(__webpack_require__.s = 273); /******/ }) /************************************************************************/ /******/ ([ @@ -74,9 +74,357 @@ exports.__esModule = true; -exports.autoDetectRenderer = exports.Application = exports.Filter = exports.SpriteMaskFilter = exports.Quad = exports.RenderTarget = exports.ObjectRenderer = exports.WebGLManager = exports.Shader = exports.CanvasRenderTarget = exports.TextureUvs = exports.VideoBaseTexture = exports.BaseRenderTexture = exports.RenderTexture = exports.BaseTexture = exports.Texture = exports.CanvasGraphicsRenderer = exports.GraphicsRenderer = exports.GraphicsData = exports.Graphics = exports.TextStyle = exports.Text = exports.SpriteRenderer = exports.CanvasTinter = exports.CanvasSpriteRenderer = exports.Sprite = exports.TransformBase = exports.TransformStatic = exports.Transform = exports.Container = exports.DisplayObject = exports.Bounds = exports.glCore = exports.WebGLRenderer = exports.CanvasRenderer = exports.ticker = exports.utils = exports.settings = undefined; +/** + * String of the current PIXI version. + * + * @static + * @constant + * @memberof PIXI + * @name VERSION + * @type {string} + */ +var VERSION = exports.VERSION = '4.5.6'; + +/** + * Two Pi. + * + * @static + * @constant + * @memberof PIXI + * @type {number} + */ +var PI_2 = exports.PI_2 = Math.PI * 2; + +/** + * Conversion factor for converting radians to degrees. + * + * @static + * @constant + * @memberof PIXI + * @type {number} + */ +var RAD_TO_DEG = exports.RAD_TO_DEG = 180 / Math.PI; + +/** + * Conversion factor for converting degrees to radians. + * + * @static + * @constant + * @memberof PIXI + * @type {number} + */ +var DEG_TO_RAD = exports.DEG_TO_RAD = Math.PI / 180; + +/** + * Constant to identify the Renderer Type. + * + * @static + * @constant + * @memberof PIXI + * @name RENDERER_TYPE + * @type {object} + * @property {number} UNKNOWN - Unknown render type. + * @property {number} WEBGL - WebGL render type. + * @property {number} CANVAS - Canvas render type. + */ +var RENDERER_TYPE = exports.RENDERER_TYPE = { + UNKNOWN: 0, + WEBGL: 1, + CANVAS: 2 +}; + +/** + * Various blend modes supported by PIXI. + * + * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. + * Anything else will silently act like NORMAL. + * + * @static + * @constant + * @memberof PIXI + * @name BLEND_MODES + * @type {object} + * @property {number} NORMAL + * @property {number} ADD + * @property {number} MULTIPLY + * @property {number} SCREEN + * @property {number} OVERLAY + * @property {number} DARKEN + * @property {number} LIGHTEN + * @property {number} COLOR_DODGE + * @property {number} COLOR_BURN + * @property {number} HARD_LIGHT + * @property {number} SOFT_LIGHT + * @property {number} DIFFERENCE + * @property {number} EXCLUSION + * @property {number} HUE + * @property {number} SATURATION + * @property {number} COLOR + * @property {number} LUMINOSITY + */ +var BLEND_MODES = exports.BLEND_MODES = { + NORMAL: 0, + ADD: 1, + MULTIPLY: 2, + SCREEN: 3, + OVERLAY: 4, + DARKEN: 5, + LIGHTEN: 6, + COLOR_DODGE: 7, + COLOR_BURN: 8, + HARD_LIGHT: 9, + SOFT_LIGHT: 10, + DIFFERENCE: 11, + EXCLUSION: 12, + HUE: 13, + SATURATION: 14, + COLOR: 15, + LUMINOSITY: 16, + NORMAL_NPM: 17, + ADD_NPM: 18, + SCREEN_NPM: 19 +}; + +/** + * Various webgl draw modes. These can be used to specify which GL drawMode to use + * under certain situations and renderers. + * + * @static + * @constant + * @memberof PIXI + * @name DRAW_MODES + * @type {object} + * @property {number} POINTS + * @property {number} LINES + * @property {number} LINE_LOOP + * @property {number} LINE_STRIP + * @property {number} TRIANGLES + * @property {number} TRIANGLE_STRIP + * @property {number} TRIANGLE_FAN + */ +var DRAW_MODES = exports.DRAW_MODES = { + POINTS: 0, + LINES: 1, + LINE_LOOP: 2, + LINE_STRIP: 3, + TRIANGLES: 4, + TRIANGLE_STRIP: 5, + TRIANGLE_FAN: 6 +}; + +/** + * The scale modes that are supported by pixi. + * + * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations. + * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. + * + * @static + * @constant + * @memberof PIXI + * @name SCALE_MODES + * @type {object} + * @property {number} LINEAR Smooth scaling + * @property {number} NEAREST Pixelating scaling + */ +var SCALE_MODES = exports.SCALE_MODES = { + LINEAR: 0, + NEAREST: 1 +}; + +/** + * The wrap modes that are supported by pixi. + * + * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wraping mode of future operations. + * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability. + * If the texture is non power of two then clamp will be used regardless as webGL can + * only use REPEAT if the texture is po2. + * + * This property only affects WebGL. + * + * @static + * @constant + * @name WRAP_MODES + * @memberof PIXI + * @type {object} + * @property {number} CLAMP - The textures uvs are clamped + * @property {number} REPEAT - The texture uvs tile and repeat + * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring + */ +var WRAP_MODES = exports.WRAP_MODES = { + CLAMP: 0, + REPEAT: 1, + MIRRORED_REPEAT: 2 +}; + +/** + * The gc modes that are supported by pixi. + * + * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO + * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not + * used for a specified period of time they will be removed from the GPU. They will of course + * be uploaded again when they are required. This is a silent behind the scenes process that + * should ensure that the GPU does not get filled up. + * + * Handy for mobile devices! + * This property only affects WebGL. + * + * @static + * @constant + * @name GC_MODES + * @memberof PIXI + * @type {object} + * @property {number} AUTO - Garbage collection will happen periodically automatically + * @property {number} MANUAL - Garbage collection will need to be called manually + */ +var GC_MODES = exports.GC_MODES = { + AUTO: 0, + MANUAL: 1 +}; + +/** + * Regexp for image type by extension. + * + * @static + * @constant + * @memberof PIXI + * @type {RegExp|string} + * @example `image.png` + */ +var URL_FILE_EXTENSION = exports.URL_FILE_EXTENSION = /\.(\w{3,4})(?:$|\?|#)/i; + +/** + * Regexp for data URI. + * Based on: {@link https://github.com/ragingwind/data-uri-regex} + * + * @static + * @constant + * @name DATA_URI + * @memberof PIXI + * @type {RegExp|string} + * @example data:image/png;base64 + */ +var DATA_URI = exports.DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;(charset=[\w-]+|base64))?,(.*)/i; + +/** + * Regexp for SVG size. + * + * @static + * @constant + * @name SVG_SIZE + * @memberof PIXI + * @type {RegExp|string} + * @example <svg width="100" height="100"></svg> + */ +var SVG_SIZE = exports.SVG_SIZE = /]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i; // eslint-disable-line max-len + +/** + * Constants that identify shapes, mainly to prevent `instanceof` calls. + * + * @static + * @constant + * @name SHAPES + * @memberof PIXI + * @type {object} + * @property {number} POLY Polygon + * @property {number} RECT Rectangle + * @property {number} CIRC Circle + * @property {number} ELIP Ellipse + * @property {number} RREC Rounded Rectangle + */ +var SHAPES = exports.SHAPES = { + POLY: 0, + RECT: 1, + CIRC: 2, + ELIP: 3, + RREC: 4 +}; + +/** + * Constants that specify float precision in shaders. + * + * @static + * @constant + * @name PRECISION + * @memberof PIXI + * @type {object} + * @property {string} LOW='lowp' + * @property {string} MEDIUM='mediump' + * @property {string} HIGH='highp' + */ +var PRECISION = exports.PRECISION = { + LOW: 'lowp', + MEDIUM: 'mediump', + HIGH: 'highp' +}; + +/** + * Constants that specify the transform type. + * + * @static + * @constant + * @name TRANSFORM_MODE + * @memberof PIXI + * @type {object} + * @property {number} STATIC + * @property {number} DYNAMIC + */ +var TRANSFORM_MODE = exports.TRANSFORM_MODE = { + STATIC: 0, + DYNAMIC: 1 +}; + +/** + * Constants that define the type of gradient on text. + * + * @static + * @constant + * @name TEXT_GRADIENT + * @memberof PIXI + * @type {object} + * @property {number} LINEAR_VERTICAL Vertical gradient + * @property {number} LINEAR_HORIZONTAL Linear gradient + */ +var TEXT_GRADIENT = exports.TEXT_GRADIENT = { + LINEAR_VERTICAL: 0, + LINEAR_HORIZONTAL: 1 +}; + +/** + * Represents the update priorities used by internal PIXI classes when registered with + * the {@link PIXI.ticker.Ticker} object. Higher priority items are updated first and lower + * priority items, such as render, should go later. + * + * @static + * @constant + * @name UPDATE_PRIORITY + * @memberof PIXI + * @type {object} + * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.interaction.InteractionManager} + * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.extras.AnimatedSprite} + * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.ticker.Ticker#add}. + * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering. + * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.prepare.BasePrepare} utility. + */ +var UPDATE_PRIORITY = exports.UPDATE_PRIORITY = { + INTERACTION: 50, + HIGH: 25, + NORMAL: 0, + LOW: -25, + UTILITY: -50 +}; +//# sourceMappingURL=const.js.map + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.autoDetectRenderer = exports.Application = exports.Filter = exports.SpriteMaskFilter = exports.Quad = exports.RenderTarget = exports.ObjectRenderer = exports.WebGLManager = exports.Shader = exports.CanvasRenderTarget = exports.TextureUvs = exports.VideoBaseTexture = exports.BaseRenderTexture = exports.RenderTexture = exports.BaseTexture = exports.Texture = exports.Spritesheet = exports.CanvasGraphicsRenderer = exports.GraphicsRenderer = exports.GraphicsData = exports.Graphics = exports.TextMetrics = exports.TextStyle = exports.Text = exports.SpriteRenderer = exports.CanvasTinter = exports.CanvasSpriteRenderer = exports.Sprite = exports.TransformBase = exports.TransformStatic = exports.Transform = exports.Container = exports.DisplayObject = exports.Bounds = exports.glCore = exports.WebGLRenderer = exports.CanvasRenderer = exports.ticker = exports.utils = exports.settings = undefined; -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); Object.keys(_const).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -88,7 +436,7 @@ Object.keys(_const).forEach(function (key) { }); }); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); Object.keys(_math).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -118,7 +466,7 @@ Object.defineProperty(exports, 'Bounds', { } }); -var _DisplayObject = __webpack_require__(235); +var _DisplayObject = __webpack_require__(237); Object.defineProperty(exports, 'DisplayObject', { enumerable: true, @@ -127,7 +475,7 @@ Object.defineProperty(exports, 'DisplayObject', { } }); -var _Container = __webpack_require__(53); +var _Container = __webpack_require__(55); Object.defineProperty(exports, 'Container', { enumerable: true, @@ -136,7 +484,7 @@ Object.defineProperty(exports, 'Container', { } }); -var _Transform = __webpack_require__(236); +var _Transform = __webpack_require__(238); Object.defineProperty(exports, 'Transform', { enumerable: true, @@ -145,7 +493,7 @@ Object.defineProperty(exports, 'Transform', { } }); -var _TransformStatic = __webpack_require__(237); +var _TransformStatic = __webpack_require__(239); Object.defineProperty(exports, 'TransformStatic', { enumerable: true, @@ -172,7 +520,7 @@ Object.defineProperty(exports, 'Sprite', { } }); -var _CanvasSpriteRenderer = __webpack_require__(550); +var _CanvasSpriteRenderer = __webpack_require__(548); Object.defineProperty(exports, 'CanvasSpriteRenderer', { enumerable: true, @@ -190,7 +538,7 @@ Object.defineProperty(exports, 'CanvasTinter', { } }); -var _SpriteRenderer = __webpack_require__(552); +var _SpriteRenderer = __webpack_require__(550); Object.defineProperty(exports, 'SpriteRenderer', { enumerable: true, @@ -199,7 +547,7 @@ Object.defineProperty(exports, 'SpriteRenderer', { } }); -var _Text = __webpack_require__(554); +var _Text = __webpack_require__(552); Object.defineProperty(exports, 'Text', { enumerable: true, @@ -208,7 +556,7 @@ Object.defineProperty(exports, 'Text', { } }); -var _TextStyle = __webpack_require__(247); +var _TextStyle = __webpack_require__(250); Object.defineProperty(exports, 'TextStyle', { enumerable: true, @@ -217,7 +565,16 @@ Object.defineProperty(exports, 'TextStyle', { } }); -var _Graphics = __webpack_require__(522); +var _TextMetrics = __webpack_require__(249); + +Object.defineProperty(exports, 'TextMetrics', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TextMetrics).default; + } +}); + +var _Graphics = __webpack_require__(520); Object.defineProperty(exports, 'Graphics', { enumerable: true, @@ -226,7 +583,7 @@ Object.defineProperty(exports, 'Graphics', { } }); -var _GraphicsData = __webpack_require__(238); +var _GraphicsData = __webpack_require__(240); Object.defineProperty(exports, 'GraphicsData', { enumerable: true, @@ -235,7 +592,7 @@ Object.defineProperty(exports, 'GraphicsData', { } }); -var _GraphicsRenderer = __webpack_require__(525); +var _GraphicsRenderer = __webpack_require__(523); Object.defineProperty(exports, 'GraphicsRenderer', { enumerable: true, @@ -244,7 +601,7 @@ Object.defineProperty(exports, 'GraphicsRenderer', { } }); -var _CanvasGraphicsRenderer = __webpack_require__(523); +var _CanvasGraphicsRenderer = __webpack_require__(521); Object.defineProperty(exports, 'CanvasGraphicsRenderer', { enumerable: true, @@ -253,7 +610,16 @@ Object.defineProperty(exports, 'CanvasGraphicsRenderer', { } }); -var _Texture = __webpack_require__(57); +var _Spritesheet = __webpack_require__(553); + +Object.defineProperty(exports, 'Spritesheet', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Spritesheet).default; + } +}); + +var _Texture = __webpack_require__(37); Object.defineProperty(exports, 'Texture', { enumerable: true, @@ -262,7 +628,7 @@ Object.defineProperty(exports, 'Texture', { } }); -var _BaseTexture = __webpack_require__(56); +var _BaseTexture = __webpack_require__(48); Object.defineProperty(exports, 'BaseTexture', { enumerable: true, @@ -280,7 +646,7 @@ Object.defineProperty(exports, 'RenderTexture', { } }); -var _BaseRenderTexture = __webpack_require__(248); +var _BaseRenderTexture = __webpack_require__(251); Object.defineProperty(exports, 'BaseRenderTexture', { enumerable: true, @@ -289,7 +655,7 @@ Object.defineProperty(exports, 'BaseRenderTexture', { } }); -var _VideoBaseTexture = __webpack_require__(250); +var _VideoBaseTexture = __webpack_require__(253); Object.defineProperty(exports, 'VideoBaseTexture', { enumerable: true, @@ -298,7 +664,7 @@ Object.defineProperty(exports, 'VideoBaseTexture', { } }); -var _TextureUvs = __webpack_require__(249); +var _TextureUvs = __webpack_require__(252); Object.defineProperty(exports, 'TextureUvs', { enumerable: true, @@ -307,7 +673,7 @@ Object.defineProperty(exports, 'TextureUvs', { } }); -var _CanvasRenderTarget = __webpack_require__(242); +var _CanvasRenderTarget = __webpack_require__(244); Object.defineProperty(exports, 'CanvasRenderTarget', { enumerable: true, @@ -316,7 +682,7 @@ Object.defineProperty(exports, 'CanvasRenderTarget', { } }); -var _Shader = __webpack_require__(52); +var _Shader = __webpack_require__(54); Object.defineProperty(exports, 'Shader', { enumerable: true, @@ -325,7 +691,7 @@ Object.defineProperty(exports, 'Shader', { } }); -var _WebGLManager = __webpack_require__(55); +var _WebGLManager = __webpack_require__(57); Object.defineProperty(exports, 'WebGLManager', { enumerable: true, @@ -334,7 +700,7 @@ Object.defineProperty(exports, 'WebGLManager', { } }); -var _ObjectRenderer = __webpack_require__(83); +var _ObjectRenderer = __webpack_require__(82); Object.defineProperty(exports, 'ObjectRenderer', { enumerable: true, @@ -343,7 +709,7 @@ Object.defineProperty(exports, 'ObjectRenderer', { } }); -var _RenderTarget = __webpack_require__(84); +var _RenderTarget = __webpack_require__(83); Object.defineProperty(exports, 'RenderTarget', { enumerable: true, @@ -352,7 +718,7 @@ Object.defineProperty(exports, 'RenderTarget', { } }); -var _Quad = __webpack_require__(246); +var _Quad = __webpack_require__(248); Object.defineProperty(exports, 'Quad', { enumerable: true, @@ -361,7 +727,7 @@ Object.defineProperty(exports, 'Quad', { } }); -var _SpriteMaskFilter = __webpack_require__(245); +var _SpriteMaskFilter = __webpack_require__(247); Object.defineProperty(exports, 'SpriteMaskFilter', { enumerable: true, @@ -370,7 +736,7 @@ Object.defineProperty(exports, 'SpriteMaskFilter', { } }); -var _Filter = __webpack_require__(244); +var _Filter = __webpack_require__(246); Object.defineProperty(exports, 'Filter', { enumerable: true, @@ -379,7 +745,7 @@ Object.defineProperty(exports, 'Filter', { } }); -var _Application = __webpack_require__(521); +var _Application = __webpack_require__(235); Object.defineProperty(exports, 'Application', { enumerable: true, @@ -388,7 +754,7 @@ Object.defineProperty(exports, 'Application', { } }); -var _autoDetectRenderer = __webpack_require__(234); +var _autoDetectRenderer = __webpack_require__(236); Object.defineProperty(exports, 'autoDetectRenderer', { enumerable: true, @@ -397,23 +763,23 @@ Object.defineProperty(exports, 'autoDetectRenderer', { } }); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); var utils = _interopRequireWildcard(_utils); -var _ticker = __webpack_require__(252); +var _ticker = __webpack_require__(131); var ticker = _interopRequireWildcard(_ticker); -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); -var _CanvasRenderer = __webpack_require__(54); +var _CanvasRenderer = __webpack_require__(56); var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); -var _WebGLRenderer = __webpack_require__(82); +var _WebGLRenderer = __webpack_require__(81); var _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer); @@ -431,7 +797,7 @@ exports.WebGLRenderer = _WebGLRenderer2.default; /** //# sourceMappingURL=index.js.map /***/ }), -/* 1 */ +/* 2 */ /***/ (function(module, exports) { /** @@ -463,508 +829,161 @@ module.exports = isArray; /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.premultiplyBlendMode = exports.BaseTextureCache = exports.TextureCache = exports.mixins = exports.pluginTarget = exports.EventEmitter = exports.removeItems = exports.isMobile = undefined; +exports.uid = uid; +exports.hex2rgb = hex2rgb; +exports.hex2string = hex2string; +exports.rgb2hex = rgb2hex; +exports.getResolutionOfUrl = getResolutionOfUrl; +exports.decomposeDataUri = decomposeDataUri; +exports.getUrlFileExtension = getUrlFileExtension; +exports.getSvgSize = getSvgSize; +exports.skipHello = skipHello; +exports.sayHello = sayHello; +exports.isWebGLSupported = isWebGLSupported; +exports.sign = sign; +exports.destroyTextureCache = destroyTextureCache; +exports.clearTextureCache = clearTextureCache; +exports.correctBlendMode = correctBlendMode; +exports.premultiplyTint = premultiplyTint; +exports.premultiplyRgba = premultiplyRgba; +exports.premultiplyTintToRgba = premultiplyTintToRgba; + +var _const = __webpack_require__(0); + +var _settings = __webpack_require__(6); + +var _settings2 = _interopRequireDefault(_settings); + +var _eventemitter = __webpack_require__(30); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _pluginTarget = __webpack_require__(561); + +var _pluginTarget2 = _interopRequireDefault(_pluginTarget); + +var _mixin = __webpack_require__(560); + +var mixins = _interopRequireWildcard(_mixin); + +var _ismobilejs = __webpack_require__(88); + +var isMobile = _interopRequireWildcard(_ismobilejs); + +var _removeArrayItems = __webpack_require__(607); + +var _removeArrayItems2 = _interopRequireDefault(_removeArrayItems); + +var _mapPremultipliedBlendModes = __webpack_require__(558); + +var _mapPremultipliedBlendModes2 = _interopRequireDefault(_mapPremultipliedBlendModes); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var nextUid = 0; +var saidHello = false; + /** - * String of the current PIXI version. + * Generalized convenience utilities for PIXI. + * @example + * // Extend PIXI's internal Event Emitter. + * class MyEmitter extends PIXI.utils.EventEmitter { + * constructor() { + * super(); + * console.log("Emitter created!"); + * } + * } * - * @static - * @constant - * @memberof PIXI - * @name VERSION - * @type {string} + * // Get info on current device + * console.log(PIXI.utils.isMobile); + * + * // Convert hex color to string + * console.log(PIXI.utils.hex2string(0xff00ff)); // returns: "#ff00ff" + * @namespace PIXI.utils */ -var VERSION = exports.VERSION = '4.3.4'; +exports.isMobile = isMobile; +exports.removeItems = _removeArrayItems2.default; +exports.EventEmitter = _eventemitter2.default; +exports.pluginTarget = _pluginTarget2.default; +exports.mixins = mixins; /** - * Two Pi. + * Gets the next unique identifier * - * @static - * @constant - * @memberof PIXI - * @type {number} + * @memberof PIXI.utils + * @function uid + * @return {number} The next unique identifier to use. */ -var PI_2 = exports.PI_2 = Math.PI * 2; + +function uid() { + return ++nextUid; +} /** - * Conversion factor for converting radians to degrees. + * Converts a hex color number to an [R, G, B] array * - * @static - * @constant - * @memberof PIXI - * @type {number} + * @memberof PIXI.utils + * @function hex2rgb + * @param {number} hex - The number to convert + * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one + * @return {number[]} An array representing the [R, G, B] of the color. */ -var RAD_TO_DEG = exports.RAD_TO_DEG = 180 / Math.PI; +function hex2rgb(hex, out) { + out = out || []; + + out[0] = (hex >> 16 & 0xFF) / 255; + out[1] = (hex >> 8 & 0xFF) / 255; + out[2] = (hex & 0xFF) / 255; + + return out; +} /** - * Conversion factor for converting degrees to radians. + * Converts a hex color number to a string. * - * @static - * @constant - * @memberof PIXI - * @type {number} + * @memberof PIXI.utils + * @function hex2string + * @param {number} hex - Number in hex + * @return {string} The string color. */ -var DEG_TO_RAD = exports.DEG_TO_RAD = Math.PI / 180; +function hex2string(hex) { + hex = hex.toString(16); + hex = '000000'.substr(0, 6 - hex.length) + hex; + + return '#' + hex; +} /** - * Constant to identify the Renderer Type. + * Converts a color as an [R, G, B] array to a hex number * - * @static - * @constant - * @memberof PIXI - * @name RENDERER_TYPE - * @type {object} - * @property {number} UNKNOWN - Unknown render type. - * @property {number} WEBGL - WebGL render type. - * @property {number} CANVAS - Canvas render type. + * @memberof PIXI.utils + * @function rgb2hex + * @param {number[]} rgb - rgb array + * @return {number} The color number */ -var RENDERER_TYPE = exports.RENDERER_TYPE = { - UNKNOWN: 0, - WEBGL: 1, - CANVAS: 2 -}; +function rgb2hex(rgb) { + return (rgb[0] * 255 << 16) + (rgb[1] * 255 << 8) + (rgb[2] * 255 | 0); +} /** - * Various blend modes supported by PIXI. - * - * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes. - * Anything else will silently act like NORMAL. + * get the resolution / device pixel ratio of an asset by looking for the prefix + * used by spritesheets and image urls * - * @static - * @constant - * @memberof PIXI - * @name BLEND_MODES - * @type {object} - * @property {number} NORMAL - * @property {number} ADD - * @property {number} MULTIPLY - * @property {number} SCREEN - * @property {number} OVERLAY - * @property {number} DARKEN - * @property {number} LIGHTEN - * @property {number} COLOR_DODGE - * @property {number} COLOR_BURN - * @property {number} HARD_LIGHT - * @property {number} SOFT_LIGHT - * @property {number} DIFFERENCE - * @property {number} EXCLUSION - * @property {number} HUE - * @property {number} SATURATION - * @property {number} COLOR - * @property {number} LUMINOSITY - */ -var BLEND_MODES = exports.BLEND_MODES = { - NORMAL: 0, - ADD: 1, - MULTIPLY: 2, - SCREEN: 3, - OVERLAY: 4, - DARKEN: 5, - LIGHTEN: 6, - COLOR_DODGE: 7, - COLOR_BURN: 8, - HARD_LIGHT: 9, - SOFT_LIGHT: 10, - DIFFERENCE: 11, - EXCLUSION: 12, - HUE: 13, - SATURATION: 14, - COLOR: 15, - LUMINOSITY: 16 -}; - -/** - * Various webgl draw modes. These can be used to specify which GL drawMode to use - * under certain situations and renderers. - * - * @static - * @constant - * @memberof PIXI - * @name DRAW_MODES - * @type {object} - * @property {number} POINTS - * @property {number} LINES - * @property {number} LINE_LOOP - * @property {number} LINE_STRIP - * @property {number} TRIANGLES - * @property {number} TRIANGLE_STRIP - * @property {number} TRIANGLE_FAN - */ -var DRAW_MODES = exports.DRAW_MODES = { - POINTS: 0, - LINES: 1, - LINE_LOOP: 2, - LINE_STRIP: 3, - TRIANGLES: 4, - TRIANGLE_STRIP: 5, - TRIANGLE_FAN: 6 -}; - -/** - * The scale modes that are supported by pixi. - * - * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations. - * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability. - * - * @static - * @constant - * @memberof PIXI - * @name SCALE_MODES - * @type {object} - * @property {number} LINEAR Smooth scaling - * @property {number} NEAREST Pixelating scaling - */ -var SCALE_MODES = exports.SCALE_MODES = { - LINEAR: 0, - NEAREST: 1 -}; - -/** - * The wrap modes that are supported by pixi. - * - * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wraping mode of future operations. - * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability. - * If the texture is non power of two then clamp will be used regardless as webGL can - * only use REPEAT if the texture is po2. - * - * This property only affects WebGL. - * - * @static - * @constant - * @name WRAP_MODES - * @memberof PIXI - * @type {object} - * @property {number} CLAMP - The textures uvs are clamped - * @property {number} REPEAT - The texture uvs tile and repeat - * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring - */ -var WRAP_MODES = exports.WRAP_MODES = { - CLAMP: 0, - REPEAT: 1, - MIRRORED_REPEAT: 2 -}; - -/** - * The gc modes that are supported by pixi. - * - * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for pixi textures is AUTO - * If set to GC_MODE, the renderer will occasianally check textures usage. If they are not - * used for a specified period of time they will be removed from the GPU. They will of course - * be uploaded again when they are required. This is a silent behind the scenes process that - * should ensure that the GPU does not get filled up. - * - * Handy for mobile devices! - * This property only affects WebGL. - * - * @static - * @constant - * @name GC_MODES - * @memberof PIXI - * @type {object} - * @property {number} AUTO - Garbage collection will happen periodically automatically - * @property {number} MANUAL - Garbage collection will need to be called manually - */ -var GC_MODES = exports.GC_MODES = { - AUTO: 0, - MANUAL: 1 -}; - -/** - * Regexp for image type by extension. - * - * @static - * @constant - * @memberof PIXI - * @type {RegExp|string} - * @example `image.png` - */ -var URL_FILE_EXTENSION = exports.URL_FILE_EXTENSION = /\.(\w{3,4})(?:$|\?|#)/i; - -/** - * Regexp for data URI. - * Based on: {@link https://github.com/ragingwind/data-uri-regex} - * - * @static - * @constant - * @name DATA_URI - * @memberof PIXI - * @type {RegExp|string} - * @example data:image/png;base64 - */ -var DATA_URI = exports.DATA_URI = /^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;(charset=[\w-]+|base64))?,(.*)/i; - -/** - * Regexp for SVG size. - * - * @static - * @constant - * @name SVG_SIZE - * @memberof PIXI - * @type {RegExp|string} - * @example <svg width="100" height="100"></svg> - */ -var SVG_SIZE = exports.SVG_SIZE = /]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i; // eslint-disable-line max-len - -/** - * Constants that identify shapes, mainly to prevent `instanceof` calls. - * - * @static - * @constant - * @name SHAPES - * @memberof PIXI - * @type {object} - * @property {number} POLY Polygon - * @property {number} RECT Rectangle - * @property {number} CIRC Circle - * @property {number} ELIP Ellipse - * @property {number} RREC Rounded Rectangle - */ -var SHAPES = exports.SHAPES = { - POLY: 0, - RECT: 1, - CIRC: 2, - ELIP: 3, - RREC: 4 -}; - -/** - * Constants that specify float precision in shaders. - * - * @static - * @constant - * @name PRECISION - * @memberof PIXI - * @type {object} - * @property {string} LOW='lowp' - * @property {string} MEDIUM='mediump' - * @property {string} HIGH='highp' - */ -var PRECISION = exports.PRECISION = { - LOW: 'lowp', - MEDIUM: 'mediump', - HIGH: 'highp' -}; - -/** - * Constants that specify the transform type. - * - * @static - * @constant - * @name TRANSFORM_MODE - * @memberof PIXI - * @type {object} - * @property {number} STATIC - * @property {number} DYNAMIC - */ -var TRANSFORM_MODE = exports.TRANSFORM_MODE = { - STATIC: 0, - DYNAMIC: 1 -}; - -/** - * Constants that define the type of gradient on text. - * - * @static - * @constant - * @name TEXT_GRADIENT - * @memberof PIXI - * @type {object} - * @property {number} LINEAR_VERTICAL Vertical gradient - * @property {number} LINEAR_HORIZONTAL Linear gradient - */ -var TEXT_GRADIENT = exports.TEXT_GRADIENT = { - LINEAR_VERTICAL: 0, - LINEAR_HORIZONTAL: 1 -}; -//# sourceMappingURL=const.js.map - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var baseMatches = __webpack_require__(157), - baseMatchesProperty = __webpack_require__(158), - identity = __webpack_require__(29), - isArray = __webpack_require__(1), - property = __webpack_require__(218); - -/** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ -function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); -} - -module.exports = baseIteratee; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -var identity = __webpack_require__(29), - overRest = __webpack_require__(195), - setToString = __webpack_require__(110); - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); -} - -module.exports = baseRest; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.BaseTextureCache = exports.TextureCache = exports.pluginTarget = exports.EventEmitter = exports.isMobile = undefined; -exports.uid = uid; -exports.hex2rgb = hex2rgb; -exports.hex2string = hex2string; -exports.rgb2hex = rgb2hex; -exports.getResolutionOfUrl = getResolutionOfUrl; -exports.decomposeDataUri = decomposeDataUri; -exports.getUrlFileExtension = getUrlFileExtension; -exports.getSvgSize = getSvgSize; -exports.skipHello = skipHello; -exports.sayHello = sayHello; -exports.isWebGLSupported = isWebGLSupported; -exports.sign = sign; -exports.removeItems = removeItems; - -var _const = __webpack_require__(2); - -var _settings = __webpack_require__(10); - -var _settings2 = _interopRequireDefault(_settings); - -var _eventemitter = __webpack_require__(24); - -var _eventemitter2 = _interopRequireDefault(_eventemitter); - -var _pluginTarget = __webpack_require__(558); - -var _pluginTarget2 = _interopRequireDefault(_pluginTarget); - -var _ismobilejs = __webpack_require__(60); - -var isMobile = _interopRequireWildcard(_ismobilejs); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var nextUid = 0; -var saidHello = false; - -/** - * @namespace PIXI.utils - */ -exports.isMobile = isMobile; -exports.EventEmitter = _eventemitter2.default; -exports.pluginTarget = _pluginTarget2.default; - -/** - * Gets the next unique identifier - * - * @memberof PIXI.utils - * @function uid - * @return {number} The next unique identifier to use. - */ - -function uid() { - return ++nextUid; -} - -/** - * Converts a hex color number to an [R, G, B] array - * - * @memberof PIXI.utils - * @function hex2rgb - * @param {number} hex - The number to convert - * @param {number[]} [out=[]] If supplied, this array will be used rather than returning a new one - * @return {number[]} An array representing the [R, G, B] of the color. - */ -function hex2rgb(hex, out) { - out = out || []; - - out[0] = (hex >> 16 & 0xFF) / 255; - out[1] = (hex >> 8 & 0xFF) / 255; - out[2] = (hex & 0xFF) / 255; - - return out; -} - -/** - * Converts a hex color number to a string. - * - * @memberof PIXI.utils - * @function hex2string - * @param {number} hex - Number in hex - * @return {string} The string color. - */ -function hex2string(hex) { - hex = hex.toString(16); - hex = '000000'.substr(0, 6 - hex.length) + hex; - - return '#' + hex; -} - -/** - * Converts a color as an [R, G, B] array to a hex number - * - * @memberof PIXI.utils - * @function rgb2hex - * @param {number[]} rgb - rgb array - * @return {number} The color number - */ -function rgb2hex(rgb) { - return (rgb[0] * 255 << 16) + (rgb[1] * 255 << 8) + rgb[2] * 255; -} - -/** - * get the resolution / device pixel ratio of an asset by looking for the prefix - * used by spritesheets and image urls - * - * @memberof PIXI.utils - * @function getResolutionOfUrl - * @param {string} url - the image path - * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set. - * @return {number} resolution / device pixel ratio of an asset + * @memberof PIXI.utils + * @function getResolutionOfUrl + * @param {string} url - the image path + * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set. + * @return {number} resolution / device pixel ratio of an asset */ function getResolutionOfUrl(url, defaultValue) { var resolution = _settings2.default.RETINA_PREFIX.exec(url); @@ -1082,11 +1101,11 @@ function sayHello(type) { } if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { - var args = ['\n %c %c %c Pixi.js ' + _const.VERSION + ' - \u2730 ' + type + ' \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665 \n\n', 'background: #ff66a5; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'color: #ff66a5; background: #030307; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'background: #ffc3dc; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;']; + var args = ['\n %c %c %c PixiJS ' + _const.VERSION + ' - \u2730 ' + type + ' \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665 \n\n', 'background: #ff66a5; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'color: #ff66a5; background: #030307; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'background: #ffc3dc; padding:5px 0;', 'background: #ff66a5; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;', 'color: #ff2424; background: #fff; padding:5px 0;']; window.console.log.apply(console, args); } else if (window.console) { - window.console.log('Pixi.js ' + _const.VERSION + ' - ' + type + ' - http://www.pixijs.com/'); + window.console.log('PixiJS ' + _const.VERSION + ' - ' + type + ' - http://www.pixijs.com/'); } saidHello = true; @@ -1143,88 +1162,213 @@ function sign(n) { } /** - * Remove a range of items from an array + * @todo Describe property usage * * @memberof PIXI.utils - * @function removeItems - * @param {Array<*>} arr The target array - * @param {number} startIdx The index to begin removing from (inclusive) - * @param {number} removeCount How many items to remove + * @private */ -function removeItems(arr, startIdx, removeCount) { - var length = arr.length; +var TextureCache = exports.TextureCache = Object.create(null); - if (startIdx >= length || removeCount === 0) { - return; +/** + * @todo Describe property usage + * + * @memberof PIXI.utils + * @private + */ +var BaseTextureCache = exports.BaseTextureCache = Object.create(null); + +/** + * Destroys all texture in the cache + * + * @memberof PIXI.utils + * @function destroyTextureCache + */ +function destroyTextureCache() { + var key = void 0; + + for (key in TextureCache) { + TextureCache[key].destroy(); + } + for (key in BaseTextureCache) { + BaseTextureCache[key].destroy(); + } +} + +/** + * Removes all textures from cache, but does not destroy them + * + * @memberof PIXI.utils + * @function clearTextureCache + */ +function clearTextureCache() { + var key = void 0; + + for (key in TextureCache) { + delete TextureCache[key]; } + for (key in BaseTextureCache) { + delete BaseTextureCache[key]; + } +} - removeCount = startIdx + removeCount > length ? length - startIdx : removeCount; +/** + * maps premultiply flag and blendMode to adjusted blendMode + * @memberof PIXI.utils + * @const premultiplyBlendMode + * @type {Array} + */ +var premultiplyBlendMode = exports.premultiplyBlendMode = (0, _mapPremultipliedBlendModes2.default)(); - var len = length - removeCount; +/** + * changes blendMode according to texture format + * + * @memberof PIXI.utils + * @function correctBlendMode + * @param {number} blendMode supposed blend mode + * @param {boolean} premultiplied whether source is premultiplied + * @returns {number} true blend mode for this texture + */ +function correctBlendMode(blendMode, premultiplied) { + return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode]; +} - for (var i = startIdx; i < len; ++i) { - arr[i] = arr[i + removeCount]; +/** + * premultiplies tint + * + * @param {number} tint integet RGB + * @param {number} alpha floating point alpha (0.0-1.0) + * @returns {number} tint multiplied by alpha + */ +function premultiplyTint(tint, alpha) { + if (alpha === 1.0) { + return (alpha * 255 << 24) + tint; + } + if (alpha === 0.0) { + return 0; } + var R = tint >> 16 & 0xFF; + var G = tint >> 8 & 0xFF; + var B = tint & 0xFF; - arr.length = len; + R = R * alpha + 0.5 | 0; + G = G * alpha + 0.5 | 0; + B = B * alpha + 0.5 | 0; + + return (alpha * 255 << 24) + (R << 16) + (G << 8) + B; } /** - * @todo Describe property usage + * combines rgb and alpha to out array * - * @memberof PIXI.utils - * @private + * @param {Float32Array|number[]} rgb input rgb + * @param {number} alpha alpha param + * @param {Float32Array} [out] output + * @param {boolean} [premultiply=true] do premultiply it + * @returns {Float32Array} vec4 rgba */ -var TextureCache = exports.TextureCache = {}; +function premultiplyRgba(rgb, alpha, out, premultiply) { + out = out || new Float32Array(4); + if (premultiply || premultiply === undefined) { + out[0] = rgb[0] * alpha; + out[1] = rgb[1] * alpha; + out[2] = rgb[2] * alpha; + } else { + out[0] = rgb[0]; + out[1] = rgb[1]; + out[2] = rgb[2]; + } + out[3] = alpha; + + return out; +} /** - * @todo Describe property usage + * converts integer tint and float alpha to vec4 form, premultiplies by default * - * @memberof PIXI.utils - * @private + * @param {number} tint input tint + * @param {number} alpha alpha param + * @param {Float32Array} [out] output + * @param {boolean} [premultiply=true] do premultiply it + * @returns {Float32Array} vec4 rgba */ -var BaseTextureCache = exports.BaseTextureCache = {}; +function premultiplyTintToRgba(tint, alpha, out, premultiply) { + out = out || new Float32Array(4); + out[0] = (tint >> 16 & 0xFF) / 255.0; + out[1] = (tint >> 8 & 0xFF) / 255.0; + out[2] = (tint & 0xFF) / 255.0; + if (premultiply || premultiply === undefined) { + out[0] *= alpha; + out[1] *= alpha; + out[2] *= alpha; + } + out[3] = alpha; + + return out; +} //# sourceMappingURL=index.js.map /***/ }), -/* 6 */ -/***/ (function(module, exports) { +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseMatches = __webpack_require__(158), + baseMatchesProperty = __webpack_require__(159), + identity = __webpack_require__(28), + isArray = __webpack_require__(2), + property = __webpack_require__(219); /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true + * The base implementation of `_.iteratee`. * - * _.isObject(_.noop); - * // => true + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var identity = __webpack_require__(28), + overRest = __webpack_require__(196), + setToString = __webpack_require__(110); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * - * _.isObject(null); - * // => false + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); } -module.exports = isObject; +module.exports = baseRest; /***/ }), -/* 7 */ +/* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1232,168 +1376,26 @@ module.exports = isObject; exports.__esModule = true; -var _Point = __webpack_require__(126); - -Object.defineProperty(exports, 'Point', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Point).default; - } -}); - -var _ObservablePoint = __webpack_require__(240); - -Object.defineProperty(exports, 'ObservablePoint', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ObservablePoint).default; - } -}); - -var _Matrix = __webpack_require__(125); - -Object.defineProperty(exports, 'Matrix', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Matrix).default; - } -}); - -var _GroupD = __webpack_require__(239); - -Object.defineProperty(exports, 'GroupD8', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_GroupD).default; - } -}); - -var _Circle = __webpack_require__(532); - -Object.defineProperty(exports, 'Circle', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Circle).default; - } -}); - -var _Ellipse = __webpack_require__(533); - -Object.defineProperty(exports, 'Ellipse', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Ellipse).default; - } -}); - -var _Polygon = __webpack_require__(534); - -Object.defineProperty(exports, 'Polygon', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Polygon).default; - } -}); - -var _Rectangle = __webpack_require__(127); - -Object.defineProperty(exports, 'Rectangle', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Rectangle).default; - } -}); - -var _RoundedRectangle = __webpack_require__(535); - -Object.defineProperty(exports, 'RoundedRectangle', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_RoundedRectangle).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -var freeGlobal = __webpack_require__(184); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -module.exports = root; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -var arrayLikeKeys = __webpack_require__(143), - baseKeys = __webpack_require__(155), - isArrayLike = __webpack_require__(16); - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -module.exports = keys; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _maxRecommendedTextures = __webpack_require__(557); +var _maxRecommendedTextures = __webpack_require__(559); var _maxRecommendedTextures2 = _interopRequireDefault(_maxRecommendedTextures); -var _canUploadSameBuffer = __webpack_require__(555); +var _canUploadSameBuffer = __webpack_require__(556); var _canUploadSameBuffer2 = _interopRequireDefault(_canUploadSameBuffer); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** + * User's customizable globals for overriding the default PIXI settings, such + * as a renderer's default resolution, framerate, float percision, etc. + * @example + * // Use the native window resolution as the default resolution + * // will support high-density displays when rendering + * PIXI.settings.RESOLUTION = window.devicePixelRatio. + * + * // Disable interpolation when scaling, will make texture be pixelated + * PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; * @namespace PIXI.settings */ exports.default = { @@ -1469,11 +1471,11 @@ exports.default = { * * @static * @memberof PIXI.settings - * @type {RegExp|string} + * @type {RegExp} * @example `@2x` - * @default /@(.+)x/ + * @default /@([0-9\.]+)x/ */ - RETINA_PREFIX: /@(.+)x/, + RETINA_PREFIX: /@([0-9\.]+)x/, /** * The default render options if none are supplied to {@link PIXI.WebGLRenderer} @@ -1493,6 +1495,9 @@ exports.default = { * @property {boolean} clearBeforeRender=true * @property {boolean} preserveDrawingBuffer=false * @property {boolean} roundPixels=false + * @property {number} width=800 + * @property {number} height=600 + * @property {boolean} legacy=false */ RENDER_OPTIONS: { view: null, @@ -1503,7 +1508,10 @@ exports.default = { backgroundColor: 0x000000, clearBeforeRender: true, preserveDrawingBuffer: false, - roundPixels: false + roundPixels: false, + width: 800, + height: 600, + legacy: false }, /** @@ -1567,14 +1575,24 @@ exports.default = { SCALE_MODE: 0, /** - * Default specify float precision in shaders. + * Default specify float precision in vertex shader. + * + * @static + * @memberof PIXI.settings + * @type {PIXI.PRECISION} + * @default PIXI.PRECISION.HIGH + */ + PRECISION_VERTEX: 'highp', + + /** + * Default specify float precision in fragment shader. * * @static * @memberof PIXI.settings * @type {PIXI.PRECISION} * @default PIXI.PRECISION.MEDIUM */ - PRECISION: 'mediump', + PRECISION_FRAGMENT: 'mediump', /** * Can we upload the same buffer in a single frame? @@ -1589,6 +1607,194 @@ exports.default = { }; //# sourceMappingURL=settings.js.map +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _Point = __webpack_require__(126); + +Object.defineProperty(exports, 'Point', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Point).default; + } +}); + +var _ObservablePoint = __webpack_require__(242); + +Object.defineProperty(exports, 'ObservablePoint', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_ObservablePoint).default; + } +}); + +var _Matrix = __webpack_require__(125); + +Object.defineProperty(exports, 'Matrix', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Matrix).default; + } +}); + +var _GroupD = __webpack_require__(241); + +Object.defineProperty(exports, 'GroupD8', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_GroupD).default; + } +}); + +var _Circle = __webpack_require__(530); + +Object.defineProperty(exports, 'Circle', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Circle).default; + } +}); + +var _Ellipse = __webpack_require__(531); + +Object.defineProperty(exports, 'Ellipse', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Ellipse).default; + } +}); + +var _Polygon = __webpack_require__(532); + +Object.defineProperty(exports, 'Polygon', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Polygon).default; + } +}); + +var _Rectangle = __webpack_require__(127); + +Object.defineProperty(exports, 'Rectangle', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Rectangle).default; + } +}); + +var _RoundedRectangle = __webpack_require__(533); + +Object.defineProperty(exports, 'RoundedRectangle', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_RoundedRectangle).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(185); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(144), + baseKeys = __webpack_require__(156), + isArrayLike = __webpack_require__(16); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + /***/ }), /* 11 */ /***/ (function(module, exports) { @@ -1647,7 +1853,7 @@ module.exports = arrayMap; /* 13 */ /***/ (function(module, exports, __webpack_require__) { -var arrayLikeKeys = __webpack_require__(143), +var arrayLikeKeys = __webpack_require__(144), baseKeysIn = __webpack_require__(312), isArrayLike = __webpack_require__(16); @@ -1685,7 +1891,7 @@ module.exports = keysIn; /* 14 */ /***/ (function(module, exports, __webpack_require__) { -var toFinite = __webpack_require__(80); +var toFinite = __webpack_require__(79); /** * Converts `value` to an integer. @@ -1728,14 +1934,14 @@ module.exports = toInteger; /***/ (function(module, exports, __webpack_require__) { var gl = { - createContext: __webpack_require__(517), - setVertexAttribArrays: __webpack_require__(225), - GLBuffer: __webpack_require__(513), - GLFramebuffer: __webpack_require__(514), - GLShader: __webpack_require__(515), - GLTexture: __webpack_require__(224), - VertexArrayObject: __webpack_require__(516), - shader: __webpack_require__(518) + createContext: __webpack_require__(516), + setVertexAttribArrays: __webpack_require__(226), + GLBuffer: __webpack_require__(512), + GLFramebuffer: __webpack_require__(513), + GLShader: __webpack_require__(514), + GLTexture: __webpack_require__(225), + VertexArrayObject: __webpack_require__(515), + shader: __webpack_require__(517) }; // Export for Node-compatible environments @@ -1797,6 +2003,134 @@ module.exports = isArrayLike; /* 17 */ /***/ (function(module, exports, __webpack_require__) { +var identity = __webpack_require__(28); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +var assignValue = __webpack_require__(63), + baseAssignValue = __webpack_require__(22); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +var isSymbol = __webpack_require__(47); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -2022,199 +2356,71 @@ var substr = 'ab'.substr(-1) === 'b' } ; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(134))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(135))) /***/ }), -/* 18 */ +/* 22 */ /***/ (function(module, exports, __webpack_require__) { -var identity = __webpack_require__(29); +var defineProperty = __webpack_require__(183); /** - * Casts `value` to `identity` if it's not a function. + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. * * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. */ -function castFunction(value) { - return typeof value == 'function' ? value : identity; +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } } -module.exports = castFunction; +module.exports = baseAssignValue; /***/ }), -/* 19 */ +/* 23 */ /***/ (function(module, exports, __webpack_require__) { -var assignValue = __webpack_require__(64), - baseAssignValue = __webpack_require__(22); +var baseSetData = __webpack_require__(164), + createBind = __webpack_require__(340), + createCurry = __webpack_require__(341), + createHybrid = __webpack_require__(178), + createPartial = __webpack_require__(342), + getData = __webpack_require__(106), + mergeData = __webpack_require__(375), + setData = __webpack_require__(198), + setWrapToString = __webpack_require__(200), + toInteger = __webpack_require__(14); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} - -module.exports = copyObject; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSymbol = __webpack_require__(46); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -module.exports = toKey; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -module.exports = isObjectLike; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -var defineProperty = __webpack_require__(182); - -/** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); - } else { - object[key] = value; - } -} - -module.exports = baseAssignValue; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -var baseSetData = __webpack_require__(163), - createBind = __webpack_require__(340), - createCurry = __webpack_require__(341), - createHybrid = __webpack_require__(177), - createPartial = __webpack_require__(342), - getData = __webpack_require__(106), - mergeData = __webpack_require__(375), - setData = __webpack_require__(197), - setWrapToString = __webpack_require__(199), - toInteger = __webpack_require__(14); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. @@ -2299,6 +2505,167 @@ module.exports = createWrap; /* 24 */ /***/ (function(module, exports, __webpack_require__) { +var baseForOwn = __webpack_require__(31), + createBaseEach = __webpack_require__(174); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(38), + getRawTag = __webpack_require__(349), + objectToString = __webpack_require__(379); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(2), + isKey = __webpack_require__(108), + stringToPath = __webpack_require__(202), + toString = __webpack_require__(120); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; @@ -2613,173 +2980,12 @@ if (true) { } -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -var baseForOwn = __webpack_require__(31), - createBaseEach = __webpack_require__(173); - -/** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEach = createBaseEach(baseForOwn); - -module.exports = baseEach; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -var Symbol = __webpack_require__(37), - getRawTag = __webpack_require__(349), - objectToString = __webpack_require__(379); - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -module.exports = baseGetTag; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -var isArray = __webpack_require__(1), - isKey = __webpack_require__(108), - stringToPath = __webpack_require__(201), - toString = __webpack_require__(120); - -/** - * Casts `value` to a path array if it's not one. - * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. - */ -function castPath(value, object) { - if (isArray(value)) { - return value; - } - return isKey(value, object) ? [value] : stringToPath(toString(value)); -} - -module.exports = castPath; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = copyArray; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports) { - -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -module.exports = identity; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { var baseFor = __webpack_require__(97), - keys = __webpack_require__(9); + keys = __webpack_require__(10); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. @@ -2801,7 +3007,7 @@ module.exports = baseForOwn; /***/ (function(module, exports, __webpack_require__) { var flatten = __webpack_require__(431), - overRest = __webpack_require__(195), + overRest = __webpack_require__(196), setToString = __webpack_require__(110); /** @@ -2845,10 +3051,10 @@ module.exports = getNative; /* 34 */ /***/ (function(module, exports, __webpack_require__) { -var eq = __webpack_require__(45), +var eq = __webpack_require__(46), isArrayLike = __webpack_require__(16), - isIndex = __webpack_require__(44), - isObject = __webpack_require__(6); + isIndex = __webpack_require__(45), + isObject = __webpack_require__(7); /** * Checks if the given arguments are from an iteratee call. @@ -2916,8 +3122,8 @@ module.exports = replaceHolders; /* 36 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetTag = __webpack_require__(26), - isObject = __webpack_require__(6); +var baseGetTag = __webpack_require__(25), + isObject = __webpack_require__(7); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', @@ -2959,2988 +3165,2900 @@ module.exports = isFunction; /* 37 */ /***/ (function(module, exports, __webpack_require__) { -var root = __webpack_require__(8); +"use strict"; -/** Built-in value references. */ -var Symbol = root.Symbol; -module.exports = Symbol; +exports.__esModule = true; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }), -/* 38 */ -/***/ (function(module, exports) { +var _BaseTexture = __webpack_require__(48); -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; +var _BaseTexture2 = _interopRequireDefault(_BaseTexture); - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} +var _VideoBaseTexture = __webpack_require__(253); -module.exports = arrayEach; +var _VideoBaseTexture2 = _interopRequireDefault(_VideoBaseTexture); +var _TextureUvs = __webpack_require__(252); -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { +var _TextureUvs2 = _interopRequireDefault(_TextureUvs); -var isObject = __webpack_require__(6); +var _eventemitter = __webpack_require__(30); -/** Built-in value references. */ -var objectCreate = Object.create; +var _eventemitter2 = _interopRequireDefault(_eventemitter); -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); +var _math = __webpack_require__(8); -module.exports = baseCreate; +var _utils = __webpack_require__(3); +var _settings = __webpack_require__(6); -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { +var _settings2 = _interopRequireDefault(_settings); -var arrayPush = __webpack_require__(47), - isFlattenable = __webpack_require__(361); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * The base implementation of `_.flatten` with support for restricting flattening. + * A texture stores the information that represents an image or part of an image. It cannot be added + * to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided + * then the whole image is used. * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. + * You can directly create a texture from an image and then reuse it multiple times like this : + * + * ```js + * let texture = PIXI.Texture.fromImage('assets/image.png'); + * let sprite1 = new PIXI.Sprite(texture); + * let sprite2 = new PIXI.Sprite(texture); + * ``` + * + * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing. + * You can check for this by checking the sprite's _textureID property. + * ```js + * var texture = PIXI.Texture.fromImage('assets/image.svg'); + * var sprite1 = new PIXI.Sprite(texture); + * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file + * ``` + * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068. + * + * @class + * @extends EventEmitter + * @memberof PIXI */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; +var Texture = function (_EventEmitter) { + _inherits(Texture, _EventEmitter); - predicate || (predicate = isFlattenable); - result || (result = []); + /** + * @param {PIXI.BaseTexture} baseTexture - The base texture source to create the texture from + * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show + * @param {PIXI.Rectangle} [orig] - The area of original texture + * @param {PIXI.Rectangle} [trim] - Trimmed rectangle of original texture + * @param {number} [rotate] - indicates how the texture was rotated by texture packer. See {@link PIXI.GroupD8} + */ + function Texture(baseTexture, frame, orig, trim, rotate) { + _classCallCheck(this, Texture); - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} + /** + * Does this Texture have any frame data assigned to it? + * + * @member {boolean} + */ + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); -module.exports = baseFlatten; + _this.noFrame = false; + if (!frame) { + _this.noFrame = true; + frame = new _math.Rectangle(0, 0, 1, 1); + } -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { + if (baseTexture instanceof Texture) { + baseTexture = baseTexture.baseTexture; + } -var castPath = __webpack_require__(27), - toKey = __webpack_require__(20); + /** + * The base texture that this texture uses. + * + * @member {PIXI.BaseTexture} + */ + _this.baseTexture = baseTexture; -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = castPath(path, object); + /** + * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, + * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) + * + * @member {PIXI.Rectangle} + */ + _this._frame = frame; - var index = 0, - length = path.length; + /** + * This is the trimmed area of original texture, before it was put in atlas + * + * @member {PIXI.Rectangle} + */ + _this.trim = trim; - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; -} + /** + * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. + * + * @member {boolean} + */ + _this.valid = false; -module.exports = baseGet; + /** + * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) + * + * @member {boolean} + */ + _this.requiresUpdate = false; + /** + * The WebGL UV data cache. + * + * @member {PIXI.TextureUvs} + * @private + */ + _this._uvs = null; -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * This is the area of original texture, before it was put in atlas + * + * @member {PIXI.Rectangle} + */ + _this.orig = orig || frame; // new Rectangle(0, 0, 1, 1); -var baseRest = __webpack_require__(4), - isIterateeCall = __webpack_require__(34); + _this._rotate = Number(rotate || 0); -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; + if (rotate === true) { + // this is old texturepacker legacy, some games/libraries are passing "true" for rotated textures + _this._rotate = 2; + } else if (_this._rotate % 2 !== 0) { + throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually'); + } - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; + if (baseTexture.hasLoaded) { + if (_this.noFrame) { + frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height); - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } + // if there is no frame we should monitor for any base texture changes.. + baseTexture.on('update', _this.onBaseTextureUpdated, _this); + } + _this.frame = frame; + } else { + baseTexture.once('loaded', _this.onBaseTextureLoaded, _this); + } + + /** + * Fired when the texture is updated. This happens if the frame or the baseTexture is updated. + * + * @event PIXI.Texture#update + * @protected + * @param {PIXI.Texture} texture - Instance of texture being updated. + */ + + _this._updateID = 0; + + /** + * Extra field for extra plugins. May contain clamp settings and some matrices + * @type {Object} + */ + _this.transform = null; + + /** + * The ids under which this Texture has been added to the texture cache. This is + * automatically set as long as Texture.addToCache is used, but may not be set if a + * Texture is added directly to the TextureCache array. + * + * @member {string[]} + */ + _this.textureCacheIds = []; + return _this; } - return object; - }); -} -module.exports = createAssigner; + /** + * Updates this texture on the gpu. + * + */ -/***/ }), -/* 43 */ -/***/ (function(module, exports) { + Texture.prototype.update = function update() { + this.baseTexture.update(); + }; -/** - * Gets the argument placeholder value for `func`. - * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. - */ -function getHolder(func) { - var object = func; - return object.placeholder; -} + /** + * Called when the base texture is loaded + * + * @private + * @param {PIXI.BaseTexture} baseTexture - The base texture. + */ -module.exports = getHolder; + Texture.prototype.onBaseTextureLoaded = function onBaseTextureLoaded(baseTexture) { + this._updateID++; -/***/ }), -/* 44 */ -/***/ (function(module, exports) { + // TODO this code looks confusing.. boo to abusing getters and setters! + if (this.noFrame) { + this.frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height); + } else { + this.frame = this._frame; + } -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; + this.baseTexture.on('update', this.onBaseTextureUpdated, this); + this.emit('update', this); + }; -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; + /** + * Called when the base texture is updated + * + * @private + * @param {PIXI.BaseTexture} baseTexture - The base texture. + */ -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} -module.exports = isIndex; + Texture.prototype.onBaseTextureUpdated = function onBaseTextureUpdated(baseTexture) { + this._updateID++; + this._frame.width = baseTexture.width; + this._frame.height = baseTexture.height; -/***/ }), -/* 45 */ -/***/ (function(module, exports) { + this.emit('update', this); + }; -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} + /** + * Destroys this texture + * + * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well + */ -module.exports = eq; + Texture.prototype.destroy = function destroy(destroyBase) { + if (this.baseTexture) { + if (destroyBase) { + // delete the texture if it exists in the texture cache.. + // this only needs to be removed if the base texture is actually destroyed too.. + if (_utils.TextureCache[this.baseTexture.imageUrl]) { + Texture.removeFromCache(this.baseTexture.imageUrl); + } -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { + this.baseTexture.destroy(); + } -var baseGetTag = __webpack_require__(26), - isObjectLike = __webpack_require__(21); + this.baseTexture.off('update', this.onBaseTextureUpdated, this); + this.baseTexture.off('loaded', this.onBaseTextureLoaded, this); -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; + this.baseTexture = null; + } -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); -} + this._frame = null; + this._uvs = null; + this.trim = null; + this.orig = null; -module.exports = isSymbol; + this.valid = false; + Texture.removeFromCache(this); + this.textureCacheIds = null; + }; -/***/ }), -/* 47 */ -/***/ (function(module, exports) { + /** + * Creates a new texture object that acts the same as this one. + * + * @return {PIXI.Texture} The new texture + */ -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} + Texture.prototype.clone = function clone() { + return new Texture(this.baseTexture, this.frame, this.orig, this.trim, this.rotate); + }; -module.exports = arrayPush; + /** + * Updates the internal WebGL UV cache. + * + * @protected + */ -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { + Texture.prototype._updateUvs = function _updateUvs() { + if (!this._uvs) { + this._uvs = new _TextureUvs2.default(); + } -var Stack = __webpack_require__(62), - arrayEach = __webpack_require__(38), - assignValue = __webpack_require__(64), - baseAssign = __webpack_require__(146), - baseAssignIn = __webpack_require__(297), - cloneBuffer = __webpack_require__(169), - copyArray = __webpack_require__(28), - copySymbols = __webpack_require__(336), - copySymbolsIn = __webpack_require__(337), - getAllKeys = __webpack_require__(185), - getAllKeysIn = __webpack_require__(105), - getTag = __webpack_require__(73), - initCloneArray = __webpack_require__(358), - initCloneByTag = __webpack_require__(359), - initCloneObject = __webpack_require__(189), - isArray = __webpack_require__(1), - isBuffer = __webpack_require__(49), - isObject = __webpack_require__(6), - keys = __webpack_require__(9); + this._uvs.set(this._frame, this.baseTexture, this.rotate); -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; + this._updateID++; + }; -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; + /** + * Helper function that creates a Texture object from the given image url. + * If the image is not in the texture cache it will be created and loaded. + * + * @static + * @param {string} imageUrl - The image url of the texture + * @param {boolean} [crossorigin] - Whether requests should be treated as crossorigin + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {number} [sourceScale=(auto)] - Scale for the original image, used with SVG images. + * @return {PIXI.Texture} The newly created texture + */ -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; + Texture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) { + var texture = _utils.TextureCache[imageUrl]; -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; + if (!texture) { + texture = new Texture(_BaseTexture2.default.fromImage(imageUrl, crossorigin, scaleMode, sourceScale)); + Texture.addToCache(texture, imageUrl); + } - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); + return texture; + }; - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); + /** + * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId + * The frame ids are created when a Texture packer file has been loaded + * + * @static + * @param {string} frameId - The frame Id of the texture in the cache + * @return {PIXI.Texture} The newly created texture + */ - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} -module.exports = baseClone; + Texture.fromFrame = function fromFrame(frameId) { + var texture = _utils.TextureCache[frameId]; + if (!texture) { + throw new Error('The frameId "' + frameId + '" does not exist in the texture cache'); + } -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { + return texture; + }; -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(8), - stubFalse = __webpack_require__(219); + /** + * Helper function that creates a new Texture based on the given canvas element. + * + * @static + * @param {HTMLCanvasElement} canvas - The canvas element source of the texture + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {string} [origin='canvas'] - A string origin of who created the base texture + * @return {PIXI.Texture} The newly created texture + */ -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + Texture.fromCanvas = function fromCanvas(canvas, scaleMode) { + var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'canvas'; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; + return new Texture(_BaseTexture2.default.fromCanvas(canvas, scaleMode, origin)); + }; -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; + /** + * Helper function that creates a new Texture based on the given video element. + * + * @static + * @param {HTMLVideoElement|string} video - The URL or actual element of the video + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture + */ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; + Texture.fromVideo = function fromVideo(video, scaleMode) { + if (typeof video === 'string') { + return Texture.fromVideoUrl(video, scaleMode); + } -module.exports = isBuffer; + return new Texture(_VideoBaseTexture2.default.fromVideo(video, scaleMode)); + }; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module))) + /** + * Helper function that creates a new Texture based on the video url. + * + * @static + * @param {string} videoUrl - URL of the video + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @return {PIXI.Texture} The newly created texture + */ -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(6), - isSymbol = __webpack_require__(46); + Texture.fromVideoUrl = function fromVideoUrl(videoUrl, scaleMode) { + return new Texture(_VideoBaseTexture2.default.fromUrl(videoUrl, scaleMode)); + }; -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; + /** + * Helper function that creates a new Texture based on the source you provide. + * The source can be - frame id, image url, video url, canvas element, video element, base texture + * + * @static + * @param {number|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} + * source - Source to create texture from + * @return {PIXI.Texture} The newly created texture + */ -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + Texture.from = function from(source) { + // TODO auto detect cross origin.. + // TODO pass in scale mode? + if (typeof source === 'string') { + var texture = _utils.TextureCache[source]; -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; + if (!texture) { + // check if its a video.. + var isVideo = source.match(/\.(mp4|webm|ogg|h264|avi|mov)$/) !== null; -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; + if (isVideo) { + return Texture.fromVideoUrl(source); + } -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; + return Texture.fromImage(source); + } -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} + return texture; + } else if (source instanceof HTMLImageElement) { + return new Texture(_BaseTexture2.default.from(source)); + } else if (source instanceof HTMLCanvasElement) { + return Texture.fromCanvas(source, _settings2.default.SCALE_MODE, 'HTMLCanvasElement'); + } else if (source instanceof HTMLVideoElement) { + return Texture.fromVideo(source); + } else if (source instanceof _BaseTexture2.default) { + return new Texture(source); + } -module.exports = toNumber; + // lets assume its a texture! + return source; + }; + /** + * Create a texture from a source and add to the cache. + * + * @static + * @param {HTMLImageElement|HTMLCanvasElement} source - The input source. + * @param {String} imageUrl - File name of texture, for cache and resolving resolution. + * @param {String} [name] - Human readible name for the texture cache. If no name is + * specified, only `imageUrl` will be used as the cache ID. + * @return {PIXI.Texture} Output texture + */ -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { -var baseValues = __webpack_require__(168), - keys = __webpack_require__(9); + Texture.fromLoader = function fromLoader(source, imageUrl, name) { + var baseTexture = new _BaseTexture2.default(source, undefined, (0, _utils.getResolutionOfUrl)(imageUrl)); + var texture = new Texture(baseTexture); -/** - * Creates an array of the own enumerable string keyed property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ -function values(object) { - return object == null ? [] : baseValues(object, keys(object)); -} + baseTexture.imageUrl = imageUrl; -module.exports = values; + // No name, use imageUrl instead + if (!name) { + name = imageUrl; + } + // lets also add the frame to pixi's global cache for fromFrame and fromImage fucntions + _BaseTexture2.default.addToCache(texture.baseTexture, name); + Texture.addToCache(texture, name); -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { + // also add references by url if they are different. + if (name !== imageUrl) { + _BaseTexture2.default.addToCache(texture.baseTexture, imageUrl); + Texture.addToCache(texture, imageUrl); + } -"use strict"; + return texture; + }; + /** + * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object. + * + * @static + * @param {PIXI.Texture} texture - The Texture to add to the cache. + * @param {string} id - The id that the Texture will be stored against. + */ -exports.__esModule = true; -var _pixiGlCore = __webpack_require__(15); + Texture.addToCache = function addToCache(texture, id) { + if (id) { + if (texture.textureCacheIds.indexOf(id) === -1) { + texture.textureCacheIds.push(id); + } -var _settings = __webpack_require__(10); + // @if DEBUG + /* eslint-disable no-console */ + if (_utils.TextureCache[id]) { + console.warn('Texture added to the cache with an id [' + id + '] that already had an entry'); + } + /* eslint-enable no-console */ + // @endif -var _settings2 = _interopRequireDefault(_settings); + _utils.TextureCache[id] = texture; + } + }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * Remove a Texture from the global TextureCache. + * + * @static + * @param {string|PIXI.Texture} texture - id of a Texture to be removed, or a Texture instance itself + * @return {PIXI.Texture|null} The Texture that was removed + */ -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + Texture.removeFromCache = function removeFromCache(texture) { + if (typeof texture === 'string') { + var textureFromCache = _utils.TextureCache[texture]; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + if (textureFromCache) { + var index = textureFromCache.textureCacheIds.indexOf(texture); -var PRECISION = _settings2.default.PRECISION; + if (index > -1) { + textureFromCache.textureCacheIds.splice(index, 1); + } + delete _utils.TextureCache[texture]; -function checkPrecision(src) { - if (src instanceof Array) { - if (src[0].substring(0, 9) !== 'precision') { - var copy = src.slice(0); + return textureFromCache; + } + } else if (texture && texture.textureCacheIds) { + for (var i = 0; i < texture.textureCacheIds.length; ++i) { + // Check that texture matches the one being passed in before deleting it from the cache. + if (_utils.TextureCache[texture.textureCacheIds[i]] === texture) { + delete _utils.TextureCache[texture.textureCacheIds[i]]; + } + } - copy.unshift('precision ' + PRECISION + ' float;'); + texture.textureCacheIds.length = 0; - return copy; + return texture; } - } else if (src.substring(0, 9) !== 'precision') { - return 'precision ' + PRECISION + ' float;\n' + src; - } - - return src; -} - -/** - * Wrapper class, webGL Shader for Pixi. - * Adds precision string if vertexSrc or fragmentSrc have no mention of it. - * - * @class - * @extends GLShader - * @memberof PIXI - */ -var Shader = function (_GLShader) { - _inherits(Shader, _GLShader); + return null; + }; /** + * The frame specifies the region of the base texture that this texture uses. * - * @param {WebGLRenderingContext} gl - The current WebGL rendering context - * @param {string|string[]} vertexSrc - The vertex shader source as an array of strings. - * @param {string|string[]} fragmentSrc - The fragment shader source as an array of strings. + * @member {PIXI.Rectangle} */ - function Shader(gl, vertexSrc, fragmentSrc) { - _classCallCheck(this, Shader); - - return _possibleConstructorReturn(this, _GLShader.call(this, gl, checkPrecision(vertexSrc), checkPrecision(fragmentSrc))); - } - - return Shader; -}(_pixiGlCore.GLShader); - -exports.default = Shader; -//# sourceMappingURL=Shader.js.map - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -exports.__esModule = true; + _createClass(Texture, [{ + key: 'frame', + get: function get() { + return this._frame; + }, + set: function set(frame) // eslint-disable-line require-jsdoc + { + this._frame = frame; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + this.noFrame = false; -var _utils = __webpack_require__(5); + var x = frame.x, + y = frame.y, + width = frame.width, + height = frame.height; -var _DisplayObject2 = __webpack_require__(235); + var xNotFit = x + width > this.baseTexture.width; + var yNotFit = y + height > this.baseTexture.height; -var _DisplayObject3 = _interopRequireDefault(_DisplayObject2); + if (xNotFit || yNotFit) { + var relationship = xNotFit && yNotFit ? 'and' : 'or'; + var errorX = 'X: ' + x + ' + ' + width + ' = ' + (x + width) + ' > ' + this.baseTexture.width; + var errorY = 'Y: ' + y + ' + ' + height + ' = ' + (y + height) + ' > ' + this.baseTexture.height; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + throw new Error('Texture Error: frame does not fit inside the base Texture dimensions: ' + (errorX + ' ' + relationship + ' ' + errorY)); + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + // this.valid = width && height && this.baseTexture.source && this.baseTexture.hasLoaded; + this.valid = width && height && this.baseTexture.hasLoaded; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + if (!this.trim && !this.rotate) { + this.orig = frame; + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + if (this.valid) { + this._updateUvs(); + } + } -/** - * A Container represents a collection of display objects. - * It is the base class of all display objects that act as a container for other objects. - * - *```js - * let container = new PIXI.Container(); - * container.addChild(sprite); - * ``` - * - * @class - * @extends PIXI.DisplayObject - * @memberof PIXI - */ -var Container = function (_DisplayObject) { - _inherits(Container, _DisplayObject); + /** + * Indicates whether the texture is rotated inside the atlas + * set to 2 to compensate for texture packer rotation + * set to 6 to compensate for spine packer rotation + * can be used to rotate or mirror sprites + * See {@link PIXI.GroupD8} for explanation + * + * @member {number} + */ - /** - * - */ - function Container() { - _classCallCheck(this, Container); + }, { + key: 'rotate', + get: function get() { + return this._rotate; + }, + set: function set(rotate) // eslint-disable-line require-jsdoc + { + this._rotate = rotate; + if (this.valid) { + this._updateUvs(); + } + } /** - * The array of children of this container. + * The width of the Texture in pixels. * - * @member {PIXI.DisplayObject[]} - * @readonly + * @member {number} */ - var _this = _possibleConstructorReturn(this, _DisplayObject.call(this)); - _this.children = []; - return _this; - } + }, { + key: 'width', + get: function get() { + return this.orig.width; + } - /** - * Overridable method that can be used by Container subclasses whenever the children array is modified - * - * @private - */ + /** + * The height of the Texture in pixels. + * + * @member {number} + */ + }, { + key: 'height', + get: function get() { + return this.orig.height; + } + }]); - Container.prototype.onChildrenChange = function onChildrenChange() {} - /* empty */ + return Texture; +}(_eventemitter2.default); +exports.default = Texture; - /** - * Adds one or more children to the container. - * - * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` - * - * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container - * @return {PIXI.DisplayObject} The first child that was added. - */ - ; - Container.prototype.addChild = function addChild(child) { - var argumentsLength = arguments.length; +function createWhiteTexture() { + var canvas = document.createElement('canvas'); - // if there is only one argument we can bypass looping through the them - if (argumentsLength > 1) { - // loop through the arguments property and add all children - // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes - for (var i = 0; i < argumentsLength; i++) { - this.addChild(arguments[i]); - } - } else { - // if the child has a parent then lets remove it as Pixi objects can only exist in one place - if (child.parent) { - child.parent.removeChild(child); - } + canvas.width = 10; + canvas.height = 10; - child.parent = this; + var context = canvas.getContext('2d'); - // ensure a transform will be recalculated.. - this.transform._parentID = -1; - this._boundsID++; + context.fillStyle = 'white'; + context.fillRect(0, 0, 10, 10); - this.children.push(child); + return new Texture(new _BaseTexture2.default(canvas)); +} - // TODO - lets either do all callbacks or all events.. not both! - this.onChildrenChange(this.children.length - 1); - child.emit('added', this); - } +function removeAllHandlers(tex) { + tex.destroy = function _emptyDestroy() {/* empty */}; + tex.on = function _emptyOn() {/* empty */}; + tex.once = function _emptyOnce() {/* empty */}; + tex.emit = function _emptyEmit() {/* empty */}; +} - return child; - }; +/** + * An empty texture, used often to not have to create multiple empty textures. + * Can not be destroyed. + * + * @static + * @constant + */ +Texture.EMPTY = new Texture(new _BaseTexture2.default()); +removeAllHandlers(Texture.EMPTY); +removeAllHandlers(Texture.EMPTY.baseTexture); - /** - * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown - * - * @param {PIXI.DisplayObject} child - The child to add - * @param {number} index - The index to place the child in - * @return {PIXI.DisplayObject} The child that was added. - */ +/** + * A white texture of 10x10 size, used for graphics and other things + * Can not be destroyed. + * + * @static + * @constant + */ +Texture.WHITE = createWhiteTexture(); +removeAllHandlers(Texture.WHITE); +removeAllHandlers(Texture.WHITE.baseTexture); +//# sourceMappingURL=Texture.js.map +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { - Container.prototype.addChildAt = function addChildAt(child, index) { - if (index < 0 || index > this.children.length) { - throw new Error(child + 'addChildAt: The index ' + index + ' supplied is out of bounds ' + this.children.length); - } +var root = __webpack_require__(9); - if (child.parent) { - child.parent.removeChild(child); - } +/** Built-in value references. */ +var Symbol = root.Symbol; - child.parent = this; +module.exports = Symbol; - this.children.splice(index, 0, child); - // TODO - lets either do all callbacks or all events.. not both! - this.onChildrenChange(index); - child.emit('added', this); +/***/ }), +/* 39 */ +/***/ (function(module, exports) { - return child; - }; +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; - /** - * Swaps the position of 2 Display Objects within this container. - * - * @param {PIXI.DisplayObject} child - First display object to swap - * @param {PIXI.DisplayObject} child2 - Second display object to swap - */ + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} +module.exports = arrayEach; - Container.prototype.swapChildren = function swapChildren(child, child2) { - if (child === child2) { - return; - } - var index1 = this.getChildIndex(child); - var index2 = this.getChildIndex(child2); +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { - this.children[index1] = child2; - this.children[index2] = child; - this.onChildrenChange(index1 < index2 ? index1 : index2); - }; +var isObject = __webpack_require__(7); - /** - * Returns the index position of a child DisplayObject instance - * - * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify - * @return {number} The index position of the child display object to identify - */ +/** Built-in value references. */ +var objectCreate = Object.create; +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); - Container.prototype.getChildIndex = function getChildIndex(child) { - var index = this.children.indexOf(child); +module.exports = baseCreate; - if (index === -1) { - throw new Error('The supplied DisplayObject must be a child of the caller'); - } - return index; - }; +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Changes the position of an existing child in the display object container - * - * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number - * @param {number} index - The resulting index number for the child display object - */ +var arrayPush = __webpack_require__(49), + isFlattenable = __webpack_require__(361); +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; - Container.prototype.setChildIndex = function setChildIndex(child, index) { - if (index < 0 || index >= this.children.length) { - throw new Error('The supplied index is out of bounds'); - } + predicate || (predicate = isFlattenable); + result || (result = []); - var currentIndex = this.getChildIndex(child); + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} - (0, _utils.removeItems)(this.children, currentIndex, 1); // remove from old position - this.children.splice(index, 0, child); // add at new position - this.onChildrenChange(index); - }; +module.exports = baseFlatten; - /** - * Returns the child at the specified index - * - * @param {number} index - The index to get the child at - * @return {PIXI.DisplayObject} The child at the given index, if any. - */ +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { - Container.prototype.getChildAt = function getChildAt(index) { - if (index < 0 || index >= this.children.length) { - throw new Error('getChildAt: Index (' + index + ') does not exist.'); - } +var castPath = __webpack_require__(26), + toKey = __webpack_require__(19); - return this.children[index]; - }; +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); - /** - * Removes one or more children from the container. - * - * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove - * @return {PIXI.DisplayObject} The first child that was removed. - */ + var index = 0, + length = path.length; + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} - Container.prototype.removeChild = function removeChild(child) { - var argumentsLength = arguments.length; +module.exports = baseGet; - // if there is only one argument we can bypass looping through the them - if (argumentsLength > 1) { - // loop through the arguments property and add all children - // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes - for (var i = 0; i < argumentsLength; i++) { - this.removeChild(arguments[i]); - } - } else { - var index = this.children.indexOf(child); - if (index === -1) return null; +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { - child.parent = null; - (0, _utils.removeItems)(this.children, index, 1); +var baseRest = __webpack_require__(5), + isIterateeCall = __webpack_require__(34); - // ensure a transform will be recalculated.. - this.transform._parentID = -1; - this._boundsID++; +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; - // TODO - lets either do all callbacks or all events.. not both! - this.onChildrenChange(index); - child.emit('removed', this); - } + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; - return child; - }; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} - /** - * Removes a child from the specified index position. - * - * @param {number} index - The index to get the child from - * @return {PIXI.DisplayObject} The child that was removed. - */ +module.exports = createAssigner; - Container.prototype.removeChildAt = function removeChildAt(index) { - var child = this.getChildAt(index); +/***/ }), +/* 44 */ +/***/ (function(module, exports) { - child.parent = null; - (0, _utils.removeItems)(this.children, index, 1); +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getHolder(func) { + var object = func; + return object.placeholder; +} - // TODO - lets either do all callbacks or all events.. not both! - this.onChildrenChange(index); - child.emit('removed', this); +module.exports = getHolder; - return child; - }; - /** - * Removes all children from this container that are within the begin and end indexes. - * - * @param {number} [beginIndex=0] - The beginning position. - * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. - * @returns {DisplayObject[]} List of removed children - */ +/***/ }), +/* 45 */ +/***/ (function(module, exports) { +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; - Container.prototype.removeChildren = function removeChildren() { - var beginIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var endIndex = arguments[1]; +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; - var begin = beginIndex; - var end = typeof endIndex === 'number' ? endIndex : this.children.length; - var range = end - begin; - var removed = void 0; +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} - if (range > 0 && range <= end) { - removed = this.children.splice(begin, range); +module.exports = isIndex; - for (var i = 0; i < removed.length; ++i) { - removed[i].parent = null; - } - this.onChildrenChange(beginIndex); +/***/ }), +/* 46 */ +/***/ (function(module, exports) { - for (var _i = 0; _i < removed.length; ++_i) { - removed[_i].emit('removed', this); - } +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} - return removed; - } else if (range === 0 && this.children.length === 0) { - return []; - } +module.exports = eq; - throw new RangeError('removeChildren: numeric values are outside the acceptable range.'); - }; - /** - * Updates the transform on all children of this container for rendering - */ +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { +var baseGetTag = __webpack_require__(25), + isObjectLike = __webpack_require__(20); - Container.prototype.updateTransform = function updateTransform() { - this._boundsID++; +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; - this.transform.updateTransform(this.parent.transform); +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} - // TODO: check render flags, how to process stuff here - this.worldAlpha = this.alpha * this.parent.worldAlpha; +module.exports = isSymbol; - for (var i = 0, j = this.children.length; i < j; ++i) { - var child = this.children[i]; - if (child.visible) { - child.updateTransform(); - } - } - }; +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Recalculates the bounds of the container. - * - */ +"use strict"; - Container.prototype.calculateBounds = function calculateBounds() { - this._bounds.clear(); +exports.__esModule = true; - this._calculateBounds(); +var _utils = __webpack_require__(3); - for (var i = 0; i < this.children.length; i++) { - var child = this.children[i]; +var _settings = __webpack_require__(6); - if (!child.visible || !child.renderable) { - continue; - } +var _settings2 = _interopRequireDefault(_settings); - child.calculateBounds(); +var _eventemitter = __webpack_require__(30); - // TODO: filter+mask, need to mask both somehow - if (child._mask) { - child._mask.calculateBounds(); - this._bounds.addBoundsMask(child._bounds, child._mask._bounds); - } else if (child.filterArea) { - this._bounds.addBoundsArea(child._bounds, child.filterArea); - } else { - this._bounds.addBounds(child._bounds); - } - } +var _eventemitter2 = _interopRequireDefault(_eventemitter); - this._lastBoundsID = this._boundsID; - }; +var _determineCrossOrigin = __webpack_require__(557); - /** - * Recalculates the bounds of the object. Override this to - * calculate the bounds of the specific object (not including children). - * - */ +var _determineCrossOrigin2 = _interopRequireDefault(_determineCrossOrigin); +var _bitTwiddle = __webpack_require__(87); - Container.prototype._calculateBounds = function _calculateBounds() {} - // FILL IN// +var _bitTwiddle2 = _interopRequireDefault(_bitTwiddle); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Renders the object using the WebGL renderer - * - * @param {PIXI.WebGLRenderer} renderer - The renderer - */ - ; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - Container.prototype.renderWebGL = function renderWebGL(renderer) { - // if the object is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.worldAlpha <= 0 || !this.renderable) { - return; - } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - // do a quick check to see if this element has a mask or a filter. - if (this._mask || this._filters) { - this.renderAdvancedWebGL(renderer); - } else { - this._renderWebGL(renderer); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - // simple render children! - for (var i = 0, j = this.children.length; i < j; ++i) { - this.children[i].renderWebGL(renderer); - } - } - }; +/** + * A texture stores the information that represents an image. All textures have a base texture. + * + * @class + * @extends EventEmitter + * @memberof PIXI + */ +var BaseTexture = function (_EventEmitter) { + _inherits(BaseTexture, _EventEmitter); /** - * Render the object using the WebGL renderer and advanced features. - * - * @private - * @param {PIXI.WebGLRenderer} renderer - The renderer + * @param {HTMLImageElement|HTMLCanvasElement} [source] - the source object of the texture. + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture */ + function BaseTexture(source, scaleMode, resolution) { + _classCallCheck(this, BaseTexture); + var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - Container.prototype.renderAdvancedWebGL = function renderAdvancedWebGL(renderer) { - renderer.flush(); + _this.uid = (0, _utils.uid)(); - var filters = this._filters; - var mask = this._mask; + _this.touched = 0; - // push filter first as we need to ensure the stencil buffer is correct for any masking - if (filters) { - if (!this._enabledFilters) { - this._enabledFilters = []; - } + /** + * The resolution / device pixel ratio of the texture + * + * @member {number} + * @default 1 + */ + _this.resolution = resolution || _settings2.default.RESOLUTION; - this._enabledFilters.length = 0; + /** + * The width of the base texture set when the image has loaded + * + * @readonly + * @member {number} + */ + _this.width = 100; - for (var i = 0; i < filters.length; i++) { - if (filters[i].enabled) { - this._enabledFilters.push(filters[i]); - } - } + /** + * The height of the base texture set when the image has loaded + * + * @readonly + * @member {number} + */ + _this.height = 100; - if (this._enabledFilters.length) { - renderer.filterManager.pushFilter(this, this._enabledFilters); - } - } + // TODO docs + // used to store the actual dimensions of the source + /** + * Used to store the actual width of the source of this texture + * + * @readonly + * @member {number} + */ + _this.realWidth = 100; + /** + * Used to store the actual height of the source of this texture + * + * @readonly + * @member {number} + */ + _this.realHeight = 100; - if (mask) { - renderer.maskManager.pushMask(this, this._mask); - } + /** + * The scale mode to apply when scaling this texture + * + * @member {number} + * @default PIXI.settings.SCALE_MODE + * @see PIXI.SCALE_MODES + */ + _this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE; - // add this object to the batch, only rendered if it has a texture. - this._renderWebGL(renderer); + /** + * Set to true once the base texture has successfully loaded. + * + * This is never true if the underlying source fails to load or has no texture data. + * + * @readonly + * @member {boolean} + */ + _this.hasLoaded = false; - // now loop through the children and make sure they get rendered - for (var _i2 = 0, j = this.children.length; _i2 < j; _i2++) { - this.children[_i2].renderWebGL(renderer); - } + /** + * Set to true if the source is currently loading. + * + * If an Image source is loading the 'loaded' or 'error' event will be + * dispatched when the operation ends. An underyling source that is + * immediately-available bypasses loading entirely. + * + * @readonly + * @member {boolean} + */ + _this.isLoading = false; - renderer.flush(); + /** + * The image source that is used to create the texture. + * + * TODO: Make this a setter that calls loadSource(); + * + * @readonly + * @member {HTMLImageElement|HTMLCanvasElement} + */ + _this.source = null; // set in loadSource, if at all - if (mask) { - renderer.maskManager.popMask(this, this._mask); - } + /** + * The image source that is used to create the texture. This is used to + * store the original Svg source when it is replaced with a canvas element. + * + * TODO: Currently not in use but could be used when re-scaling svg. + * + * @readonly + * @member {Image} + */ + _this.origSource = null; // set in loadSvg, if at all - if (filters && this._enabledFilters && this._enabledFilters.length) { - renderer.filterManager.popFilter(); - } - }; + /** + * Type of image defined in source, eg. `png` or `svg` + * + * @readonly + * @member {string} + */ + _this.imageType = null; // set in updateImageType - /** - * To be overridden by the subclasses. - * - * @private - * @param {PIXI.WebGLRenderer} renderer - The renderer - */ + /** + * Scale for source image. Used with Svg images to scale them before rasterization. + * + * @readonly + * @member {number} + */ + _this.sourceScale = 1.0; + + /** + * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) + * All blend modes, and shaders written for default value. Change it on your own risk. + * + * @member {boolean} + * @default true + */ + _this.premultipliedAlpha = true; + /** + * The image url of the texture + * + * @member {string} + */ + _this.imageUrl = null; - Container.prototype._renderWebGL = function _renderWebGL(renderer) // eslint-disable-line no-unused-vars - {} - // this is where content itself gets rendered... + /** + * Whether or not the texture is a power of two, try to use power of two textures as much + * as you can + * + * @private + * @member {boolean} + */ + _this.isPowerOfTwo = false; + // used for webGL - /** - * To be overridden by the subclass - * - * @private - * @param {PIXI.CanvasRenderer} renderer - The renderer - */ - ; + /** + * + * Set this to true if a mipmap of this texture needs to be generated. This value needs + * to be set before the texture is used + * Also the texture must be a power of two size to work + * + * @member {boolean} + * @see PIXI.MIPMAP_TEXTURES + */ + _this.mipmap = _settings2.default.MIPMAP_TEXTURES; - Container.prototype._renderCanvas = function _renderCanvas(renderer) // eslint-disable-line no-unused-vars - {} - // this is where content itself gets rendered... + /** + * + * WebGL Texture wrap mode + * + * @member {number} + * @see PIXI.WRAP_MODES + */ + _this.wrapMode = _settings2.default.WRAP_MODE; + + /** + * A map of renderer IDs to webgl textures + * + * @private + * @member {object} + */ + _this._glTextures = {}; + + _this._enabled = 0; + _this._virtalBoundId = -1; + + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} + * @private + * @readonly + */ + _this._destroyed = false; + + /** + * The ids under which this BaseTexture has been added to the base texture cache. This is + * automatically set as long as BaseTexture.addToCache is used, but may not be set if a + * BaseTexture is added directly to the BaseTextureCache array. + * + * @member {string[]} + */ + _this.textureCacheIds = []; + + // if no source passed don't try to load + if (source) { + _this.loadSource(source); + } + + /** + * Fired when a not-immediately-available source finishes loading. + * + * @protected + * @event PIXI.BaseTexture#loaded + * @param {PIXI.BaseTexture} baseTexture - Resource loaded. + */ + /** + * Fired when a not-immediately-available source fails to load. + * + * @protected + * @event PIXI.BaseTexture#error + * @param {PIXI.BaseTexture} baseTexture - Resource errored. + */ + + /** + * Fired when BaseTexture is updated. + * + * @protected + * @event PIXI.BaseTexture#update + * @param {PIXI.BaseTexture} baseTexture - Instance of texture being updated. + */ + + /** + * Fired when BaseTexture is destroyed. + * + * @protected + * @event PIXI.BaseTexture#dispose + * @param {PIXI.BaseTexture} baseTexture - Instance of texture being destroyed. + */ + return _this; + } /** - * Renders the object using the Canvas renderer + * Updates the texture on all the webgl renderers, this also assumes the src has changed. * - * @param {PIXI.CanvasRenderer} renderer - The renderer + * @fires PIXI.BaseTexture#update */ - ; - Container.prototype.renderCanvas = function renderCanvas(renderer) { - // if not visible or the alpha is 0 then no need to render this - if (!this.visible || this.worldAlpha <= 0 || !this.renderable) { - return; - } - if (this._mask) { - renderer.maskManager.pushMask(this._mask); - } + BaseTexture.prototype.update = function update() { + // Svg size is handled during load + if (this.imageType !== 'svg') { + this.realWidth = this.source.naturalWidth || this.source.videoWidth || this.source.width; + this.realHeight = this.source.naturalHeight || this.source.videoHeight || this.source.height; - this._renderCanvas(renderer); - for (var i = 0, j = this.children.length; i < j; ++i) { - this.children[i].renderCanvas(renderer); + this._updateDimensions(); } - if (this._mask) { - renderer.maskManager.popMask(renderer); - } + this.emit('update', this); }; /** - * Removes all internal references and listeners as well as removes children from the display list. - * Do not use a Container after calling `destroy`. - * - * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options - * have been set to that value - * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy - * method called as well. 'options' will be passed on to those calls. - * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true - * Should it destroy the texture of the child sprite - * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true - * Should it destroy the base texture of the child sprite + * Update dimensions from real values */ - Container.prototype.destroy = function destroy(options) { - _DisplayObject.prototype.destroy.call(this); - - var destroyChildren = typeof options === 'boolean' ? options : options && options.children; - - var oldChildren = this.removeChildren(0, this.children.length); + BaseTexture.prototype._updateDimensions = function _updateDimensions() { + this.width = this.realWidth / this.resolution; + this.height = this.realHeight / this.resolution; - if (destroyChildren) { - for (var i = 0; i < oldChildren.length; ++i) { - oldChildren[i].destroy(options); - } - } + this.isPowerOfTwo = _bitTwiddle2.default.isPow2(this.realWidth) && _bitTwiddle2.default.isPow2(this.realHeight); }; /** - * The width of the Container, setting this will actually modify the scale to achieve the value set + * Load a source. * - * @member {number} + * If the source is not-immediately-available, such as an image that needs to be + * downloaded, then the 'loaded' or 'error' event will be dispatched in the future + * and `hasLoaded` will remain false after this call. + * + * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: + * + * if (texture.hasLoaded) { + * // texture ready for use + * } else if (texture.isLoading) { + * // listen to 'loaded' and/or 'error' events on texture + * } else { + * // not loading, not going to load UNLESS the source is reloaded + * // (it may still make sense to listen to the events) + * } + * + * @protected + * @param {HTMLImageElement|HTMLCanvasElement} source - the source object of the texture. */ - _createClass(Container, [{ - key: 'width', - get: function get() { - return this.scale.x * this.getLocalBounds().width; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - var width = this.getLocalBounds().width; + BaseTexture.prototype.loadSource = function loadSource(source) { + var wasLoading = this.isLoading; - if (width !== 0) { - this.scale.x = value / width; - } else { - this.scale.x = 1; - } + this.hasLoaded = false; + this.isLoading = false; - this._width = value; + if (wasLoading && this.source) { + this.source.onload = null; + this.source.onerror = null; } - /** - * The height of the Container, setting this will actually modify the scale to achieve the value set - * - * @member {number} - */ + var firstSourceLoaded = !this.source; - }, { - key: 'height', - get: function get() { - return this.scale.y * this.getLocalBounds().height; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - var height = this.getLocalBounds().height; + this.source = source; - if (height !== 0) { - this.scale.y = value / height; + // Apply source if loaded. Otherwise setup appropriate loading monitors. + if ((source.src && source.complete || source.getContext) && source.width && source.height) { + this._updateImageType(); + + if (this.imageType === 'svg') { + this._loadSvgSource(); } else { - this.scale.y = 1; + this._sourceLoaded(); } - this._height = value; - } - }]); + if (firstSourceLoaded) { + // send loaded event if previous source was null and we have been passed a pre-loaded IMG element + this.emit('loaded', this); + } + } else if (!source.getContext) { + // Image fail / not ready + this.isLoading = true; - return Container; -}(_DisplayObject3.default); + var scope = this; -// performance increase to avoid using call.. (10x faster) + source.onload = function () { + scope._updateImageType(); + source.onload = null; + source.onerror = null; + if (!scope.isLoading) { + return; + } -exports.default = Container; -Container.prototype.containerUpdateTransform = Container.prototype.updateTransform; -//# sourceMappingURL=Container.js.map + scope.isLoading = false; + scope._sourceLoaded(); -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { + if (scope.imageType === 'svg') { + scope._loadSvgSource(); -"use strict"; + return; + } + scope.emit('loaded', scope); + }; -exports.__esModule = true; + source.onerror = function () { + source.onload = null; + source.onerror = null; -var _SystemRenderer2 = __webpack_require__(241); + if (!scope.isLoading) { + return; + } -var _SystemRenderer3 = _interopRequireDefault(_SystemRenderer2); + scope.isLoading = false; + scope.emit('error', scope); + }; -var _CanvasMaskManager = __webpack_require__(536); + // Per http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element + // "The value of `complete` can thus change while a script is executing." + // So complete needs to be re-checked after the callbacks have been added.. + // NOTE: complete will be true if the image has no src so best to check if the src is set. + if (source.complete && source.src) { + // ..and if we're complete now, no need for callbacks + source.onload = null; + source.onerror = null; -var _CanvasMaskManager2 = _interopRequireDefault(_CanvasMaskManager); + if (scope.imageType === 'svg') { + scope._loadSvgSource(); -var _CanvasRenderTarget = __webpack_require__(242); + return; + } -var _CanvasRenderTarget2 = _interopRequireDefault(_CanvasRenderTarget); + this.isLoading = false; -var _mapCanvasBlendModesToPixi = __webpack_require__(537); + if (source.width && source.height) { + this._sourceLoaded(); -var _mapCanvasBlendModesToPixi2 = _interopRequireDefault(_mapCanvasBlendModesToPixi); + // If any previous subscribers possible + if (wasLoading) { + this.emit('loaded', this); + } + } + // If any previous subscribers possible + else if (wasLoading) { + this.emit('error', this); + } + } + } + }; -var _utils = __webpack_require__(5); + /** + * Updates type of the source image. + */ -var _const = __webpack_require__(2); -var _settings = __webpack_require__(10); + BaseTexture.prototype._updateImageType = function _updateImageType() { + if (!this.imageUrl) { + return; + } -var _settings2 = _interopRequireDefault(_settings); + var dataUri = (0, _utils.decomposeDataUri)(this.imageUrl); + var imageType = void 0; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + if (dataUri && dataUri.mediaType === 'image') { + // Check for subType validity + var firstSubType = dataUri.subType.split('+')[0]; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + imageType = (0, _utils.getUrlFileExtension)('.' + firstSubType); -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + if (!imageType) { + throw new Error('Invalid image type in data URI.'); + } + } else { + imageType = (0, _utils.getUrlFileExtension)(this.imageUrl); -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + if (!imageType) { + imageType = 'png'; + } + } -/** - * The CanvasRenderer draws the scene and all its content onto a 2d canvas. This renderer should - * be used for browsers that do not support WebGL. Don't forget to add the CanvasRenderer.view to - * your DOM or you will not see anything :) - * - * @class - * @memberof PIXI - * @extends PIXI.SystemRenderer - */ -var CanvasRenderer = function (_SystemRenderer) { - _inherits(CanvasRenderer, _SystemRenderer); + this.imageType = imageType; + }; /** - * @param {number} [width=800] - the width of the canvas view - * @param {number} [height=600] - the height of the canvas view - * @param {object} [options] - The optional renderer parameters - * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional - * @param {boolean} [options.transparent=false] - If the render view is transparent, default false - * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false - * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment) - * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The - * resolution of the renderer retina would be 2. - * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or - * not before the new render pass. - * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area - * (shown if not transparent). - * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering, - * stopping pixel interpolation. + * Checks if `source` is an SVG image and whether it's loaded via a URL or a data URI. Then calls + * `_loadSvgSourceUsingDataUri` or `_loadSvgSourceUsingXhr`. */ - function CanvasRenderer(width, height) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - _classCallCheck(this, CanvasRenderer); - var _this = _possibleConstructorReturn(this, _SystemRenderer.call(this, 'Canvas', width, height, options)); + BaseTexture.prototype._loadSvgSource = function _loadSvgSource() { + if (this.imageType !== 'svg') { + // Do nothing if source is not svg + return; + } - _this.type = _const.RENDERER_TYPE.CANVAS; + var dataUri = (0, _utils.decomposeDataUri)(this.imageUrl); - /** - * The canvas 2d context that everything is drawn with. - * - * @member {CanvasRenderingContext2D} - */ - _this.rootContext = _this.view.getContext('2d', { alpha: _this.transparent }); + if (dataUri) { + this._loadSvgSourceUsingDataUri(dataUri); + } else { + // We got an URL, so we need to do an XHR to check the svg size + this._loadSvgSourceUsingXhr(); + } + }; - /** - * Boolean flag controlling canvas refresh. - * - * @member {boolean} - */ - _this.refresh = true; + /** + * Reads an SVG string from data URI and then calls `_loadSvgSourceUsingString`. + * + * @param {string} dataUri - The data uri to load from. + */ - /** - * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. - * - * @member {PIXI.CanvasMaskManager} - */ - _this.maskManager = new _CanvasMaskManager2.default(_this); - /** - * The canvas property used to set the canvas smoothing property. - * - * @member {string} - */ - _this.smoothProperty = 'imageSmoothingEnabled'; + BaseTexture.prototype._loadSvgSourceUsingDataUri = function _loadSvgSourceUsingDataUri(dataUri) { + var svgString = void 0; - if (!_this.rootContext.imageSmoothingEnabled) { - if (_this.rootContext.webkitImageSmoothingEnabled) { - _this.smoothProperty = 'webkitImageSmoothingEnabled'; - } else if (_this.rootContext.mozImageSmoothingEnabled) { - _this.smoothProperty = 'mozImageSmoothingEnabled'; - } else if (_this.rootContext.oImageSmoothingEnabled) { - _this.smoothProperty = 'oImageSmoothingEnabled'; - } else if (_this.rootContext.msImageSmoothingEnabled) { - _this.smoothProperty = 'msImageSmoothingEnabled'; + if (dataUri.encoding === 'base64') { + if (!atob) { + throw new Error('Your browser doesn\'t support base64 conversions.'); } + svgString = atob(dataUri.data); + } else { + svgString = dataUri.data; } - _this.initPlugins(); + this._loadSvgSourceUsingString(svgString); + }; - _this.blendModes = (0, _mapCanvasBlendModesToPixi2.default)(); - _this._activeBlendMode = null; + /** + * Loads an SVG string from `imageUrl` using XHR and then calls `_loadSvgSourceUsingString`. + */ - _this.context = null; - _this.renderingToScreen = false; - _this.resize(width, height); - return _this; - } + BaseTexture.prototype._loadSvgSourceUsingXhr = function _loadSvgSourceUsingXhr() { + var _this2 = this; + + var svgXhr = new XMLHttpRequest(); + + // This throws error on IE, so SVG Document can't be used + // svgXhr.responseType = 'document'; + + // This is not needed since we load the svg as string (breaks IE too) + // but overrideMimeType() can be used to force the response to be parsed as XML + // svgXhr.overrideMimeType('image/svg+xml'); + + svgXhr.onload = function () { + if (svgXhr.readyState !== svgXhr.DONE || svgXhr.status !== 200) { + throw new Error('Failed to load SVG using XHR.'); + } + + _this2._loadSvgSourceUsingString(svgXhr.response); + }; + + svgXhr.onerror = function () { + return _this2.emit('error', _this2); + }; + + svgXhr.open('GET', this.imageUrl, true); + svgXhr.send(); + }; /** - * Renders the object to this canvas view + * Loads texture using an SVG string. The original SVG Image is stored as `origSource` and the + * created canvas is the new `source`. The SVG is scaled using `sourceScale`. Called by + * `_loadSvgSourceUsingXhr` or `_loadSvgSourceUsingDataUri`. * - * @param {PIXI.DisplayObject} displayObject - The object to be rendered - * @param {PIXI.RenderTexture} [renderTexture] - A render texture to be rendered to. - * If unset, it will render to the root context. - * @param {boolean} [clear=false] - Whether to clear the canvas before drawing - * @param {PIXI.Transform} [transform] - A transformation to be applied - * @param {boolean} [skipUpdateTransform=false] - Whether to skip the update transform + * @param {string} svgString SVG source as string + * + * @fires PIXI.BaseTexture#loaded */ - CanvasRenderer.prototype.render = function render(displayObject, renderTexture, clear, transform, skipUpdateTransform) { - if (!this.view) { - return; + BaseTexture.prototype._loadSvgSourceUsingString = function _loadSvgSourceUsingString(svgString) { + var svgSize = (0, _utils.getSvgSize)(svgString); + + var svgWidth = svgSize.width; + var svgHeight = svgSize.height; + + if (!svgWidth || !svgHeight) { + throw new Error('The SVG image must have width and height defined (in pixels), canvas API needs them.'); } - // can be handy to know! - this.renderingToScreen = !renderTexture; + // Scale realWidth and realHeight + this.realWidth = Math.round(svgWidth * this.sourceScale); + this.realHeight = Math.round(svgHeight * this.sourceScale); - this.emit('prerender'); + this._updateDimensions(); - var rootResolution = this.resolution; + // Create a canvas element + var canvas = document.createElement('canvas'); - if (renderTexture) { - renderTexture = renderTexture.baseTexture || renderTexture; + canvas.width = this.realWidth; + canvas.height = this.realHeight; + canvas._pixiId = 'canvas_' + (0, _utils.uid)(); - if (!renderTexture._canvasRenderTarget) { - renderTexture._canvasRenderTarget = new _CanvasRenderTarget2.default(renderTexture.width, renderTexture.height, renderTexture.resolution); - renderTexture.source = renderTexture._canvasRenderTarget.canvas; - renderTexture.valid = true; - } + // Draw the Svg to the canvas + canvas.getContext('2d').drawImage(this.source, 0, 0, svgWidth, svgHeight, 0, 0, this.realWidth, this.realHeight); - this.context = renderTexture._canvasRenderTarget.context; - this.resolution = renderTexture._canvasRenderTarget.resolution; - } else { - this.context = this.rootContext; - } + // Replace the original source image with the canvas + this.origSource = this.source; + this.source = canvas; - var context = this.context; + // Add also the canvas in cache (destroy clears by `imageUrl` and `source._pixiId`) + BaseTexture.addToCache(this, canvas._pixiId); - if (!renderTexture) { - this._lastObjectRendered = displayObject; - } + this.isLoading = false; + this._sourceLoaded(); + this.emit('loaded', this); + }; - if (!skipUpdateTransform) { - // update the scene graph - var cacheParent = displayObject.parent; - var tempWt = this._tempDisplayObjectParent.transform.worldTransform; + /** + * Used internally to update the width, height, and some other tracking vars once + * a source has successfully loaded. + * + * @private + */ - if (transform) { - transform.copy(tempWt); - } else { - tempWt.identity(); - } - displayObject.parent = this._tempDisplayObjectParent; - displayObject.updateTransform(); - displayObject.parent = cacheParent; - // displayObject.hitArea = //TODO add a temp hit area - } + BaseTexture.prototype._sourceLoaded = function _sourceLoaded() { + this.hasLoaded = true; + this.update(); + }; - context.setTransform(1, 0, 0, 1, 0, 0); - context.globalAlpha = 1; - context.globalCompositeOperation = this.blendModes[_const.BLEND_MODES.NORMAL]; + /** + * Destroys this base texture + * + */ - if (navigator.isCocoonJS && this.view.screencanvas) { - context.fillStyle = 'black'; - context.clear(); - } - if (clear !== undefined ? clear : this.clearBeforeRender) { - if (this.renderingToScreen) { - if (this.transparent) { - context.clearRect(0, 0, this.width, this.height); - } else { - context.fillStyle = this._backgroundColorString; - context.fillRect(0, 0, this.width, this.height); - } - } // else { - // TODO: implement background for CanvasRenderTarget or RenderTexture? - // } + BaseTexture.prototype.destroy = function destroy() { + if (this.imageUrl) { + delete _utils.TextureCache[this.imageUrl]; + + this.imageUrl = null; + + if (!navigator.isCocoonJS) { + this.source.src = ''; + } } - // TODO RENDER TARGET STUFF HERE.. - var tempContext = this.context; + this.source = null; - this.context = context; - displayObject.renderCanvas(this); - this.context = tempContext; + this.dispose(); - this.resolution = rootResolution; + BaseTexture.removeFromCache(this); + this.textureCacheIds = null; - this.emit('postrender'); + this._destroyed = true; }; /** - * Clear the canvas of renderer. + * Frees the texture from WebGL memory without destroying this texture object. + * This means you can still use the texture later which will upload it to GPU + * memory again. * - * @param {string} [clearColor] - Clear the canvas with this color, except the canvas is transparent. + * @fires PIXI.BaseTexture#dispose */ - CanvasRenderer.prototype.clear = function clear(clearColor) { - var context = this.context; - - clearColor = clearColor || this._backgroundColorString; - - if (!this.transparent && clearColor) { - context.fillStyle = clearColor; - context.fillRect(0, 0, this.width, this.height); - } else { - context.clearRect(0, 0, this.width, this.height); - } + BaseTexture.prototype.dispose = function dispose() { + this.emit('dispose', this); }; /** - * Sets the blend mode of the renderer. + * Changes the source image of the texture. + * The original source must be an Image element. * - * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values. + * @param {string} newSrc - the path of the image */ - CanvasRenderer.prototype.setBlendMode = function setBlendMode(blendMode) { - if (this._activeBlendMode === blendMode) { - return; - } + BaseTexture.prototype.updateSourceImage = function updateSourceImage(newSrc) { + this.source.src = newSrc; - this._activeBlendMode = blendMode; - this.context.globalCompositeOperation = this.blendModes[blendMode]; + this.loadSource(this.source); }; /** - * Removes everything from the renderer and optionally removes the Canvas DOM element. + * Helper function that creates a base texture from the given image url. + * If the image is not in the base texture cache it will be created and loaded. * - * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM. + * @static + * @param {string} imageUrl - The image url of the texture + * @param {boolean} [crossorigin=(auto)] - Should use anonymous CORS? Defaults to true if the URL is not a data-URI. + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {number} [sourceScale=(auto)] - Scale for the original image, used with Svg images. + * @return {PIXI.BaseTexture} The new base texture. */ - CanvasRenderer.prototype.destroy = function destroy(removeView) { - this.destroyPlugins(); + BaseTexture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) { + var baseTexture = _utils.BaseTextureCache[imageUrl]; - // call the base destroy - _SystemRenderer.prototype.destroy.call(this, removeView); + if (!baseTexture) { + // new Image() breaks tex loading in some versions of Chrome. + // See https://code.google.com/p/chromium/issues/detail?id=238071 + var image = new Image(); // document.createElement('img'); - this.context = null; + if (crossorigin === undefined && imageUrl.indexOf('data:') !== 0) { + image.crossOrigin = (0, _determineCrossOrigin2.default)(imageUrl); + } else if (crossorigin) { + image.crossOrigin = typeof crossorigin === 'string' ? crossorigin : 'anonymous'; + } - this.refresh = true; + baseTexture = new BaseTexture(image, scaleMode); + baseTexture.imageUrl = imageUrl; - this.maskManager.destroy(); - this.maskManager = null; + if (sourceScale) { + baseTexture.sourceScale = sourceScale; + } - this.smoothProperty = null; + // if there is an @2x at the end of the url we are going to assume its a highres image + baseTexture.resolution = (0, _utils.getResolutionOfUrl)(imageUrl); + + image.src = imageUrl; // Setting this triggers load + + BaseTexture.addToCache(baseTexture, imageUrl); + } + + return baseTexture; }; /** - * Resizes the canvas view to the specified width and height. - * - * @extends PIXI.SystemRenderer#resize + * Helper function that creates a base texture from the given canvas element. * - * @param {number} width - The new width of the canvas view - * @param {number} height - The new height of the canvas view + * @static + * @param {HTMLCanvasElement} canvas - The canvas element source of the texture + * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values + * @param {string} [origin='canvas'] - A string origin of who created the base texture + * @return {PIXI.BaseTexture} The new base texture. */ - CanvasRenderer.prototype.resize = function resize(width, height) { - _SystemRenderer.prototype.resize.call(this, width, height); + BaseTexture.fromCanvas = function fromCanvas(canvas, scaleMode) { + var origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'canvas'; - // reset the scale mode.. oddly this seems to be reset when the canvas is resized. - // surely a browser bug?? Let pixi fix that for you.. - if (this.smoothProperty) { - this.rootContext[this.smoothProperty] = _settings2.default.SCALE_MODE === _const.SCALE_MODES.LINEAR; + if (!canvas._pixiId) { + canvas._pixiId = origin + '_' + (0, _utils.uid)(); } - }; - return CanvasRenderer; -}(_SystemRenderer3.default); + var baseTexture = _utils.BaseTextureCache[canvas._pixiId]; -exports.default = CanvasRenderer; + if (!baseTexture) { + baseTexture = new BaseTexture(canvas, scaleMode); + BaseTexture.addToCache(baseTexture, canvas._pixiId); + } + return baseTexture; + }; -_utils.pluginTarget.mixin(CanvasRenderer); -//# sourceMappingURL=CanvasRenderer.js.map + /** + * Helper function that creates a base texture based on the source you provide. + * The source can be - image url, image element, canvas element. + * + * @static + * @param {string|HTMLImageElement|HTMLCanvasElement} source - The source to create base texture from. + * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values + * @param {number} [sourceScale=(auto)] - Scale for the original image, used with Svg images. + * @return {PIXI.BaseTexture} The new base texture. + */ -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + BaseTexture.from = function from(source, scaleMode, sourceScale) { + if (typeof source === 'string') { + return BaseTexture.fromImage(source, undefined, scaleMode, sourceScale); + } else if (source instanceof HTMLImageElement) { + var imageUrl = source.src; + var baseTexture = _utils.BaseTextureCache[imageUrl]; + if (!baseTexture) { + baseTexture = new BaseTexture(source, scaleMode); + baseTexture.imageUrl = imageUrl; -exports.__esModule = true; + if (sourceScale) { + baseTexture.sourceScale = sourceScale; + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + // if there is an @2x at the end of the url we are going to assume its a highres image + baseTexture.resolution = (0, _utils.getResolutionOfUrl)(imageUrl); -/** - * @class - * @memberof PIXI - */ -var WebGLManager = function () { - /** - * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. - */ - function WebGLManager(renderer) { - _classCallCheck(this, WebGLManager); + BaseTexture.addToCache(baseTexture, imageUrl); + } + + return baseTexture; + } else if (source instanceof HTMLCanvasElement) { + return BaseTexture.fromCanvas(source, scaleMode); + } + + // lets assume its a base texture! + return source; + }; /** - * The renderer this manager works for. + * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object. * - * @member {PIXI.WebGLRenderer} + * @static + * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache. + * @param {string} id - The id that the BaseTexture will be stored against. */ - this.renderer = renderer; - - this.renderer.on('context', this.onContextChange, this); - } - /** - * Generic method called when there is a WebGL context change. - * - */ + BaseTexture.addToCache = function addToCache(baseTexture, id) { + if (id) { + if (baseTexture.textureCacheIds.indexOf(id) === -1) { + baseTexture.textureCacheIds.push(id); + } - WebGLManager.prototype.onContextChange = function onContextChange() {} - // do some codes init! + // @if DEBUG + /* eslint-disable no-console */ + if (_utils.BaseTextureCache[id]) { + console.warn('BaseTexture added to the cache with an id [' + id + '] that already had an entry'); + } + /* eslint-enable no-console */ + // @endif + _utils.BaseTextureCache[id] = baseTexture; + } + }; - /** - * Generic destroy methods to be overridden by the subclass - * - */ - ; + /** + * Remove a BaseTexture from the global BaseTextureCache. + * + * @static + * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself. + * @return {PIXI.BaseTexture|null} The BaseTexture that was removed. + */ - WebGLManager.prototype.destroy = function destroy() { - this.renderer.off('context', this.onContextChange, this); - this.renderer = null; - }; + BaseTexture.removeFromCache = function removeFromCache(baseTexture) { + if (typeof baseTexture === 'string') { + var baseTextureFromCache = _utils.BaseTextureCache[baseTexture]; - return WebGLManager; -}(); + if (baseTextureFromCache) { + var index = baseTextureFromCache.textureCacheIds.indexOf(baseTexture); -exports.default = WebGLManager; -//# sourceMappingURL=WebGLManager.js.map + if (index > -1) { + baseTextureFromCache.textureCacheIds.splice(index, 1); + } -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { + delete _utils.BaseTextureCache[baseTexture]; -"use strict"; + return baseTextureFromCache; + } + } else if (baseTexture && baseTexture.textureCacheIds) { + for (var i = 0; i < baseTexture.textureCacheIds.length; ++i) { + delete _utils.BaseTextureCache[baseTexture.textureCacheIds[i]]; + } + baseTexture.textureCacheIds.length = 0; -exports.__esModule = true; + return baseTexture; + } -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + return null; + }; -var _utils = __webpack_require__(5); + return BaseTexture; +}(_eventemitter2.default); -var _settings = __webpack_require__(10); +exports.default = BaseTexture; +//# sourceMappingURL=BaseTexture.js.map -var _settings2 = _interopRequireDefault(_settings); +/***/ }), +/* 49 */ +/***/ (function(module, exports) { -var _eventemitter = __webpack_require__(24); +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; -var _eventemitter2 = _interopRequireDefault(_eventemitter); + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} -var _determineCrossOrigin = __webpack_require__(556); +module.exports = arrayPush; -var _determineCrossOrigin2 = _interopRequireDefault(_determineCrossOrigin); -var _bitTwiddle = __webpack_require__(88); +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { -var _bitTwiddle2 = _interopRequireDefault(_bitTwiddle); +var Stack = __webpack_require__(61), + arrayEach = __webpack_require__(39), + assignValue = __webpack_require__(63), + baseAssign = __webpack_require__(147), + baseAssignIn = __webpack_require__(297), + cloneBuffer = __webpack_require__(170), + copyArray = __webpack_require__(27), + copySymbols = __webpack_require__(336), + copySymbolsIn = __webpack_require__(337), + getAllKeys = __webpack_require__(186), + getAllKeysIn = __webpack_require__(105), + getTag = __webpack_require__(72), + initCloneArray = __webpack_require__(358), + initCloneByTag = __webpack_require__(359), + initCloneObject = __webpack_require__(190), + isArray = __webpack_require__(2), + isBuffer = __webpack_require__(51), + isObject = __webpack_require__(7), + keys = __webpack_require__(10); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; /** - * A texture stores the information that represents an image. All textures have a base texture. + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. * - * @class - * @extends EventEmitter - * @memberof PIXI + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. */ -var BaseTexture = function (_EventEmitter) { - _inherits(BaseTexture, _EventEmitter); - - /** - * @param {HTMLImageElement|HTMLCanvasElement} [source] - the source object of the texture. - * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values - * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture - */ - function BaseTexture(source, scaleMode, resolution) { - _classCallCheck(this, BaseTexture); - - var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; - _this.uid = (0, _utils.uid)(); + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; - _this.touched = 0; + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); - /** - * The resolution / device pixel ratio of the texture - * - * @member {number} - * @default 1 - */ - _this.resolution = resolution || _settings2.default.RESOLUTION; + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); - /** - * The width of the base texture set when the image has loaded - * - * @readonly - * @member {number} - */ - _this.width = 100; - - /** - * The height of the base texture set when the image has loaded - * - * @readonly - * @member {number} - */ - _this.height = 100; + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} - // TODO docs - // used to store the actual dimensions of the source - /** - * Used to store the actual width of the source of this texture - * - * @readonly - * @member {number} - */ - _this.realWidth = 100; - /** - * Used to store the actual height of the source of this texture - * - * @readonly - * @member {number} - */ - _this.realHeight = 100; +module.exports = baseClone; - /** - * The scale mode to apply when scaling this texture - * - * @member {number} - * @default PIXI.settings.SCALE_MODE - * @see PIXI.SCALE_MODES - */ - _this.scaleMode = scaleMode || _settings2.default.SCALE_MODE; - /** - * Set to true once the base texture has successfully loaded. - * - * This is never true if the underlying source fails to load or has no texture data. - * - * @readonly - * @member {boolean} - */ - _this.hasLoaded = false; +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Set to true if the source is currently loading. - * - * If an Image source is loading the 'loaded' or 'error' event will be - * dispatched when the operation ends. An underyling source that is - * immediately-available bypasses loading entirely. - * - * @readonly - * @member {boolean} - */ - _this.isLoading = false; +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(9), + stubFalse = __webpack_require__(220); - /** - * The image source that is used to create the texture. - * - * TODO: Make this a setter that calls loadSource(); - * - * @readonly - * @member {HTMLImageElement|HTMLCanvasElement} - */ - _this.source = null; // set in loadSource, if at all +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - /** - * The image source that is used to create the texture. This is used to - * store the original Svg source when it is replaced with a canvas element. - * - * TODO: Currently not in use but could be used when re-scaling svg. - * - * @readonly - * @member {Image} - */ - _this.origSource = null; // set in loadSvg, if at all +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - /** - * Type of image defined in source, eg. `png` or `svg` - * - * @readonly - * @member {string} - */ - _this.imageType = null; // set in updateImageType +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; - /** - * Scale for source image. Used with Svg images to scale them before rasterization. - * - * @readonly - * @member {number} - */ - _this.sourceScale = 1.0; +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; - /** - * Controls if RGB channels should be pre-multiplied by Alpha (WebGL only) - * All blend modes, and shaders written for default value. Change it on your own risk. - * - * @member {boolean} - * @default true - */ - _this.premultipliedAlpha = true; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - /** - * The image url of the texture - * - * @member {string} - */ - _this.imageUrl = null; +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; - /** - * Whether or not the texture is a power of two, try to use power of two textures as much - * as you can - * - * @private - * @member {boolean} - */ - _this.isPowerOfTwo = false; +module.exports = isBuffer; - // used for webGL +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(85)(module))) - /** - * - * Set this to true if a mipmap of this texture needs to be generated. This value needs - * to be set before the texture is used - * Also the texture must be a power of two size to work - * - * @member {boolean} - * @see PIXI.MIPMAP_TEXTURES - */ - _this.mipmap = _settings2.default.MIPMAP_TEXTURES; +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * - * WebGL Texture wrap mode - * - * @member {number} - * @see PIXI.WRAP_MODES - */ - _this.wrapMode = _settings2.default.WRAP_MODE; +var isObject = __webpack_require__(7), + isSymbol = __webpack_require__(47); - /** - * A map of renderer IDs to webgl textures - * - * @private - * @member {object} - */ - _this._glTextures = {}; +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; - _this._enabled = 0; - _this._virtalBoundId = -1; +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; - // if no source passed don't try to load - if (source) { - _this.loadSource(source); - } +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - /** - * Fired when a not-immediately-available source finishes loading. - * - * @protected - * @event loaded - * @memberof PIXI.BaseTexture# - */ +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; - /** - * Fired when a not-immediately-available source fails to load. - * - * @protected - * @event error - * @memberof PIXI.BaseTexture# - */ - return _this; - } +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; - /** - * Updates the texture on all the webgl renderers, this also assumes the src has changed. - * - * @fires update - */ +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} - BaseTexture.prototype.update = function update() { - // Svg size is handled during load - if (this.imageType !== 'svg') { - this.realWidth = this.source.naturalWidth || this.source.videoWidth || this.source.width; - this.realHeight = this.source.naturalHeight || this.source.videoHeight || this.source.height; +module.exports = toNumber; - this.width = this.realWidth / this.resolution; - this.height = this.realHeight / this.resolution; - this.isPowerOfTwo = _bitTwiddle2.default.isPow2(this.realWidth) && _bitTwiddle2.default.isPow2(this.realHeight); - } +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { - this.emit('update', this); - }; +var baseValues = __webpack_require__(169), + keys = __webpack_require__(10); - /** - * Load a source. - * - * If the source is not-immediately-available, such as an image that needs to be - * downloaded, then the 'loaded' or 'error' event will be dispatched in the future - * and `hasLoaded` will remain false after this call. - * - * The logic state after calling `loadSource` directly or indirectly (eg. `fromImage`, `new BaseTexture`) is: - * - * if (texture.hasLoaded) { - * // texture ready for use - * } else if (texture.isLoading) { - * // listen to 'loaded' and/or 'error' events on texture - * } else { - * // not loading, not going to load UNLESS the source is reloaded - * // (it may still make sense to listen to the events) - * } - * - * @protected - * @param {HTMLImageElement|HTMLCanvasElement} source - the source object of the texture. - */ +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ +function values(object) { + return object == null ? [] : baseValues(object, keys(object)); +} +module.exports = values; - BaseTexture.prototype.loadSource = function loadSource(source) { - var _this2 = this; - var wasLoading = this.isLoading; +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { - this.hasLoaded = false; - this.isLoading = false; +"use strict"; - if (wasLoading && this.source) { - this.source.onload = null; - this.source.onerror = null; - } - var firstSourceLoaded = !this.source; +exports.__esModule = true; - this.source = source; +var _pixiGlCore = __webpack_require__(15); - // Apply source if loaded. Otherwise setup appropriate loading monitors. - if ((source.src && source.complete || source.getContext) && source.width && source.height) { - this._updateImageType(); +var _settings = __webpack_require__(6); - if (this.imageType === 'svg') { - this._loadSvgSource(); - } else { - this._sourceLoaded(); - } +var _settings2 = _interopRequireDefault(_settings); - if (firstSourceLoaded) { - // send loaded event if previous source was null and we have been passed a pre-loaded IMG element - this.emit('loaded', this); - } - } else if (!source.getContext) { - var _ret = function () { - // Image fail / not ready - _this2.isLoading = true; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var scope = _this2; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - source.onload = function () { - scope._updateImageType(); - source.onload = null; - source.onerror = null; +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - if (!scope.isLoading) { - return; - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - scope.isLoading = false; - scope._sourceLoaded(); +function checkPrecision(src, def) { + if (src instanceof Array) { + if (src[0].substring(0, 9) !== 'precision') { + var copy = src.slice(0); - if (scope.imageType === 'svg') { - scope._loadSvgSource(); + copy.unshift('precision ' + def + ' float;'); - return; - } + return copy; + } + } else if (src.substring(0, 9) !== 'precision') { + return 'precision ' + def + ' float;\n' + src; + } - scope.emit('loaded', scope); - }; + return src; +} - source.onerror = function () { - source.onload = null; - source.onerror = null; +/** + * Wrapper class, webGL Shader for Pixi. + * Adds precision string if vertexSrc or fragmentSrc have no mention of it. + * + * @class + * @extends GLShader + * @memberof PIXI + */ - if (!scope.isLoading) { - return; - } +var Shader = function (_GLShader) { + _inherits(Shader, _GLShader); - scope.isLoading = false; - scope.emit('error', scope); - }; + /** + * + * @param {WebGLRenderingContext} gl - The current WebGL rendering context + * @param {string|string[]} vertexSrc - The vertex shader source as an array of strings. + * @param {string|string[]} fragmentSrc - The fragment shader source as an array of strings. + */ + function Shader(gl, vertexSrc, fragmentSrc) { + _classCallCheck(this, Shader); - // Per http://www.w3.org/TR/html5/embedded-content-0.html#the-img-element - // "The value of `complete` can thus change while a script is executing." - // So complete needs to be re-checked after the callbacks have been added.. - // NOTE: complete will be true if the image has no src so best to check if the src is set. - if (source.complete && source.src) { - // ..and if we're complete now, no need for callbacks - source.onload = null; - source.onerror = null; + return _possibleConstructorReturn(this, _GLShader.call(this, gl, checkPrecision(vertexSrc, _settings2.default.PRECISION_VERTEX), checkPrecision(fragmentSrc, _settings2.default.PRECISION_FRAGMENT))); + } - if (scope.imageType === 'svg') { - scope._loadSvgSource(); + return Shader; +}(_pixiGlCore.GLShader); - return { - v: void 0 - }; - } +exports.default = Shader; +//# sourceMappingURL=Shader.js.map - _this2.isLoading = false; +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { - if (source.width && source.height) { - _this2._sourceLoaded(); +"use strict"; - // If any previous subscribers possible - if (wasLoading) { - _this2.emit('loaded', _this2); - } - } - // If any previous subscribers possible - else if (wasLoading) { - _this2.emit('error', _this2); - } - } - }(); - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; - } - }; +exports.__esModule = true; - /** - * Updates type of the source image. - */ +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _utils = __webpack_require__(3); - BaseTexture.prototype._updateImageType = function _updateImageType() { - if (!this.imageUrl) { - return; - } +var _DisplayObject2 = __webpack_require__(237); - var dataUri = (0, _utils.decomposeDataUri)(this.imageUrl); - var imageType = void 0; +var _DisplayObject3 = _interopRequireDefault(_DisplayObject2); - if (dataUri && dataUri.mediaType === 'image') { - // Check for subType validity - var firstSubType = dataUri.subType.split('+')[0]; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - imageType = (0, _utils.getUrlFileExtension)('.' + firstSubType); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - if (!imageType) { - throw new Error('Invalid image type in data URI.'); - } - } else { - imageType = (0, _utils.getUrlFileExtension)(this.imageUrl); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - if (!imageType) { - imageType = 'png'; - } - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - this.imageType = imageType; - }; +/** + * A Container represents a collection of display objects. + * It is the base class of all display objects that act as a container for other objects. + * + *```js + * let container = new PIXI.Container(); + * container.addChild(sprite); + * ``` + * + * @class + * @extends PIXI.DisplayObject + * @memberof PIXI + */ +var Container = function (_DisplayObject) { + _inherits(Container, _DisplayObject); /** - * Checks if `source` is an SVG image and whether it's loaded via a URL or a data URI. Then calls - * `_loadSvgSourceUsingDataUri` or `_loadSvgSourceUsingXhr`. + * */ + function Container() { + _classCallCheck(this, Container); + /** + * The array of children of this container. + * + * @member {PIXI.DisplayObject[]} + * @readonly + */ + var _this = _possibleConstructorReturn(this, _DisplayObject.call(this)); - BaseTexture.prototype._loadSvgSource = function _loadSvgSource() { - if (this.imageType !== 'svg') { - // Do nothing if source is not svg - return; - } - - var dataUri = (0, _utils.decomposeDataUri)(this.imageUrl); - - if (dataUri) { - this._loadSvgSourceUsingDataUri(dataUri); - } else { - // We got an URL, so we need to do an XHR to check the svg size - this._loadSvgSourceUsingXhr(); - } - }; + _this.children = []; + return _this; + } /** - * Reads an SVG string from data URI and then calls `_loadSvgSourceUsingString`. + * Overridable method that can be used by Container subclasses whenever the children array is modified * - * @param {string} dataUri - The data uri to load from. + * @private */ - BaseTexture.prototype._loadSvgSourceUsingDataUri = function _loadSvgSourceUsingDataUri(dataUri) { - var svgString = void 0; - - if (dataUri.encoding === 'base64') { - if (!atob) { - throw new Error('Your browser doesn\'t support base64 conversions.'); - } - svgString = atob(dataUri.data); - } else { - svgString = dataUri.data; - } + Container.prototype.onChildrenChange = function onChildrenChange() {} + /* empty */ - this._loadSvgSourceUsingString(svgString); - }; /** - * Loads an SVG string from `imageUrl` using XHR and then calls `_loadSvgSourceUsingString`. - */ - - - BaseTexture.prototype._loadSvgSourceUsingXhr = function _loadSvgSourceUsingXhr() { - var _this3 = this; + * Adds one or more children to the container. + * + * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)` + * + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to add to the container + * @return {PIXI.DisplayObject} The first child that was added. + */ + ; - var svgXhr = new XMLHttpRequest(); + Container.prototype.addChild = function addChild(child) { + var argumentsLength = arguments.length; - // This throws error on IE, so SVG Document can't be used - // svgXhr.responseType = 'document'; + // if there is only one argument we can bypass looping through the them + if (argumentsLength > 1) { + // loop through the arguments property and add all children + // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes + for (var i = 0; i < argumentsLength; i++) { + this.addChild(arguments[i]); + } + } else { + // if the child has a parent then lets remove it as PixiJS objects can only exist in one place + if (child.parent) { + child.parent.removeChild(child); + } - // This is not needed since we load the svg as string (breaks IE too) - // but overrideMimeType() can be used to force the response to be parsed as XML - // svgXhr.overrideMimeType('image/svg+xml'); + child.parent = this; + // ensure child transform will be recalculated + child.transform._parentID = -1; - svgXhr.onload = function () { - if (svgXhr.readyState !== svgXhr.DONE || svgXhr.status !== 200) { - throw new Error('Failed to load SVG using XHR.'); - } + this.children.push(child); - _this3._loadSvgSourceUsingString(svgXhr.response); - }; + // ensure bounds will be recalculated + this._boundsID++; - svgXhr.onerror = function () { - return _this3.emit('error', _this3); - }; + // TODO - lets either do all callbacks or all events.. not both! + this.onChildrenChange(this.children.length - 1); + child.emit('added', this); + } - svgXhr.open('GET', this.imageUrl, true); - svgXhr.send(); + return child; }; /** - * Loads texture using an SVG string. The original SVG Image is stored as `origSource` and the - * created canvas is the new `source`. The SVG is scaled using `sourceScale`. Called by - * `_loadSvgSourceUsingXhr` or `_loadSvgSourceUsingDataUri`. - * - * @param {string} svgString SVG source as string + * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown * - * @fires loaded + * @param {PIXI.DisplayObject} child - The child to add + * @param {number} index - The index to place the child in + * @return {PIXI.DisplayObject} The child that was added. */ - BaseTexture.prototype._loadSvgSourceUsingString = function _loadSvgSourceUsingString(svgString) { - var svgSize = (0, _utils.getSvgSize)(svgString); - - var svgWidth = svgSize.width; - var svgHeight = svgSize.height; - - if (!svgWidth || !svgHeight) { - throw new Error('The SVG image must have width and height defined (in pixels), canvas API needs them.'); + Container.prototype.addChildAt = function addChildAt(child, index) { + if (index < 0 || index > this.children.length) { + throw new Error(child + 'addChildAt: The index ' + index + ' supplied is out of bounds ' + this.children.length); } - // Scale realWidth and realHeight - this.realWidth = Math.round(svgWidth * this.sourceScale); - this.realHeight = Math.round(svgHeight * this.sourceScale); - - this.width = this.realWidth / this.resolution; - this.height = this.realHeight / this.resolution; - - // Check pow2 after scale - this.isPowerOfTwo = _bitTwiddle2.default.isPow2(this.realWidth) && _bitTwiddle2.default.isPow2(this.realHeight); - - // Create a canvas element - var canvas = document.createElement('canvas'); + if (child.parent) { + child.parent.removeChild(child); + } - canvas.width = this.realWidth; - canvas.height = this.realHeight; - canvas._pixiId = 'canvas_' + (0, _utils.uid)(); + child.parent = this; + // ensure child transform will be recalculated + child.transform._parentID = -1; - // Draw the Svg to the canvas - canvas.getContext('2d').drawImage(this.source, 0, 0, svgWidth, svgHeight, 0, 0, this.realWidth, this.realHeight); + this.children.splice(index, 0, child); - // Replace the original source image with the canvas - this.origSource = this.source; - this.source = canvas; + // ensure bounds will be recalculated + this._boundsID++; - // Add also the canvas in cache (destroy clears by `imageUrl` and `source._pixiId`) - _utils.BaseTextureCache[canvas._pixiId] = this; + // TODO - lets either do all callbacks or all events.. not both! + this.onChildrenChange(index); + child.emit('added', this); - this.isLoading = false; - this._sourceLoaded(); - this.emit('loaded', this); + return child; }; /** - * Used internally to update the width, height, and some other tracking vars once - * a source has successfully loaded. + * Swaps the position of 2 Display Objects within this container. * - * @private + * @param {PIXI.DisplayObject} child - First display object to swap + * @param {PIXI.DisplayObject} child2 - Second display object to swap */ - BaseTexture.prototype._sourceLoaded = function _sourceLoaded() { - this.hasLoaded = true; - this.update(); + Container.prototype.swapChildren = function swapChildren(child, child2) { + if (child === child2) { + return; + } + + var index1 = this.getChildIndex(child); + var index2 = this.getChildIndex(child2); + + this.children[index1] = child2; + this.children[index2] = child; + this.onChildrenChange(index1 < index2 ? index1 : index2); }; /** - * Destroys this base texture + * Returns the index position of a child DisplayObject instance * + * @param {PIXI.DisplayObject} child - The DisplayObject instance to identify + * @return {number} The index position of the child display object to identify */ - BaseTexture.prototype.destroy = function destroy() { - if (this.imageUrl) { - delete _utils.BaseTextureCache[this.imageUrl]; - delete _utils.TextureCache[this.imageUrl]; - - this.imageUrl = null; + Container.prototype.getChildIndex = function getChildIndex(child) { + var index = this.children.indexOf(child); - if (!navigator.isCocoonJS) { - this.source.src = ''; - } - } - // An svg source has both `imageUrl` and `__pixiId`, so no `else if` here - if (this.source && this.source._pixiId) { - delete _utils.BaseTextureCache[this.source._pixiId]; + if (index === -1) { + throw new Error('The supplied DisplayObject must be a child of the caller'); } - this.source = null; - - this.dispose(); + return index; }; /** - * Frees the texture from WebGL memory without destroying this texture object. - * This means you can still use the texture later which will upload it to GPU - * memory again. + * Changes the position of an existing child in the display object container * + * @param {PIXI.DisplayObject} child - The child DisplayObject instance for which you want to change the index number + * @param {number} index - The resulting index number for the child display object */ - BaseTexture.prototype.dispose = function dispose() { - this.emit('dispose', this); + Container.prototype.setChildIndex = function setChildIndex(child, index) { + if (index < 0 || index >= this.children.length) { + throw new Error('The supplied index is out of bounds'); + } + + var currentIndex = this.getChildIndex(child); + + (0, _utils.removeItems)(this.children, currentIndex, 1); // remove from old position + this.children.splice(index, 0, child); // add at new position + + this.onChildrenChange(index); }; /** - * Changes the source image of the texture. - * The original source must be an Image element. + * Returns the child at the specified index * - * @param {string} newSrc - the path of the image + * @param {number} index - The index to get the child at + * @return {PIXI.DisplayObject} The child at the given index, if any. */ - BaseTexture.prototype.updateSourceImage = function updateSourceImage(newSrc) { - this.source.src = newSrc; + Container.prototype.getChildAt = function getChildAt(index) { + if (index < 0 || index >= this.children.length) { + throw new Error('getChildAt: Index (' + index + ') does not exist.'); + } - this.loadSource(this.source); + return this.children[index]; }; /** - * Helper function that creates a base texture from the given image url. - * If the image is not in the base texture cache it will be created and loaded. + * Removes one or more children from the container. * - * @static - * @param {string} imageUrl - The image url of the texture - * @param {boolean} [crossorigin=(auto)] - Should use anonymous CORS? Defaults to true if the URL is not a data-URI. - * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values - * @param {number} [sourceScale=(auto)] - Scale for the original image, used with Svg images. - * @return {PIXI.BaseTexture} The new base texture. + * @param {...PIXI.DisplayObject} child - The DisplayObject(s) to remove + * @return {PIXI.DisplayObject} The first child that was removed. */ - BaseTexture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) { - var baseTexture = _utils.BaseTextureCache[imageUrl]; - - if (!baseTexture) { - // new Image() breaks tex loading in some versions of Chrome. - // See https://code.google.com/p/chromium/issues/detail?id=238071 - var image = new Image(); // document.createElement('img'); + Container.prototype.removeChild = function removeChild(child) { + var argumentsLength = arguments.length; - if (crossorigin === undefined && imageUrl.indexOf('data:') !== 0) { - image.crossOrigin = (0, _determineCrossOrigin2.default)(imageUrl); + // if there is only one argument we can bypass looping through the them + if (argumentsLength > 1) { + // loop through the arguments property and add all children + // use it the right way (.length and [i]) so that this function can still be optimised by JS runtimes + for (var i = 0; i < argumentsLength; i++) { + this.removeChild(arguments[i]); } + } else { + var index = this.children.indexOf(child); - baseTexture = new BaseTexture(image, scaleMode); - baseTexture.imageUrl = imageUrl; - - if (sourceScale) { - baseTexture.sourceScale = sourceScale; - } + if (index === -1) return null; - // if there is an @2x at the end of the url we are going to assume its a highres image - baseTexture.resolution = (0, _utils.getResolutionOfUrl)(imageUrl); + child.parent = null; + // ensure child transform will be recalculated + child.transform._parentID = -1; + (0, _utils.removeItems)(this.children, index, 1); - image.src = imageUrl; // Setting this triggers load + // ensure bounds will be recalculated + this._boundsID++; - _utils.BaseTextureCache[imageUrl] = baseTexture; + // TODO - lets either do all callbacks or all events.. not both! + this.onChildrenChange(index); + child.emit('removed', this); } - return baseTexture; + return child; }; /** - * Helper function that creates a base texture from the given canvas element. + * Removes a child from the specified index position. * - * @static - * @param {HTMLCanvasElement} canvas - The canvas element source of the texture - * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.BaseTexture} The new base texture. + * @param {number} index - The index to get the child from + * @return {PIXI.DisplayObject} The child that was removed. */ - BaseTexture.fromCanvas = function fromCanvas(canvas, scaleMode) { - if (!canvas._pixiId) { - canvas._pixiId = 'canvas_' + (0, _utils.uid)(); - } - - var baseTexture = _utils.BaseTextureCache[canvas._pixiId]; - - if (!baseTexture) { - baseTexture = new BaseTexture(canvas, scaleMode); - _utils.BaseTextureCache[canvas._pixiId] = baseTexture; - } - - return baseTexture; - }; - - return BaseTexture; -}(_eventemitter2.default); - -exports.default = BaseTexture; -//# sourceMappingURL=BaseTexture.js.map - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + Container.prototype.removeChildAt = function removeChildAt(index) { + var child = this.getChildAt(index); -var _BaseTexture = __webpack_require__(56); + // ensure child transform will be recalculated.. + child.parent = null; + child.transform._parentID = -1; + (0, _utils.removeItems)(this.children, index, 1); -var _BaseTexture2 = _interopRequireDefault(_BaseTexture); + // ensure bounds will be recalculated + this._boundsID++; -var _VideoBaseTexture = __webpack_require__(250); + // TODO - lets either do all callbacks or all events.. not both! + this.onChildrenChange(index); + child.emit('removed', this); -var _VideoBaseTexture2 = _interopRequireDefault(_VideoBaseTexture); + return child; + }; -var _TextureUvs = __webpack_require__(249); + /** + * Removes all children from this container that are within the begin and end indexes. + * + * @param {number} [beginIndex=0] - The beginning position. + * @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container. + * @returns {DisplayObject[]} List of removed children + */ -var _TextureUvs2 = _interopRequireDefault(_TextureUvs); -var _eventemitter = __webpack_require__(24); + Container.prototype.removeChildren = function removeChildren() { + var beginIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var endIndex = arguments[1]; -var _eventemitter2 = _interopRequireDefault(_eventemitter); + var begin = beginIndex; + var end = typeof endIndex === 'number' ? endIndex : this.children.length; + var range = end - begin; + var removed = void 0; -var _math = __webpack_require__(7); + if (range > 0 && range <= end) { + removed = this.children.splice(begin, range); -var _utils = __webpack_require__(5); + for (var i = 0; i < removed.length; ++i) { + removed[i].parent = null; + if (removed[i].transform) { + removed[i].transform._parentID = -1; + } + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + this._boundsID++; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + this.onChildrenChange(beginIndex); -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + for (var _i = 0; _i < removed.length; ++_i) { + removed[_i].emit('removed', this); + } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + return removed; + } else if (range === 0 && this.children.length === 0) { + return []; + } -/** - * A texture stores the information that represents an image or part of an image. It cannot be added - * to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided - * then the whole image is used. - * - * You can directly create a texture from an image and then reuse it multiple times like this : - * - * ```js - * let texture = PIXI.Texture.fromImage('assets/image.png'); - * let sprite1 = new PIXI.Sprite(texture); - * let sprite2 = new PIXI.Sprite(texture); - * ``` - * - * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing. - * You can check for this by checking the sprite's _textureID property. - * ```js - * var texture = PIXI.Texture.fromImage('assets/image.svg'); - * var sprite1 = new PIXI.Sprite(texture); - * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file - * ``` - * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068. - * - * @class - * @extends EventEmitter - * @memberof PIXI - */ -var Texture = function (_EventEmitter) { - _inherits(Texture, _EventEmitter); + throw new RangeError('removeChildren: numeric values are outside the acceptable range.'); + }; /** - * @param {PIXI.BaseTexture} baseTexture - The base texture source to create the texture from - * @param {PIXI.Rectangle} [frame] - The rectangle frame of the texture to show - * @param {PIXI.Rectangle} [orig] - The area of original texture - * @param {PIXI.Rectangle} [trim] - Trimmed rectangle of original texture - * @param {number} [rotate] - indicates how the texture was rotated by texture packer. See {@link PIXI.GroupD8} + * Updates the transform on all children of this container for rendering */ - function Texture(baseTexture, frame, orig, trim, rotate) { - _classCallCheck(this, Texture); - - /** - * Does this Texture have any frame data assigned to it? - * - * @member {boolean} - */ - var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); - _this.noFrame = false; - if (!frame) { - _this.noFrame = true; - frame = new _math.Rectangle(0, 0, 1, 1); - } + Container.prototype.updateTransform = function updateTransform() { + this._boundsID++; - if (baseTexture instanceof Texture) { - baseTexture = baseTexture.baseTexture; - } + this.transform.updateTransform(this.parent.transform); - /** - * The base texture that this texture uses. - * - * @member {PIXI.BaseTexture} - */ - _this.baseTexture = baseTexture; + // TODO: check render flags, how to process stuff here + this.worldAlpha = this.alpha * this.parent.worldAlpha; - /** - * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, - * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases) - * - * @member {PIXI.Rectangle} - */ - _this._frame = frame; + for (var i = 0, j = this.children.length; i < j; ++i) { + var child = this.children[i]; - /** - * This is the trimmed area of original texture, before it was put in atlas - * - * @member {PIXI.Rectangle} - */ - _this.trim = trim; + if (child.visible) { + child.updateTransform(); + } + } + }; - /** - * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered. - * - * @member {boolean} - */ - _this.valid = false; + /** + * Recalculates the bounds of the container. + * + */ - /** - * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates) - * - * @member {boolean} - */ - _this.requiresUpdate = false; - /** - * The WebGL UV data cache. - * - * @member {PIXI.TextureUvs} - * @private - */ - _this._uvs = null; + Container.prototype.calculateBounds = function calculateBounds() { + this._bounds.clear(); - /** - * This is the area of original texture, before it was put in atlas - * - * @member {PIXI.Rectangle} - */ - _this.orig = orig || frame; // new Rectangle(0, 0, 1, 1); + this._calculateBounds(); - _this._rotate = Number(rotate || 0); + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; - if (rotate === true) { - // this is old texturepacker legacy, some games/libraries are passing "true" for rotated textures - _this._rotate = 2; - } else if (_this._rotate % 2 !== 0) { - throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually'); - } + if (!child.visible || !child.renderable) { + continue; + } - if (baseTexture.hasLoaded) { - if (_this.noFrame) { - frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height); + child.calculateBounds(); - // if there is no frame we should monitor for any base texture changes.. - baseTexture.on('update', _this.onBaseTextureUpdated, _this); + // TODO: filter+mask, need to mask both somehow + if (child._mask) { + child._mask.calculateBounds(); + this._bounds.addBoundsMask(child._bounds, child._mask._bounds); + } else if (child.filterArea) { + this._bounds.addBoundsArea(child._bounds, child.filterArea); + } else { + this._bounds.addBounds(child._bounds); } - _this.frame = frame; - } else { - baseTexture.once('loaded', _this.onBaseTextureLoaded, _this); } - /** - * Fired when the texture is updated. This happens if the frame or the baseTexture is updated. - * - * @event update - * @memberof PIXI.Texture# - * @protected - */ - - _this._updateID = 0; - - /** - * Extra field for extra plugins. May contain clamp settings and some matrices - * @type {Object} - */ - _this.transform = null; - return _this; - } + this._lastBoundsID = this._boundsID; + }; /** - * Updates this texture on the gpu. + * Recalculates the bounds of the object. Override this to + * calculate the bounds of the specific object (not including children). * */ - Texture.prototype.update = function update() { - this.baseTexture.update(); - }; + Container.prototype._calculateBounds = function _calculateBounds() {} + // FILL IN// + /** - * Called when the base texture is loaded + * Renders the object using the WebGL renderer * - * @private - * @param {PIXI.BaseTexture} baseTexture - The base texture. + * @param {PIXI.WebGLRenderer} renderer - The renderer */ + ; + Container.prototype.renderWebGL = function renderWebGL(renderer) { + // if the object is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.worldAlpha <= 0 || !this.renderable) { + return; + } - Texture.prototype.onBaseTextureLoaded = function onBaseTextureLoaded(baseTexture) { - this._updateID++; - - // TODO this code looks confusing.. boo to abusing getters and setters! - if (this.noFrame) { - this.frame = new _math.Rectangle(0, 0, baseTexture.width, baseTexture.height); + // do a quick check to see if this element has a mask or a filter. + if (this._mask || this._filters) { + this.renderAdvancedWebGL(renderer); } else { - this.frame = this._frame; - } + this._renderWebGL(renderer); - this.baseTexture.on('update', this.onBaseTextureUpdated, this); - this.emit('update', this); + // simple render children! + for (var i = 0, j = this.children.length; i < j; ++i) { + this.children[i].renderWebGL(renderer); + } + } }; /** - * Called when the base texture is updated + * Render the object using the WebGL renderer and advanced features. * * @private - * @param {PIXI.BaseTexture} baseTexture - The base texture. + * @param {PIXI.WebGLRenderer} renderer - The renderer */ - Texture.prototype.onBaseTextureUpdated = function onBaseTextureUpdated(baseTexture) { - this._updateID++; - - this._frame.width = baseTexture.width; - this._frame.height = baseTexture.height; + Container.prototype.renderAdvancedWebGL = function renderAdvancedWebGL(renderer) { + renderer.flush(); - this.emit('update', this); - }; + var filters = this._filters; + var mask = this._mask; - /** - * Destroys this texture - * - * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well - */ + // push filter first as we need to ensure the stencil buffer is correct for any masking + if (filters) { + if (!this._enabledFilters) { + this._enabledFilters = []; + } + this._enabledFilters.length = 0; - Texture.prototype.destroy = function destroy(destroyBase) { - if (this.baseTexture) { - if (destroyBase) { - // delete the texture if it exists in the texture cache.. - // this only needs to be removed if the base texture is actually destroyed too.. - if (_utils.TextureCache[this.baseTexture.imageUrl]) { - delete _utils.TextureCache[this.baseTexture.imageUrl]; + for (var i = 0; i < filters.length; i++) { + if (filters[i].enabled) { + this._enabledFilters.push(filters[i]); } - - this.baseTexture.destroy(); } - this.baseTexture.off('update', this.onBaseTextureUpdated, this); - this.baseTexture.off('loaded', this.onBaseTextureLoaded, this); - - this.baseTexture = null; + if (this._enabledFilters.length) { + renderer.filterManager.pushFilter(this, this._enabledFilters); + } } - this._frame = null; - this._uvs = null; - this.trim = null; - this.orig = null; - - this.valid = false; - - this.off('dispose', this.dispose, this); - this.off('update', this.update, this); - }; - - /** - * Creates a new texture object that acts the same as this one. - * - * @return {PIXI.Texture} The new texture - */ - - - Texture.prototype.clone = function clone() { - return new Texture(this.baseTexture, this.frame, this.orig, this.trim, this.rotate); - }; - - /** - * Updates the internal WebGL UV cache. - * - * @protected - */ - - - Texture.prototype._updateUvs = function _updateUvs() { - if (!this._uvs) { - this._uvs = new _TextureUvs2.default(); + if (mask) { + renderer.maskManager.pushMask(this, this._mask); } - this._uvs.set(this._frame, this.baseTexture, this.rotate); - - this._updateID++; - }; - - /** - * Helper function that creates a Texture object from the given image url. - * If the image is not in the texture cache it will be created and loaded. - * - * @static - * @param {string} imageUrl - The image url of the texture - * @param {boolean} [crossorigin] - Whether requests should be treated as crossorigin - * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values - * @param {number} [sourceScale=(auto)] - Scale for the original image, used with SVG images. - * @return {PIXI.Texture} The newly created texture - */ + // add this object to the batch, only rendered if it has a texture. + this._renderWebGL(renderer); + // now loop through the children and make sure they get rendered + for (var _i2 = 0, j = this.children.length; _i2 < j; _i2++) { + this.children[_i2].renderWebGL(renderer); + } - Texture.fromImage = function fromImage(imageUrl, crossorigin, scaleMode, sourceScale) { - var texture = _utils.TextureCache[imageUrl]; + renderer.flush(); - if (!texture) { - texture = new Texture(_BaseTexture2.default.fromImage(imageUrl, crossorigin, scaleMode, sourceScale)); - _utils.TextureCache[imageUrl] = texture; + if (mask) { + renderer.maskManager.popMask(this, this._mask); } - return texture; + if (filters && this._enabledFilters && this._enabledFilters.length) { + renderer.filterManager.popFilter(); + } }; /** - * Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId - * The frame ids are created when a Texture packer file has been loaded + * To be overridden by the subclasses. * - * @static - * @param {string} frameId - The frame Id of the texture in the cache - * @return {PIXI.Texture} The newly created texture + * @private + * @param {PIXI.WebGLRenderer} renderer - The renderer */ - Texture.fromFrame = function fromFrame(frameId) { - var texture = _utils.TextureCache[frameId]; - - if (!texture) { - throw new Error('The frameId "' + frameId + '" does not exist in the texture cache'); - } + Container.prototype._renderWebGL = function _renderWebGL(renderer) // eslint-disable-line no-unused-vars + {} + // this is where content itself gets rendered... - return texture; - }; /** - * Helper function that creates a new Texture based on the given canvas element. + * To be overridden by the subclass * - * @static - * @param {HTMLCanvasElement} canvas - The canvas element source of the texture - * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} The newly created texture + * @private + * @param {PIXI.CanvasRenderer} renderer - The renderer */ + ; + Container.prototype._renderCanvas = function _renderCanvas(renderer) // eslint-disable-line no-unused-vars + {} + // this is where content itself gets rendered... - Texture.fromCanvas = function fromCanvas(canvas, scaleMode) { - return new Texture(_BaseTexture2.default.fromCanvas(canvas, scaleMode)); - }; /** - * Helper function that creates a new Texture based on the given video element. + * Renders the object using the Canvas renderer * - * @static - * @param {HTMLVideoElement|string} video - The URL or actual element of the video - * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} The newly created texture + * @param {PIXI.CanvasRenderer} renderer - The renderer */ + ; - - Texture.fromVideo = function fromVideo(video, scaleMode) { - if (typeof video === 'string') { - return Texture.fromVideoUrl(video, scaleMode); + Container.prototype.renderCanvas = function renderCanvas(renderer) { + // if not visible or the alpha is 0 then no need to render this + if (!this.visible || this.worldAlpha <= 0 || !this.renderable) { + return; } - return new Texture(_VideoBaseTexture2.default.fromVideo(video, scaleMode)); - }; - - /** - * Helper function that creates a new Texture based on the video url. - * - * @static - * @param {string} videoUrl - URL of the video - * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values - * @return {PIXI.Texture} The newly created texture - */ + if (this._mask) { + renderer.maskManager.pushMask(this._mask); + } + this._renderCanvas(renderer); + for (var i = 0, j = this.children.length; i < j; ++i) { + this.children[i].renderCanvas(renderer); + } - Texture.fromVideoUrl = function fromVideoUrl(videoUrl, scaleMode) { - return new Texture(_VideoBaseTexture2.default.fromUrl(videoUrl, scaleMode)); + if (this._mask) { + renderer.maskManager.popMask(renderer); + } }; /** - * Helper function that creates a new Texture based on the source you provide. - * The source can be - frame id, image url, video url, canvas element, video element, base texture + * Removes all internal references and listeners as well as removes children from the display list. + * Do not use a Container after calling `destroy`. * - * @static - * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from - * @return {PIXI.Texture} The newly created texture + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the texture of the child sprite + * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the base texture of the child sprite */ - Texture.from = function from(source) { - // TODO auto detect cross origin.. - // TODO pass in scale mode? - if (typeof source === 'string') { - var texture = _utils.TextureCache[source]; + Container.prototype.destroy = function destroy(options) { + _DisplayObject.prototype.destroy.call(this); - if (!texture) { - // check if its a video.. - var isVideo = source.match(/\.(mp4|webm|ogg|h264|avi|mov)$/) !== null; + var destroyChildren = typeof options === 'boolean' ? options : options && options.children; - if (isVideo) { - return Texture.fromVideoUrl(source); - } + var oldChildren = this.removeChildren(0, this.children.length); - return Texture.fromImage(source); + if (destroyChildren) { + for (var i = 0; i < oldChildren.length; ++i) { + oldChildren[i].destroy(options); } - - return texture; - } else if (source instanceof HTMLImageElement) { - return new Texture(new _BaseTexture2.default(source)); - } else if (source instanceof HTMLCanvasElement) { - return Texture.fromCanvas(source); - } else if (source instanceof HTMLVideoElement) { - return Texture.fromVideo(source); - } else if (source instanceof _BaseTexture2.default) { - return new Texture(source); } - - // lets assume its a texture! - return source; - }; - - /** - * Adds a texture to the global TextureCache. This cache is shared across the whole PIXI object. - * - * @static - * @param {PIXI.Texture} texture - The Texture to add to the cache. - * @param {string} id - The id that the texture will be stored against. - */ - - - Texture.addTextureToCache = function addTextureToCache(texture, id) { - _utils.TextureCache[id] = texture; - }; - - /** - * Remove a texture from the global TextureCache. - * - * @static - * @param {string} id - The id of the texture to be removed - * @return {PIXI.Texture} The texture that was removed - */ - - - Texture.removeTextureFromCache = function removeTextureFromCache(id) { - var texture = _utils.TextureCache[id]; - - delete _utils.TextureCache[id]; - delete _utils.BaseTextureCache[id]; - - return texture; }; /** - * The frame specifies the region of the base texture that this texture uses. + * The width of the Container, setting this will actually modify the scale to achieve the value set * - * @member {PIXI.Rectangle} + * @member {number} */ - _createClass(Texture, [{ - key: 'frame', + _createClass(Container, [{ + key: 'width', get: function get() { - return this._frame; + return this.scale.x * this.getLocalBounds().width; }, - set: function set(frame) // eslint-disable-line require-jsdoc + set: function set(value) // eslint-disable-line require-jsdoc { - this._frame = frame; - - this.noFrame = false; - - if (frame.x + frame.width > this.baseTexture.width || frame.y + frame.height > this.baseTexture.height) { - throw new Error('Texture Error: frame does not fit inside the base Texture dimensions ' + this); - } - - // this.valid = frame && frame.width && frame.height && this.baseTexture.source && this.baseTexture.hasLoaded; - this.valid = frame && frame.width && frame.height && this.baseTexture.hasLoaded; + var width = this.getLocalBounds().width; - if (!this.trim && !this.rotate) { - this.orig = frame; + if (width !== 0) { + this.scale.x = value / width; + } else { + this.scale.x = 1; } - if (this.valid) { - this._updateUvs(); - } + this._width = value; } /** - * Indicates whether the texture is rotated inside the atlas - * set to 2 to compensate for texture packer rotation - * set to 6 to compensate for spine packer rotation - * can be used to rotate or mirror sprites - * See {@link PIXI.GroupD8} for explanation + * The height of the Container, setting this will actually modify the scale to achieve the value set * * @member {number} */ }, { - key: 'rotate', + key: 'height', get: function get() { - return this._rotate; + return this.scale.y * this.getLocalBounds().height; }, - set: function set(rotate) // eslint-disable-line require-jsdoc + set: function set(value) // eslint-disable-line require-jsdoc { - this._rotate = rotate; - if (this.valid) { - this._updateUvs(); - } - } - - /** - * The width of the Texture in pixels. - * - * @member {number} - */ - - }, { - key: 'width', - get: function get() { - return this.orig.width; - } + var height = this.getLocalBounds().height; - /** - * The height of the Texture in pixels. - * - * @member {number} - */ + if (height !== 0) { + this.scale.y = value / height; + } else { + this.scale.y = 1; + } - }, { - key: 'height', - get: function get() { - return this.orig.height; + this._height = value; } }]); - return Texture; -}(_eventemitter2.default); + return Container; +}(_DisplayObject3.default); -/** - * An empty texture, used often to not have to create multiple empty textures. - * Can not be destroyed. - * - * @static - * @constant - */ +// performance increase to avoid using call.. (10x faster) -exports.default = Texture; -Texture.EMPTY = new Texture(new _BaseTexture2.default()); -Texture.EMPTY.destroy = function _emptyDestroy() {/* empty */}; -Texture.EMPTY.on = function _emptyOn() {/* empty */}; -Texture.EMPTY.once = function _emptyOnce() {/* empty */}; -Texture.EMPTY.emit = function _emptyEmit() {/* empty */}; -//# sourceMappingURL=Texture.js.map +exports.default = Container; +Container.prototype.containerUpdateTransform = Container.prototype.updateTransform; +//# sourceMappingURL=Container.js.map /***/ }), -/* 58 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5948,13 +6066,31 @@ Texture.EMPTY.emit = function _emptyEmit() {/* empty */}; exports.__esModule = true; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _SystemRenderer2 = __webpack_require__(243); -var _core = __webpack_require__(0); +var _SystemRenderer3 = _interopRequireDefault(_SystemRenderer2); -var core = _interopRequireWildcard(_core); +var _CanvasMaskManager = __webpack_require__(534); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _CanvasMaskManager2 = _interopRequireDefault(_CanvasMaskManager); + +var _CanvasRenderTarget = __webpack_require__(244); + +var _CanvasRenderTarget2 = _interopRequireDefault(_CanvasRenderTarget); + +var _mapCanvasBlendModesToPixi = __webpack_require__(535); + +var _mapCanvasBlendModesToPixi2 = _interopRequireDefault(_mapCanvasBlendModesToPixi); + +var _utils = __webpack_require__(3); + +var _const = __webpack_require__(0); + +var _settings = __webpack_require__(6); + +var _settings2 = _interopRequireDefault(_settings); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -5962,129 +6098,561 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var tempPoint = new core.Point(); -var tempPolygon = new core.Polygon(); - /** - * Base mesh class + * The CanvasRenderer draws the scene and all its content onto a 2d canvas. This renderer should + * be used for browsers that do not support WebGL. Don't forget to add the CanvasRenderer.view to + * your DOM or you will not see anything :) + * * @class - * @extends PIXI.Container - * @memberof PIXI.mesh + * @memberof PIXI + * @extends PIXI.SystemRenderer */ +var CanvasRenderer = function (_SystemRenderer) { + _inherits(CanvasRenderer, _SystemRenderer); -var Mesh = function (_core$Container) { - _inherits(Mesh, _core$Container); - - /** - * @param {PIXI.Texture} texture - The texture to use - * @param {Float32Array} [vertices] - if you want to specify the vertices - * @param {Float32Array} [uvs] - if you want to specify the uvs - * @param {Uint16Array} [indices] - if you want to specify the indices - * @param {number} [drawMode] - the drawMode, can be any of the Mesh.DRAW_MODES consts - */ - function Mesh(texture, vertices, uvs, indices, drawMode) { - _classCallCheck(this, Mesh); - + // eslint-disable-next-line valid-jsdoc /** - * The texture of the Mesh - * - * @member {PIXI.Texture} - * @private + * @param {object} [options] - The optional renderer parameters + * @param {number} [options.width=800] - the width of the screen + * @param {number} [options.height=600] - the height of the screen + * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional + * @param {boolean} [options.transparent=false] - If the render view is transparent, default false + * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false + * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment) + * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The + * resolution of the renderer retina would be 2. + * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, + * enable this if you need to call toDataUrl on the webgl context. + * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or + * not before the new render pass. + * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area + * (shown if not transparent). + * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering, + * stopping pixel interpolation. */ - var _this = _possibleConstructorReturn(this, _core$Container.call(this)); + function CanvasRenderer(options, arg2, arg3) { + _classCallCheck(this, CanvasRenderer); - _this._texture = null; + var _this = _possibleConstructorReturn(this, _SystemRenderer.call(this, 'Canvas', options, arg2, arg3)); - /** - * The Uvs of the Mesh - * - * @member {Float32Array} - */ - _this.uvs = uvs || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]); + _this.type = _const.RENDERER_TYPE.CANVAS; - /** - * An array of vertices - * - * @member {Float32Array} - */ - _this.vertices = vertices || new Float32Array([0, 0, 100, 0, 100, 100, 0, 100]); + /** + * The root canvas 2d context that everything is drawn with. + * + * @member {CanvasRenderingContext2D} + */ + _this.rootContext = _this.view.getContext('2d', { alpha: _this.transparent }); - /* - * @member {Uint16Array} An array containing the indices of the vertices - */ - // TODO auto generate this based on draw mode! - _this.indices = indices || new Uint16Array([0, 1, 3, 2]); + /** + * The currently active canvas 2d context (could change with renderTextures) + * + * @member {CanvasRenderingContext2D} + */ + _this.context = _this.rootContext; - /** - * Version of mesh uvs are dirty or not - * - * @member {number} - */ - _this.dirty = 0; + /** + * Boolean flag controlling canvas refresh. + * + * @member {boolean} + */ + _this.refresh = true; - /** - * Version of mesh indices - * - * @member {number} - */ - _this.indexDirty = 0; + /** + * Instance of a CanvasMaskManager, handles masking when using the canvas renderer. + * + * @member {PIXI.CanvasMaskManager} + */ + _this.maskManager = new _CanvasMaskManager2.default(_this); - /** - * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove - * any blend mode. - * - * @member {number} - * @default PIXI.BLEND_MODES.NORMAL - * @see PIXI.BLEND_MODES - */ - _this.blendMode = core.BLEND_MODES.NORMAL; + /** + * The canvas property used to set the canvas smoothing property. + * + * @member {string} + */ + _this.smoothProperty = 'imageSmoothingEnabled'; - /** - * Triangles in canvas mode are automatically antialiased, use this value to force triangles - * to overlap a bit with each other. - * - * @member {number} - */ - _this.canvasPadding = 0; + if (!_this.rootContext.imageSmoothingEnabled) { + if (_this.rootContext.webkitImageSmoothingEnabled) { + _this.smoothProperty = 'webkitImageSmoothingEnabled'; + } else if (_this.rootContext.mozImageSmoothingEnabled) { + _this.smoothProperty = 'mozImageSmoothingEnabled'; + } else if (_this.rootContext.oImageSmoothingEnabled) { + _this.smoothProperty = 'oImageSmoothingEnabled'; + } else if (_this.rootContext.msImageSmoothingEnabled) { + _this.smoothProperty = 'msImageSmoothingEnabled'; + } + } - /** - * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts - * - * @member {number} - * @see PIXI.mesh.Mesh.DRAW_MODES - */ - _this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH; + _this.initPlugins(); - // run texture setter; - _this.texture = texture; + _this.blendModes = (0, _mapCanvasBlendModesToPixi2.default)(); + _this._activeBlendMode = null; - /** - * The default shader that is used if a mesh doesn't have a more specific one. - * - * @member {PIXI.Shader} - */ - _this.shader = null; + _this.renderingToScreen = false; - /** - * The tint applied to the mesh. This is a [r,g,b] value. A value of [1,1,1] will remove any - * tint effect. - * - * @member {number} - */ - _this.tintRgb = new Float32Array([1, 1, 1]); + _this.resize(_this.options.width, _this.options.height); - /** - * A map of renderer IDs to webgl render data - * + /** + * Fired after rendering finishes. + * + * @event PIXI.CanvasRenderer#postrender + */ + + /** + * Fired before rendering starts. + * + * @event PIXI.CanvasRenderer#prerender + */ + return _this; + } + + /** + * Renders the object to this canvas view + * + * @param {PIXI.DisplayObject} displayObject - The object to be rendered + * @param {PIXI.RenderTexture} [renderTexture] - A render texture to be rendered to. + * If unset, it will render to the root context. + * @param {boolean} [clear=false] - Whether to clear the canvas before drawing + * @param {PIXI.Transform} [transform] - A transformation to be applied + * @param {boolean} [skipUpdateTransform=false] - Whether to skip the update transform + */ + + + CanvasRenderer.prototype.render = function render(displayObject, renderTexture, clear, transform, skipUpdateTransform) { + if (!this.view) { + return; + } + + // can be handy to know! + this.renderingToScreen = !renderTexture; + + this.emit('prerender'); + + var rootResolution = this.resolution; + + if (renderTexture) { + renderTexture = renderTexture.baseTexture || renderTexture; + + if (!renderTexture._canvasRenderTarget) { + renderTexture._canvasRenderTarget = new _CanvasRenderTarget2.default(renderTexture.width, renderTexture.height, renderTexture.resolution); + renderTexture.source = renderTexture._canvasRenderTarget.canvas; + renderTexture.valid = true; + } + + this.context = renderTexture._canvasRenderTarget.context; + this.resolution = renderTexture._canvasRenderTarget.resolution; + } else { + this.context = this.rootContext; + } + + var context = this.context; + + if (!renderTexture) { + this._lastObjectRendered = displayObject; + } + + if (!skipUpdateTransform) { + // update the scene graph + var cacheParent = displayObject.parent; + var tempWt = this._tempDisplayObjectParent.transform.worldTransform; + + if (transform) { + transform.copy(tempWt); + + // lets not forget to flag the parent transform as dirty... + this._tempDisplayObjectParent.transform._worldID = -1; + } else { + tempWt.identity(); + } + + displayObject.parent = this._tempDisplayObjectParent; + + displayObject.updateTransform(); + displayObject.parent = cacheParent; + // displayObject.hitArea = //TODO add a temp hit area + } + + context.setTransform(1, 0, 0, 1, 0, 0); + context.globalAlpha = 1; + this._activeBlendMode = _const.BLEND_MODES.NORMAL; + context.globalCompositeOperation = this.blendModes[_const.BLEND_MODES.NORMAL]; + + if (navigator.isCocoonJS && this.view.screencanvas) { + context.fillStyle = 'black'; + context.clear(); + } + + if (clear !== undefined ? clear : this.clearBeforeRender) { + if (this.renderingToScreen) { + if (this.transparent) { + context.clearRect(0, 0, this.width, this.height); + } else { + context.fillStyle = this._backgroundColorString; + context.fillRect(0, 0, this.width, this.height); + } + } // else { + // TODO: implement background for CanvasRenderTarget or RenderTexture? + // } + } + + // TODO RENDER TARGET STUFF HERE.. + var tempContext = this.context; + + this.context = context; + displayObject.renderCanvas(this); + this.context = tempContext; + + this.resolution = rootResolution; + + this.emit('postrender'); + }; + + /** + * Clear the canvas of renderer. + * + * @param {string} [clearColor] - Clear the canvas with this color, except the canvas is transparent. + */ + + + CanvasRenderer.prototype.clear = function clear(clearColor) { + var context = this.context; + + clearColor = clearColor || this._backgroundColorString; + + if (!this.transparent && clearColor) { + context.fillStyle = clearColor; + context.fillRect(0, 0, this.width, this.height); + } else { + context.clearRect(0, 0, this.width, this.height); + } + }; + + /** + * Sets the blend mode of the renderer. + * + * @param {number} blendMode - See {@link PIXI.BLEND_MODES} for valid values. + */ + + + CanvasRenderer.prototype.setBlendMode = function setBlendMode(blendMode) { + if (this._activeBlendMode === blendMode) { + return; + } + + this._activeBlendMode = blendMode; + this.context.globalCompositeOperation = this.blendModes[blendMode]; + }; + + /** + * Removes everything from the renderer and optionally removes the Canvas DOM element. + * + * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM. + */ + + + CanvasRenderer.prototype.destroy = function destroy(removeView) { + this.destroyPlugins(); + + // call the base destroy + _SystemRenderer.prototype.destroy.call(this, removeView); + + this.context = null; + + this.refresh = true; + + this.maskManager.destroy(); + this.maskManager = null; + + this.smoothProperty = null; + }; + + /** + * Resizes the canvas view to the specified width and height. + * + * @extends PIXI.SystemRenderer#resize + * + * @param {number} screenWidth - the new width of the screen + * @param {number} screenHeight - the new height of the screen + */ + + + CanvasRenderer.prototype.resize = function resize(screenWidth, screenHeight) { + _SystemRenderer.prototype.resize.call(this, screenWidth, screenHeight); + + // reset the scale mode.. oddly this seems to be reset when the canvas is resized. + // surely a browser bug?? Let PixiJS fix that for you.. + if (this.smoothProperty) { + this.rootContext[this.smoothProperty] = _settings2.default.SCALE_MODE === _const.SCALE_MODES.LINEAR; + } + }; + + /** + * Checks if blend mode has changed. + */ + + + CanvasRenderer.prototype.invalidateBlendMode = function invalidateBlendMode() { + this._activeBlendMode = this.blendModes.indexOf(this.context.globalCompositeOperation); + }; + + return CanvasRenderer; +}(_SystemRenderer3.default); + +/** + * Collection of installed plugins. These are included by default in PIXI, but can be excluded + * by creating a custom build. Consult the README for more information about creating custom + * builds and excluding plugins. + * @name PIXI.CanvasRenderer#plugins + * @type {object} + * @readonly + * @property {PIXI.accessibility.AccessibilityManager} accessibility Support tabbing interactive elements. + * @property {PIXI.extract.CanvasExtract} extract Extract image data from renderer. + * @property {PIXI.interaction.InteractionManager} interaction Handles mouse, touch and pointer events. + * @property {PIXI.prepare.CanvasPrepare} prepare Pre-render display objects. + */ + +/** + * Adds a plugin to the renderer. + * + * @method PIXI.CanvasRenderer#registerPlugin + * @param {string} pluginName - The name of the plugin. + * @param {Function} ctor - The constructor function or class for the plugin. + */ + +exports.default = CanvasRenderer; +_utils.pluginTarget.mixin(CanvasRenderer); +//# sourceMappingURL=CanvasRenderer.js.map + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @class + * @memberof PIXI + */ +var WebGLManager = function () { + /** + * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. + */ + function WebGLManager(renderer) { + _classCallCheck(this, WebGLManager); + + /** + * The renderer this manager works for. + * + * @member {PIXI.WebGLRenderer} + */ + this.renderer = renderer; + + this.renderer.on('context', this.onContextChange, this); + } + + /** + * Generic method called when there is a WebGL context change. + * + */ + + + WebGLManager.prototype.onContextChange = function onContextChange() {} + // do some codes init! + + + /** + * Generic destroy methods to be overridden by the subclass + * + */ + ; + + WebGLManager.prototype.destroy = function destroy() { + this.renderer.off('context', this.onContextChange, this); + + this.renderer = null; + }; + + return WebGLManager; +}(); + +exports.default = WebGLManager; +//# sourceMappingURL=WebGLManager.js.map + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _core = __webpack_require__(1); + +var core = _interopRequireWildcard(_core); + +var _TextureTransform = __webpack_require__(133); + +var _TextureTransform2 = _interopRequireDefault(_TextureTransform); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var tempPoint = new core.Point(); +var tempPolygon = new core.Polygon(); + +/** + * Base mesh class + * @class + * @extends PIXI.Container + * @memberof PIXI.mesh + */ + +var Mesh = function (_core$Container) { + _inherits(Mesh, _core$Container); + + /** + * @param {PIXI.Texture} texture - The texture to use + * @param {Float32Array} [vertices] - if you want to specify the vertices + * @param {Float32Array} [uvs] - if you want to specify the uvs + * @param {Uint16Array} [indices] - if you want to specify the indices + * @param {number} [drawMode] - the drawMode, can be any of the Mesh.DRAW_MODES consts + */ + function Mesh(texture, vertices, uvs, indices, drawMode) { + _classCallCheck(this, Mesh); + + /** + * The texture of the Mesh + * + * @member {PIXI.Texture} + * @private + */ + var _this = _possibleConstructorReturn(this, _core$Container.call(this)); + + _this._texture = texture; + + /** + * The Uvs of the Mesh + * + * @member {Float32Array} + */ + _this.uvs = uvs || new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]); + + /** + * An array of vertices + * + * @member {Float32Array} + */ + _this.vertices = vertices || new Float32Array([0, 0, 100, 0, 100, 100, 0, 100]); + + /** + * An array containing the indices of the vertices + * + * @member {Uint16Array} + */ + // TODO auto generate this based on draw mode! + _this.indices = indices || new Uint16Array([0, 1, 3, 2]); + + /** + * Version of mesh uvs are dirty or not + * + * @member {number} + */ + _this.dirty = 0; + + /** + * Version of mesh indices + * + * @member {number} + */ + _this.indexDirty = 0; + + /** + * The blend mode to be applied to the sprite. Set to `PIXI.BLEND_MODES.NORMAL` to remove + * any blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + * @see PIXI.BLEND_MODES + */ + _this.blendMode = core.BLEND_MODES.NORMAL; + + /** + * Triangles in canvas mode are automatically antialiased, use this value to force triangles + * to overlap a bit with each other. + * + * @member {number} + */ + _this.canvasPadding = 0; + + /** + * The way the Mesh should be drawn, can be any of the {@link PIXI.mesh.Mesh.DRAW_MODES} consts + * + * @member {number} + * @see PIXI.mesh.Mesh.DRAW_MODES + */ + _this.drawMode = drawMode || Mesh.DRAW_MODES.TRIANGLE_MESH; + + /** + * The default shader that is used if a mesh doesn't have a more specific one. + * + * @member {PIXI.Shader} + */ + _this.shader = null; + + /** + * The tint applied to the mesh. This is a [r,g,b] value. A value of [1,1,1] will remove any + * tint effect. + * + * @member {number} + */ + _this.tintRgb = new Float32Array([1, 1, 1]); + + /** + * A map of renderer IDs to webgl render data + * * @private * @member {object} */ _this._glDatas = {}; + /** + * transform that is applied to UV to get the texture coords + * its updated independently from texture uvTransform + * updates of uvs are tied to that thing + * + * @member {PIXI.extras.TextureTransform} + * @private + */ + _this._uvTransform = new _TextureTransform2.default(texture); + + /** + * whether or not upload uvTransform to shader + * if its false, then uvs should be pre-multiplied + * if you change it for generated mesh, please call 'refresh(true)' + * @member {boolean} + * @default false + */ + _this.uploadUvTransform = false; + /** * Plugin that is responsible for rendering this element. * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods. - * * @member {string} * @default 'mesh' */ @@ -6101,6 +6669,7 @@ var Mesh = function (_core$Container) { Mesh.prototype._renderWebGL = function _renderWebGL(renderer) { + this.refresh(); renderer.setObjectRenderer(renderer.plugins[this.pluginName]); renderer.plugins[this.pluginName].render(this); }; @@ -6114,6 +6683,7 @@ var Mesh = function (_core$Container) { Mesh.prototype._renderCanvas = function _renderCanvas(renderer) { + this.refresh(); renderer.plugins[this.pluginName].render(this); }; @@ -6124,7 +6694,45 @@ var Mesh = function (_core$Container) { */ - Mesh.prototype._onTextureUpdate = function _onTextureUpdate() {} + Mesh.prototype._onTextureUpdate = function _onTextureUpdate() { + this._uvTransform.texture = this._texture; + this.refresh(); + }; + + /** + * multiplies uvs only if uploadUvTransform is false + * call it after you change uvs manually + * make sure that texture is valid + */ + + + Mesh.prototype.multiplyUvs = function multiplyUvs() { + if (!this.uploadUvTransform) { + this._uvTransform.multiplyUvs(this.uvs); + } + }; + + /** + * Refreshes uvs for generated meshes (rope, plane) + * sometimes refreshes vertices too + * + * @param {boolean} [forceUpdate=false] if true, matrices will be updated any case + */ + + + Mesh.prototype.refresh = function refresh(forceUpdate) { + if (this._uvTransform.update(forceUpdate)) { + this._refresh(); + } + }; + + /** + * re-calculates mesh coords + * @protected + */ + + + Mesh.prototype._refresh = function _refresh() {} /* empty */ @@ -6256,231 +6864,76 @@ Mesh.DRAW_MODES = { "use strict"; -exports.__esModule = true; - -var _Loader = __webpack_require__(599); - -var _Loader2 = _interopRequireDefault(_Loader); - -var _Resource = __webpack_require__(135); - -var _Resource2 = _interopRequireDefault(_Resource); - -var _async = __webpack_require__(271); - -var async = _interopRequireWildcard(_async); - -var _b = __webpack_require__(272); +// import Loader from './Loader'; +// import Resource from './Resource'; +// import * as async from './async'; +// import * as b64 from './b64'; -var b64 = _interopRequireWildcard(_b); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +/* eslint-disable no-undef */ -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var Loader = __webpack_require__(608).default; +var Resource = __webpack_require__(136).default; +var async = __webpack_require__(269); +var b64 = __webpack_require__(270); -_Loader2.default.Resource = _Resource2.default; -_Loader2.default.async = async; -_Loader2.default.base64 = b64; +Loader.Resource = Resource; +Loader.async = async; +Loader.base64 = b64; // export manually, and also as default -module.exports = _Loader2.default; // eslint-disable-line no-undef -exports.default = _Loader2.default; +module.exports = Loader; +// export default Loader; +module.exports.default = Loader; //# sourceMappingURL=index.js.map /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * isMobile.js v0.4.0 - * - * A simple library to detect Apple phones and tablets, - * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone), - * and any kind of seven inch device, via user agent sniffing. - * - * @author: Kai Mallea (kmallea@gmail.com) +var listCacheClear = __webpack_require__(364), + listCacheDelete = __webpack_require__(365), + listCacheGet = __webpack_require__(366), + listCacheHas = __webpack_require__(367), + listCacheSet = __webpack_require__(368); + +/** + * Creates an list cache object. * - * @license: http://creativecommons.org/publicdomain/zero/1.0/ + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -(function (global) { - - var apple_phone = /iPhone/i, - apple_ipod = /iPod/i, - apple_tablet = /iPad/i, - android_phone = /(?=.*\bAndroid\b)(?=.*\bMobile\b)/i, // Match 'Android' AND 'Mobile' - android_tablet = /Android/i, - amazon_phone = /(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i, - amazon_tablet = /(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i, - windows_phone = /IEMobile/i, - windows_tablet = /(?=.*\bWindows\b)(?=.*\bARM\b)/i, // Match 'Windows' AND 'ARM' - other_blackberry = /BlackBerry/i, - other_blackberry_10 = /BB10/i, - other_opera = /Opera Mini/i, - other_chrome = /(CriOS|Chrome)(?=.*\bMobile\b)/i, - other_firefox = /(?=.*\bFirefox\b)(?=.*\bMobile\b)/i, // Match 'Firefox' AND 'Mobile' - seven_inch = new RegExp( - '(?:' + // Non-capturing group +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - 'Nexus 7' + // Nexus 7 + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} - '|' + // OR +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; - 'BNTV250' + // B&N Nook Tablet 7 inch +module.exports = ListCache; - '|' + // OR - 'Kindle Fire' + // Kindle Fire +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { - '|' + // OR - - 'Silk' + // Kindle Fire, Silk Accelerated - - '|' + // OR - - 'GT-P1000' + // Galaxy Tab 7 inch - - ')', // End non-capturing group - - 'i'); // Case-insensitive matching - - var match = function(regex, userAgent) { - return regex.test(userAgent); - }; - - var IsMobileClass = function(userAgent) { - var ua = userAgent || navigator.userAgent; - - // Facebook mobile app's integrated browser adds a bunch of strings that - // match everything. Strip it out if it exists. - var tmp = ua.split('[FBAN'); - if (typeof tmp[1] !== 'undefined') { - ua = tmp[0]; - } - - // Twitter mobile app's integrated browser on iPad adds a "Twitter for - // iPhone" string. Same probable happens on other tablet platforms. - // This will confuse detection so strip it out if it exists. - tmp = ua.split('Twitter'); - if (typeof tmp[1] !== 'undefined') { - ua = tmp[0]; - } - - this.apple = { - phone: match(apple_phone, ua), - ipod: match(apple_ipod, ua), - tablet: !match(apple_phone, ua) && match(apple_tablet, ua), - device: match(apple_phone, ua) || match(apple_ipod, ua) || match(apple_tablet, ua) - }; - this.amazon = { - phone: match(amazon_phone, ua), - tablet: !match(amazon_phone, ua) && match(amazon_tablet, ua), - device: match(amazon_phone, ua) || match(amazon_tablet, ua) - }; - this.android = { - phone: match(amazon_phone, ua) || match(android_phone, ua), - tablet: !match(amazon_phone, ua) && !match(android_phone, ua) && (match(amazon_tablet, ua) || match(android_tablet, ua)), - device: match(amazon_phone, ua) || match(amazon_tablet, ua) || match(android_phone, ua) || match(android_tablet, ua) - }; - this.windows = { - phone: match(windows_phone, ua), - tablet: match(windows_tablet, ua), - device: match(windows_phone, ua) || match(windows_tablet, ua) - }; - this.other = { - blackberry: match(other_blackberry, ua), - blackberry10: match(other_blackberry_10, ua), - opera: match(other_opera, ua), - firefox: match(other_firefox, ua), - chrome: match(other_chrome, ua), - device: match(other_blackberry, ua) || match(other_blackberry_10, ua) || match(other_opera, ua) || match(other_firefox, ua) || match(other_chrome, ua) - }; - this.seven_inch = match(seven_inch, ua); - this.any = this.apple.device || this.android.device || this.windows.device || this.other.device || this.seven_inch; - - // excludes 'other' devices and ipods, targeting touchscreen phones - this.phone = this.apple.phone || this.android.phone || this.windows.phone; - - // excludes 7 inch devices, classifying as phone or tablet is left to the user - this.tablet = this.apple.tablet || this.android.tablet || this.windows.tablet; - - if (typeof window === 'undefined') { - return this; - } - }; - - var instantiate = function() { - var IM = new IsMobileClass(); - IM.Class = IsMobileClass; - return IM; - }; - - if (typeof module !== 'undefined' && module.exports && typeof window === 'undefined') { - //node - module.exports = IsMobileClass; - } else if (typeof module !== 'undefined' && module.exports && typeof window !== 'undefined') { - //browserify - module.exports = instantiate(); - } else if (true) { - //AMD - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (global.isMobile = instantiate()), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - global.isMobile = instantiate(); - } - -})(this); - - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -var listCacheClear = __webpack_require__(364), - listCacheDelete = __webpack_require__(365), - listCacheGet = __webpack_require__(366), - listCacheHas = __webpack_require__(367), - listCacheSet = __webpack_require__(368); - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -module.exports = ListCache; - - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -var ListCache = __webpack_require__(61), - stackClear = __webpack_require__(385), - stackDelete = __webpack_require__(386), - stackGet = __webpack_require__(387), - stackHas = __webpack_require__(388), - stackSet = __webpack_require__(389); +var ListCache = __webpack_require__(60), + stackClear = __webpack_require__(385), + stackDelete = __webpack_require__(386), + stackGet = __webpack_require__(387), + stackHas = __webpack_require__(388), + stackSet = __webpack_require__(389); /** * Creates a stack cache object to store key-value pairs. @@ -6505,7 +6958,7 @@ module.exports = Stack; /***/ }), -/* 63 */ +/* 62 */ /***/ (function(module, exports) { /** @@ -6536,11 +6989,11 @@ module.exports = arrayFilter; /***/ }), -/* 64 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(22), - eq = __webpack_require__(45); + eq = __webpack_require__(46); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -6570,10 +7023,10 @@ module.exports = assignValue; /***/ }), -/* 65 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { -var eq = __webpack_require__(45); +var eq = __webpack_require__(46); /** * Gets the index at which the `key` is found in `array` of key-value pairs. @@ -6597,14 +7050,14 @@ module.exports = assocIndexOf; /***/ }), -/* 66 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(11), - castPath = __webpack_require__(27), - last = __webpack_require__(212), - parent = __webpack_require__(196), - toKey = __webpack_require__(20); + castPath = __webpack_require__(26), + last = __webpack_require__(213), + parent = __webpack_require__(197), + toKey = __webpack_require__(19); /** * The base implementation of `_.invoke` without support for individual @@ -6627,14 +7080,14 @@ module.exports = baseInvoke; /***/ }), -/* 67 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { -var assignValue = __webpack_require__(64), - castPath = __webpack_require__(27), - isIndex = __webpack_require__(44), - isObject = __webpack_require__(6), - toKey = __webpack_require__(20); +var assignValue = __webpack_require__(63), + castPath = __webpack_require__(26), + isIndex = __webpack_require__(45), + isObject = __webpack_require__(7), + toKey = __webpack_require__(19); /** * The base implementation of `_.set`. @@ -6680,7 +7133,7 @@ module.exports = baseSet; /***/ }), -/* 68 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -6700,13 +7153,13 @@ module.exports = baseUnary; /***/ }), -/* 69 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { var arrayAggregator = __webpack_require__(289), baseAggregator = __webpack_require__(296), - baseIteratee = __webpack_require__(3), - isArray = __webpack_require__(1); + baseIteratee = __webpack_require__(4), + isArray = __webpack_require__(2); /** * Creates a function like `_.groupBy`. @@ -6729,11 +7182,11 @@ module.exports = createAggregator; /***/ }), -/* 70 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { -var baseCreate = __webpack_require__(39), - isObject = __webpack_require__(6); +var baseCreate = __webpack_require__(40), + isObject = __webpack_require__(7); /** * Creates a function that produces an instance of `Ctor` regardless of @@ -6772,7 +7225,7 @@ module.exports = createCtor; /***/ }), -/* 71 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { var isKeyable = __webpack_require__(362); @@ -6796,10 +7249,10 @@ module.exports = getMapData; /***/ }), -/* 72 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { -var overArg = __webpack_require__(194); +var overArg = __webpack_require__(195); /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); @@ -6808,16 +7261,16 @@ module.exports = getPrototype; /***/ }), -/* 73 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { var DataView = __webpack_require__(282), Map = __webpack_require__(91), Promise = __webpack_require__(284), Set = __webpack_require__(285), - WeakMap = __webpack_require__(141), - baseGetTag = __webpack_require__(26), - toSource = __webpack_require__(202); + WeakMap = __webpack_require__(142), + baseGetTag = __webpack_require__(25), + toSource = __webpack_require__(203); /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -6872,7 +7325,7 @@ module.exports = getTag; /***/ }), -/* 74 */ +/* 73 */ /***/ (function(module, exports) { /** Used for built-in method references. */ @@ -6896,7 +7349,7 @@ module.exports = isPrototype; /***/ }), -/* 75 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(33); @@ -6908,7 +7361,7 @@ module.exports = nativeCreate; /***/ }), -/* 76 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { var baseRandom = __webpack_require__(102); @@ -6942,11 +7395,11 @@ module.exports = shuffleSelf; /***/ }), -/* 77 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(306), - isObjectLike = __webpack_require__(21); + isObjectLike = __webpack_require__(20); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -6984,11 +7437,11 @@ module.exports = isArguments; /***/ }), -/* 78 */ +/* 77 */ /***/ (function(module, exports, __webpack_require__) { var baseIsTypedArray = __webpack_require__(311), - baseUnary = __webpack_require__(68), + baseUnary = __webpack_require__(67), nodeUtil = __webpack_require__(378); /* Node.js helper references. */ @@ -7017,13 +7470,13 @@ module.exports = isTypedArray; /***/ }), -/* 79 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(12), - baseIteratee = __webpack_require__(3), - baseMap = __webpack_require__(156), - isArray = __webpack_require__(1); + baseIteratee = __webpack_require__(4), + baseMap = __webpack_require__(157), + isArray = __webpack_require__(2); /** * Creates an array of values by running each element in `collection` thru @@ -7076,10 +7529,10 @@ module.exports = map; /***/ }), -/* 80 */ +/* 79 */ /***/ (function(module, exports, __webpack_require__) { -var toNumber = __webpack_require__(50); +var toNumber = __webpack_require__(52); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, @@ -7124,21 +7577,28 @@ module.exports = toFinite; /***/ }), -/* 81 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = buildLine; -var _math = __webpack_require__(7); +exports.default = function (graphicsData, webGLData, webGLDataNativeLines) { + if (graphicsData.nativeLines) { + buildNativeLine(graphicsData, webGLDataNativeLines); + } else { + buildLine(graphicsData, webGLData); + } +}; + +var _math = __webpack_require__(8); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); /** - * Builds a line to draw + * Builds a line to draw using the poligon method. * * Ignored from docs since it is not directly exposed. * @@ -7335,10 +7795,64 @@ function buildLine(graphicsData, webGLData) { indices.push(indexStart - 1); } + +/** + * Builds a line to draw using the gl.drawArrays(gl.LINES) method + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + */ + + +/** + * Builds a line to draw + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines + */ +function buildNativeLine(graphicsData, webGLData) { + var i = 0; + var points = graphicsData.points; + + if (points.length === 0) return; + + var verts = webGLData.points; + var length = points.length / 2; + + // sort color + var color = (0, _utils.hex2rgb)(graphicsData.lineColor); + var alpha = graphicsData.lineAlpha; + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; + + for (i = 1; i < length; i++) { + var p1x = points[(i - 1) * 2]; + var p1y = points[(i - 1) * 2 + 1]; + + var p2x = points[i * 2]; + var p2y = points[i * 2 + 1]; + + verts.push(p1x, p1y); + verts.push(r, g, b, alpha); + + verts.push(p2x, p2y); + verts.push(r, g, b, alpha); + } +} //# sourceMappingURL=buildLine.js.map /***/ }), -/* 82 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -7346,61 +7860,61 @@ function buildLine(graphicsData, webGLData) { exports.__esModule = true; -var _SystemRenderer2 = __webpack_require__(241); +var _SystemRenderer2 = __webpack_require__(243); var _SystemRenderer3 = _interopRequireDefault(_SystemRenderer2); -var _MaskManager = __webpack_require__(544); +var _MaskManager = __webpack_require__(542); var _MaskManager2 = _interopRequireDefault(_MaskManager); -var _StencilManager = __webpack_require__(545); +var _StencilManager = __webpack_require__(543); var _StencilManager2 = _interopRequireDefault(_StencilManager); -var _FilterManager = __webpack_require__(543); +var _FilterManager = __webpack_require__(541); var _FilterManager2 = _interopRequireDefault(_FilterManager); -var _RenderTarget = __webpack_require__(84); +var _RenderTarget = __webpack_require__(83); var _RenderTarget2 = _interopRequireDefault(_RenderTarget); -var _ObjectRenderer = __webpack_require__(83); +var _ObjectRenderer = __webpack_require__(82); var _ObjectRenderer2 = _interopRequireDefault(_ObjectRenderer); -var _TextureManager = __webpack_require__(539); +var _TextureManager = __webpack_require__(537); var _TextureManager2 = _interopRequireDefault(_TextureManager); -var _BaseTexture = __webpack_require__(56); +var _BaseTexture = __webpack_require__(48); var _BaseTexture2 = _interopRequireDefault(_BaseTexture); -var _TextureGarbageCollector = __webpack_require__(538); +var _TextureGarbageCollector = __webpack_require__(536); var _TextureGarbageCollector2 = _interopRequireDefault(_TextureGarbageCollector); -var _WebGLState = __webpack_require__(540); +var _WebGLState = __webpack_require__(538); var _WebGLState2 = _interopRequireDefault(_WebGLState); -var _mapWebGLDrawModesToPixi = __webpack_require__(548); +var _mapWebGLDrawModesToPixi = __webpack_require__(546); var _mapWebGLDrawModesToPixi2 = _interopRequireDefault(_mapWebGLDrawModesToPixi); -var _validateContext = __webpack_require__(549); +var _validateContext = __webpack_require__(547); var _validateContext2 = _interopRequireDefault(_validateContext); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); var _pixiGlCore = __webpack_require__(15); var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -7426,11 +7940,12 @@ var CONTEXT_UID = 0; var WebGLRenderer = function (_SystemRenderer) { _inherits(WebGLRenderer, _SystemRenderer); + // eslint-disable-next-line valid-jsdoc /** * - * @param {number} [width=0] - the width of the canvas view - * @param {number} [height=0] - the height of the canvas view * @param {object} [options] - The optional renderer parameters + * @param {number} [options.width=800] - the width of the screen + * @param {number} [options.height=600] - the height of the screen * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional * @param {boolean} [options.transparent=false] - If the render view is transparent, default false * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false @@ -7440,27 +7955,37 @@ var WebGLRenderer = function (_SystemRenderer) { * FXAA is faster, but may not always look as great * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. * The resolution of the renderer retina would be 2. - * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear + * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear * the canvas or not before the new render pass. If you wish to set this to false, you *must* set * preserveDrawingBuffer to `true`. * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, * enable this if you need to call toDataUrl on the webgl context. - * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when + * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when * rendering, stopping pixel interpolation. + * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area + * (shown if not transparent). + * @param {boolean} [options.legacy=false] - If true PixiJS will aim to ensure compatibility + * with older / less advanced devices. If you experiance unexplained flickering try setting this to true. + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card */ - function WebGLRenderer(width, height) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - + function WebGLRenderer(options, arg2, arg3) { _classCallCheck(this, WebGLRenderer); + var _this = _possibleConstructorReturn(this, _SystemRenderer.call(this, 'WebGL', options, arg2, arg3)); + + _this.legacy = _this.options.legacy; + + if (_this.legacy) { + _pixiGlCore2.default.VertexArrayObject.FORCE_NATIVE = true; + } + /** * The type of this renderer as a standardised const * * @member {number} * @see PIXI.RENDERER_TYPE */ - var _this = _possibleConstructorReturn(this, _SystemRenderer.call(this, 'WebGL', width, height, options)); - _this.type = _const.RENDERER_TYPE.WEBGL; _this.handleContextLost = _this.handleContextLost.bind(_this); @@ -7477,10 +8002,11 @@ var WebGLRenderer = function (_SystemRenderer) { */ _this._contextOptions = { alpha: _this.transparent, - antialias: options.antialias, + antialias: _this.options.antialias, premultipliedAlpha: _this.transparent && _this.transparent !== 'notMultiplied', stencil: true, - preserveDrawingBuffer: options.preserveDrawingBuffer + preserveDrawingBuffer: _this.options.preserveDrawingBuffer, + powerPreference: _this.options.powerPreference }; _this._backgroundColorRgba[3] = _this.transparent ? 0 : 1; @@ -7513,6 +8039,19 @@ var WebGLRenderer = function (_SystemRenderer) { */ _this.currentRenderer = _this.emptyRenderer; + /** + * Manages textures + * @member {PIXI.TextureManager} + */ + _this.textureManager = null; + + /** + * Manages the filters. + * + * @member {PIXI.FilterManager} + */ + _this.filterManager = null; + _this.initPlugins(); /** @@ -7521,12 +8060,12 @@ var WebGLRenderer = function (_SystemRenderer) { * @member {WebGLRenderingContext} */ // initialize the context so it is ready for the managers. - if (options.context) { + if (_this.options.context) { // checks to see if a context is valid.. - (0, _validateContext2.default)(options.context); + (0, _validateContext2.default)(_this.options.context); } - _this.gl = options.context || _pixiGlCore2.default.createContext(_this.view, _this._contextOptions); + _this.gl = _this.options.context || _pixiGlCore2.default.createContext(_this.view, _this._contextOptions); _this.CONTEXT_UID = CONTEXT_UID++; @@ -7563,18 +8102,31 @@ var WebGLRenderer = function (_SystemRenderer) { _this._initContext(); - /** - * Manages the filters. - * - * @member {PIXI.FilterManager} - */ - _this.filterManager = new _FilterManager2.default(_this); // map some webGL blend and drawmodes.. _this.drawModes = (0, _mapWebGLDrawModesToPixi2.default)(_this.gl); _this._nextTextureLocation = 0; _this.setBlendMode(0); + + /** + * Fired after rendering finishes. + * + * @event PIXI.WebGLRenderer#postrender + */ + + /** + * Fired before rendering starts. + * + * @event PIXI.WebGLRenderer#prerender + */ + + /** + * Fired when the WebGL context is set. + * + * @event PIXI.WebGLRenderer#context + * @param {WebGLRenderingContext} gl - WebGL context. + */ return _this; } @@ -7595,11 +8147,15 @@ var WebGLRenderer = function (_SystemRenderer) { var maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); + this._activeShader = null; + this._activeVao = null; + this.boundTextures = new Array(maxTextures); this.emptyTextures = new Array(maxTextures); // create a texture manager... this.textureManager = new _TextureManager2.default(this); + this.filterManager = new _FilterManager2.default(this); this.textureGC = new _TextureGarbageCollector2.default(this); this.state.resetToDefault(); @@ -7629,7 +8185,7 @@ var WebGLRenderer = function (_SystemRenderer) { this.emit('context', gl); // setup the width/height properties and gl viewport - this.resize(this.width, this.height); + this.resize(this.screen.width, this.screen.height); }; /** @@ -7721,17 +8277,17 @@ var WebGLRenderer = function (_SystemRenderer) { /** * Resizes the webGL view to the specified width and height. * - * @param {number} width - the new width of the webGL view - * @param {number} height - the new height of the webGL view + * @param {number} screenWidth - the new width of the screen + * @param {number} screenHeight - the new height of the screen */ - WebGLRenderer.prototype.resize = function resize(width, height) { + WebGLRenderer.prototype.resize = function resize(screenWidth, screenHeight) { // if(width * this.resolution === this.width && height * this.resolution === this.height)return; - _SystemRenderer3.default.prototype.resize.call(this, width, height); + _SystemRenderer3.default.prototype.resize.call(this, screenWidth, screenHeight); - this.rootRenderTarget.resize(width, height); + this.rootRenderTarget.resize(screenWidth, screenHeight); if (this._activeRenderTarget === this.rootRenderTarget) { this.rootRenderTarget.activate(); @@ -7775,6 +8331,26 @@ var WebGLRenderer = function (_SystemRenderer) { this._activeRenderTarget.transform = matrix; }; + /** + * Erases the render texture and fills the drawing area with a colour + * + * @param {PIXI.RenderTexture} renderTexture - The render texture to clear + * @param {number} [clearColor] - The colour + * @return {PIXI.WebGLRenderer} Returns itself. + */ + + + WebGLRenderer.prototype.clearRenderTexture = function clearRenderTexture(renderTexture, clearColor) { + var baseTexture = renderTexture.baseTexture; + var renderTarget = baseTexture._glRenderTargets[this.CONTEXT_UID]; + + if (renderTarget) { + renderTarget.clear(clearColor); + } + + return this; + }; + /** * Binds a render texture for rendering * @@ -7836,18 +8412,24 @@ var WebGLRenderer = function (_SystemRenderer) { * Changes the current shader to the one given in parameter * * @param {PIXI.Shader} shader - the new shader + * @param {boolean} [autoProject=true] - Whether automatically set the projection matrix * @return {PIXI.WebGLRenderer} Returns itself. */ - WebGLRenderer.prototype.bindShader = function bindShader(shader) { + WebGLRenderer.prototype.bindShader = function bindShader(shader, autoProject) { // TODO cache if (this._activeShader !== shader) { this._activeShader = shader; shader.bind(); - // automatically set the projection matrix - shader.uniforms.projectionMatrix = this._activeRenderTarget.projectionMatrix.toArray(true); + // `autoProject` normally would be a default parameter set to true + // but because of how Babel transpiles default parameters + // it hinders the performance of this method. + if (autoProject !== false) { + // automatically set the projection matrix + shader.uniforms.projectionMatrix = this._activeRenderTarget.projectionMatrix.toArray(true); + } } return this; @@ -7862,7 +8444,7 @@ var WebGLRenderer = function (_SystemRenderer) { * @param {PIXI.Texture} texture - the new texture * @param {number} location - the suggested texture location * @param {boolean} forceLocation - force the location - * @return {PIXI.WebGLRenderer} Returns itself. + * @return {number} bound texture location */ @@ -8006,8 +8588,9 @@ var WebGLRenderer = function (_SystemRenderer) { WebGLRenderer.prototype.handleContextRestored = function handleContextRestored() { - this._initContext(); this.textureManager.removeAll(); + this.filterManager.destroy(true); + this._initContext(); }; /** @@ -8060,14 +8643,33 @@ var WebGLRenderer = function (_SystemRenderer) { return WebGLRenderer; }(_SystemRenderer3.default); -exports.default = WebGLRenderer; +/** + * Collection of installed plugins. These are included by default in PIXI, but can be excluded + * by creating a custom build. Consult the README for more information about creating custom + * builds and excluding plugins. + * @name PIXI.WebGLRenderer#plugins + * @type {object} + * @readonly + * @property {PIXI.accessibility.AccessibilityManager} accessibility Support tabbing interactive elements. + * @property {PIXI.extract.WebGLExtract} extract Extract image data from renderer. + * @property {PIXI.interaction.InteractionManager} interaction Handles mouse, touch and pointer events. + * @property {PIXI.prepare.WebGLPrepare} prepare Pre-render display objects. + */ +/** + * Adds a plugin to the renderer. + * + * @method PIXI.WebGLRenderer#registerPlugin + * @param {string} pluginName - The name of the plugin. + * @param {Function} ctor - The constructor function or class for the plugin. + */ +exports.default = WebGLRenderer; _utils.pluginTarget.mixin(WebGLRenderer); //# sourceMappingURL=WebGLRenderer.js.map /***/ }), -/* 83 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8075,7 +8677,7 @@ _utils.pluginTarget.mixin(WebGLRenderer); exports.__esModule = true; -var _WebGLManager2 = __webpack_require__(55); +var _WebGLManager2 = __webpack_require__(57); var _WebGLManager3 = _interopRequireDefault(_WebGLManager2); @@ -8150,7 +8752,7 @@ exports.default = ObjectRenderer; //# sourceMappingURL=ObjectRenderer.js.map /***/ }), -/* 84 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8158,11 +8760,11 @@ exports.default = ObjectRenderer; exports.__esModule = true; -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); @@ -8293,7 +8895,7 @@ var RenderTarget = function () { * @default PIXI.settings.SCALE_MODE * @see PIXI.SCALE_MODES */ - this.scaleMode = scaleMode || _settings2.default.SCALE_MODE; + this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE; /** * Whether this object is the root element or not @@ -8368,7 +8970,7 @@ var RenderTarget = function () { RenderTarget.prototype.setFrame = function setFrame(destinationFrame, sourceFrame) { this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame; - this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame; + this.sourceFrame = sourceFrame || this.sourceFrame || this.destinationFrame; }; /** @@ -8482,7 +9084,7 @@ exports.default = RenderTarget; //# sourceMappingURL=RenderTarget.js.map /***/ }), -/* 85 */ +/* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8491,7 +9093,7 @@ exports.default = RenderTarget; exports.__esModule = true; exports.loader = exports.prepare = exports.particles = exports.mesh = exports.loaders = exports.interaction = exports.filters = exports.extras = exports.extract = exports.accessibility = undefined; -var _polyfill = __webpack_require__(590); +var _polyfill = __webpack_require__(597); Object.keys(_polyfill).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -8503,19 +9105,7 @@ Object.keys(_polyfill).forEach(function (key) { }); }); -var _deprecation = __webpack_require__(559); - -Object.keys(_deprecation).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function get() { - return _deprecation[key]; - } - }); -}); - -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); Object.keys(_core).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -8527,81 +9117,92 @@ Object.keys(_core).forEach(function (key) { }); }); -var _accessibility = __webpack_require__(520); +var _deprecation = __webpack_require__(563); + +var _deprecation2 = _interopRequireDefault(_deprecation); + +var _accessibility = __webpack_require__(519); var accessibility = _interopRequireWildcard(_accessibility); -var _extract = __webpack_require__(561); +var _extract = __webpack_require__(565); var extract = _interopRequireWildcard(_extract); -var _extras = __webpack_require__(132); +var _extras = __webpack_require__(254); var extras = _interopRequireWildcard(_extras); -var _filters = __webpack_require__(259); +var _filters = __webpack_require__(578); var filters = _interopRequireWildcard(_filters); -var _interaction = __webpack_require__(578); +var _interaction = __webpack_require__(582); var interaction = _interopRequireWildcard(_interaction); -var _loaders = __webpack_require__(263); +var _loaders = __webpack_require__(583); var loaders = _interopRequireWildcard(_loaders); -var _mesh = __webpack_require__(267); +var _mesh = __webpack_require__(588); var mesh = _interopRequireWildcard(_mesh); -var _particles = __webpack_require__(268); +var _particles = __webpack_require__(591); var particles = _interopRequireWildcard(_particles); -var _prepare = __webpack_require__(269); +var _prepare = __webpack_require__(600); var prepare = _interopRequireWildcard(_prepare); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -// import polyfills. Done as an export to make sure polyfills are imported first -exports.accessibility = accessibility; -exports.extract = extract; -exports.extras = extras; -exports.filters = filters; -exports.interaction = interaction; -exports.loaders = loaders; -exports.mesh = mesh; -exports.particles = particles; -exports.prepare = prepare; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// export core +_core.utils.mixins.performMixins(); /** - * A premade instance of the loader that can be used to load resources. - * + * Alias for {@link PIXI.loaders.shared}. * @name loader * @memberof PIXI - * @property {PIXI.loaders.Loader} + * @type {PIXI.loader.Loader} */ -// export libs - +// handle mixins now, after all code has been added, including deprecation -// export core -var loader = loaders && loaders.Loader ? new loaders.Loader() : null; // check is there in case user excludes loader lib +// export libs +// import polyfills. Done as an export to make sure polyfills are imported first +var loader = loaders.shared || null; +exports.accessibility = accessibility; +exports.extract = extract; +exports.extras = extras; +exports.filters = filters; +exports.interaction = interaction; +exports.loaders = loaders; +exports.mesh = mesh; +exports.particles = particles; +exports.prepare = prepare; exports.loader = loader; -// Always export pixi globally. +// Apply the deprecations + +if (typeof _deprecation2.default === 'function') { + (0, _deprecation2.default)(exports); +} +// Always export PixiJS globally. global.PIXI = exports; // eslint-disable-line //# sourceMappingURL=index.js.map -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(29))) /***/ }), -/* 86 */ +/* 85 */ /***/ (function(module, exports) { module.exports = function(module) { @@ -8629,7 +9230,7 @@ module.exports = function(module) { /***/ }), -/* 87 */ +/* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8652,7 +9253,7 @@ var sound = new _howler.Howl(_audio2.default); exports.default = sound; /***/ }), -/* 88 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -8862,11 +9463,157 @@ exports.nextCombination = function(v) { +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * isMobile.js v0.4.1 + * + * A simple library to detect Apple phones and tablets, + * Android phones and tablets, other mobile devices (like blackberry, mini-opera and windows phone), + * and any kind of seven inch device, via user agent sniffing. + * + * @author: Kai Mallea (kmallea@gmail.com) + * + * @license: http://creativecommons.org/publicdomain/zero/1.0/ + */ +(function (global) { + + var apple_phone = /iPhone/i, + apple_ipod = /iPod/i, + apple_tablet = /iPad/i, + android_phone = /(?=.*\bAndroid\b)(?=.*\bMobile\b)/i, // Match 'Android' AND 'Mobile' + android_tablet = /Android/i, + amazon_phone = /(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i, + amazon_tablet = /(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i, + windows_phone = /Windows Phone/i, + windows_tablet = /(?=.*\bWindows\b)(?=.*\bARM\b)/i, // Match 'Windows' AND 'ARM' + other_blackberry = /BlackBerry/i, + other_blackberry_10 = /BB10/i, + other_opera = /Opera Mini/i, + other_chrome = /(CriOS|Chrome)(?=.*\bMobile\b)/i, + other_firefox = /(?=.*\bFirefox\b)(?=.*\bMobile\b)/i, // Match 'Firefox' AND 'Mobile' + seven_inch = new RegExp( + '(?:' + // Non-capturing group + + 'Nexus 7' + // Nexus 7 + + '|' + // OR + + 'BNTV250' + // B&N Nook Tablet 7 inch + + '|' + // OR + + 'Kindle Fire' + // Kindle Fire + + '|' + // OR + + 'Silk' + // Kindle Fire, Silk Accelerated + + '|' + // OR + + 'GT-P1000' + // Galaxy Tab 7 inch + + ')', // End non-capturing group + + 'i'); // Case-insensitive matching + + var match = function(regex, userAgent) { + return regex.test(userAgent); + }; + + var IsMobileClass = function(userAgent) { + var ua = userAgent || navigator.userAgent; + + // Facebook mobile app's integrated browser adds a bunch of strings that + // match everything. Strip it out if it exists. + var tmp = ua.split('[FBAN'); + if (typeof tmp[1] !== 'undefined') { + ua = tmp[0]; + } + + // Twitter mobile app's integrated browser on iPad adds a "Twitter for + // iPhone" string. Same probable happens on other tablet platforms. + // This will confuse detection so strip it out if it exists. + tmp = ua.split('Twitter'); + if (typeof tmp[1] !== 'undefined') { + ua = tmp[0]; + } + + this.apple = { + phone: match(apple_phone, ua), + ipod: match(apple_ipod, ua), + tablet: !match(apple_phone, ua) && match(apple_tablet, ua), + device: match(apple_phone, ua) || match(apple_ipod, ua) || match(apple_tablet, ua) + }; + this.amazon = { + phone: match(amazon_phone, ua), + tablet: !match(amazon_phone, ua) && match(amazon_tablet, ua), + device: match(amazon_phone, ua) || match(amazon_tablet, ua) + }; + this.android = { + phone: match(amazon_phone, ua) || match(android_phone, ua), + tablet: !match(amazon_phone, ua) && !match(android_phone, ua) && (match(amazon_tablet, ua) || match(android_tablet, ua)), + device: match(amazon_phone, ua) || match(amazon_tablet, ua) || match(android_phone, ua) || match(android_tablet, ua) + }; + this.windows = { + phone: match(windows_phone, ua), + tablet: match(windows_tablet, ua), + device: match(windows_phone, ua) || match(windows_tablet, ua) + }; + this.other = { + blackberry: match(other_blackberry, ua), + blackberry10: match(other_blackberry_10, ua), + opera: match(other_opera, ua), + firefox: match(other_firefox, ua), + chrome: match(other_chrome, ua), + device: match(other_blackberry, ua) || match(other_blackberry_10, ua) || match(other_opera, ua) || match(other_firefox, ua) || match(other_chrome, ua) + }; + this.seven_inch = match(seven_inch, ua); + this.any = this.apple.device || this.android.device || this.windows.device || this.other.device || this.seven_inch; + + // excludes 'other' devices and ipods, targeting touchscreen phones + this.phone = this.apple.phone || this.android.phone || this.windows.phone; + + // excludes 7 inch devices, classifying as phone or tablet is left to the user + this.tablet = this.apple.tablet || this.android.tablet || this.windows.tablet; + + if (typeof window === 'undefined') { + return this; + } + }; + + var instantiate = function() { + var IM = new IsMobileClass(); + IM.Class = IsMobileClass; + return IM; + }; + + if (typeof module !== 'undefined' && module.exports && typeof window === 'undefined') { + //node + module.exports = IsMobileClass; + } else if (typeof module !== 'undefined' && module.exports && typeof window !== 'undefined') { + //browserify + module.exports = instantiate(); + } else if (true) { + //AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (global.isMobile = instantiate()), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { + global.isMobile = instantiate(); + } + +})(this); + + /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { -var baseCreate = __webpack_require__(39), +var baseCreate = __webpack_require__(40), baseLodash = __webpack_require__(100); /** Used as references for the maximum length and index of an array. */ @@ -8900,7 +9647,7 @@ module.exports = LazyWrapper; /* 90 */ /***/ (function(module, exports, __webpack_require__) { -var baseCreate = __webpack_require__(39), +var baseCreate = __webpack_require__(40), baseLodash = __webpack_require__(100); /** @@ -8929,7 +9676,7 @@ module.exports = LodashWrapper; /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(33), - root = __webpack_require__(8); + root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); @@ -9098,7 +9845,7 @@ module.exports = baseFindIndex; /* 97 */ /***/ (function(module, exports, __webpack_require__) { -var createBaseFor = __webpack_require__(174); +var createBaseFor = __webpack_require__(175); /** * The base implementation of `baseForOwn` which iterates over `object` @@ -9120,8 +9867,8 @@ module.exports = baseFor; /* 98 */ /***/ (function(module, exports, __webpack_require__) { -var baseForRight = __webpack_require__(151), - keys = __webpack_require__(9); +var baseForRight = __webpack_require__(152), + keys = __webpack_require__(10); /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. @@ -9142,7 +9889,7 @@ module.exports = baseForOwnRight; /* 99 */ /***/ (function(module, exports, __webpack_require__) { -var arrayFilter = __webpack_require__(63), +var arrayFilter = __webpack_require__(62), isFunction = __webpack_require__(36); /** @@ -9183,11 +9930,11 @@ module.exports = baseLodash; /* 101 */ /***/ (function(module, exports, __webpack_require__) { -var Stack = __webpack_require__(62), - assignMergeValue = __webpack_require__(145), +var Stack = __webpack_require__(61), + assignMergeValue = __webpack_require__(146), baseFor = __webpack_require__(97), baseMergeDeep = __webpack_require__(313), - isObject = __webpack_require__(6), + isObject = __webpack_require__(7), keysIn = __webpack_require__(13); /** @@ -9254,7 +10001,7 @@ module.exports = baseRandom; /* 103 */ /***/ (function(module, exports, __webpack_require__) { -var Uint8Array = __webpack_require__(140); +var Uint8Array = __webpack_require__(141); /** * Creates a clone of `arrayBuffer`. @@ -9278,9 +10025,9 @@ module.exports = cloneArrayBuffer; var apply = __webpack_require__(11), arrayMap = __webpack_require__(12), - baseIteratee = __webpack_require__(3), - baseRest = __webpack_require__(4), - baseUnary = __webpack_require__(68), + baseIteratee = __webpack_require__(4), + baseRest = __webpack_require__(5), + baseUnary = __webpack_require__(67), flatRest = __webpack_require__(32); /** @@ -9309,8 +10056,8 @@ module.exports = createOver; /* 105 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetAllKeys = __webpack_require__(152), - getSymbolsIn = __webpack_require__(187), +var baseGetAllKeys = __webpack_require__(153), + getSymbolsIn = __webpack_require__(188), keysIn = __webpack_require__(13); /** @@ -9332,8 +10079,8 @@ module.exports = getAllKeysIn; /* 106 */ /***/ (function(module, exports, __webpack_require__) { -var metaMap = __webpack_require__(193), - noop = __webpack_require__(215); +var metaMap = __webpack_require__(194), + noop = __webpack_require__(216); /** * Gets metadata for `func`. @@ -9353,7 +10100,7 @@ module.exports = getData; /* 107 */ /***/ (function(module, exports, __webpack_require__) { -var arrayFilter = __webpack_require__(63), +var arrayFilter = __webpack_require__(62), stubArray = __webpack_require__(119); /** Used for built-in method references. */ @@ -9389,8 +10136,8 @@ module.exports = getSymbols; /* 108 */ /***/ (function(module, exports, __webpack_require__) { -var isArray = __webpack_require__(1), - isSymbol = __webpack_require__(46); +var isArray = __webpack_require__(2), + isSymbol = __webpack_require__(47); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, @@ -9449,7 +10196,7 @@ module.exports = mapToArray; /***/ (function(module, exports, __webpack_require__) { var baseSetToString = __webpack_require__(320), - shortOut = __webpack_require__(200); + shortOut = __webpack_require__(201); /** * Sets the `toString` method of `func` to return `string`. @@ -9468,8 +10215,8 @@ module.exports = setToString; /* 111 */ /***/ (function(module, exports, __webpack_require__) { -var copyObject = __webpack_require__(19), - createAssigner = __webpack_require__(42), +var copyObject = __webpack_require__(18), + createAssigner = __webpack_require__(43), keysIn = __webpack_require__(13); /** @@ -9544,7 +10291,7 @@ module.exports = constant; /* 113 */ /***/ (function(module, exports, __webpack_require__) { -var baseGet = __webpack_require__(41); +var baseGet = __webpack_require__(42); /** * Gets the value at `path` of `object`. If the resolved value is @@ -9584,7 +10331,7 @@ module.exports = get; /***/ (function(module, exports, __webpack_require__) { var baseHasIn = __webpack_require__(303), - hasPath = __webpack_require__(188); + hasPath = __webpack_require__(189); /** * Checks if `path` is a direct or inherited property of `object`. @@ -9664,9 +10411,9 @@ module.exports = isLength; /* 116 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetTag = __webpack_require__(26), - getPrototype = __webpack_require__(72), - isObjectLike = __webpack_require__(21); +var baseGetTag = __webpack_require__(25), + getPrototype = __webpack_require__(71), + isObjectLike = __webpack_require__(20); /** `Object#toString` result references. */ var objectTag = '[object Object]'; @@ -9780,7 +10527,7 @@ module.exports = negate; module.exports = { 'assign': __webpack_require__(396), - 'assignIn': __webpack_require__(204), + 'assignIn': __webpack_require__(205), 'assignInWith': __webpack_require__(111), 'assignWith': __webpack_require__(397), 'at': __webpack_require__(398), @@ -9805,26 +10552,26 @@ module.exports = { 'invert': __webpack_require__(446), 'invertBy': __webpack_require__(447), 'invoke': __webpack_require__(448), - 'keys': __webpack_require__(9), + 'keys': __webpack_require__(10), 'keysIn': __webpack_require__(13), 'mapKeys': __webpack_require__(454), 'mapValues': __webpack_require__(455), 'merge': __webpack_require__(458), - 'mergeWith': __webpack_require__(214), + 'mergeWith': __webpack_require__(215), 'omit': __webpack_require__(465), 'omitBy': __webpack_require__(466), 'pick': __webpack_require__(475), - 'pickBy': __webpack_require__(217), + 'pickBy': __webpack_require__(218), 'result': __webpack_require__(485), 'set': __webpack_require__(488), 'setWith': __webpack_require__(489), - 'toPairs': __webpack_require__(220), - 'toPairsIn': __webpack_require__(221), + 'toPairs': __webpack_require__(221), + 'toPairsIn': __webpack_require__(222), 'transform': __webpack_require__(502), 'unset': __webpack_require__(505), 'update': __webpack_require__(506), 'updateWith': __webpack_require__(507), - 'values': __webpack_require__(51), + 'values': __webpack_require__(53), 'valuesIn': __webpack_require__(508) }; @@ -9905,24 +10652,24 @@ module.exports = { 'defaultTo': __webpack_require__(409), 'flow': __webpack_require__(433), 'flowRight': __webpack_require__(434), - 'identity': __webpack_require__(29), + 'identity': __webpack_require__(28), 'iteratee': __webpack_require__(452), 'matches': __webpack_require__(456), 'matchesProperty': __webpack_require__(457), 'method': __webpack_require__(459), 'methodOf': __webpack_require__(460), 'mixin': __webpack_require__(461), - 'noop': __webpack_require__(215), + 'noop': __webpack_require__(216), 'nthArg': __webpack_require__(463), 'over': __webpack_require__(469), 'overEvery': __webpack_require__(471), 'overSome': __webpack_require__(472), - 'property': __webpack_require__(218), + 'property': __webpack_require__(219), 'propertyOf': __webpack_require__(476), 'range': __webpack_require__(478), 'rangeRight': __webpack_require__(479), 'stubArray': __webpack_require__(119), - 'stubFalse': __webpack_require__(219), + 'stubFalse': __webpack_require__(220), 'stubObject': __webpack_require__(495), 'stubString': __webpack_require__(496), 'stubTrue': __webpack_require__(497), @@ -9993,7 +10740,7 @@ module.exports = mapSize; exports.__esModule = true; -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -10341,7 +11088,7 @@ exports.default = Bounds; exports.__esModule = true; -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -10444,7 +11191,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * The pixi Matrix class as an object, which makes it a lot faster, + * The PixiJS Matrix class as an object, which makes it a lot faster, * here is a representation of it : * | a | b | tx| * | c | d | ty| @@ -10455,46 +11202,58 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons */ var Matrix = function () { /** - * + * @param {number} [a=1] - x scale + * @param {number} [b=0] - y skew + * @param {number} [c=0] - x skew + * @param {number} [d=1] - y scale + * @param {number} [tx=0] - x translation + * @param {number} [ty=0] - y translation */ function Matrix() { + var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + var tx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + var ty = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; + _classCallCheck(this, Matrix); /** * @member {number} * @default 1 */ - this.a = 1; + this.a = a; /** * @member {number} * @default 0 */ - this.b = 0; + this.b = b; /** * @member {number} * @default 0 */ - this.c = 0; + this.c = c; /** * @member {number} * @default 1 */ - this.d = 1; + this.d = d; /** * @member {number} * @default 0 */ - this.tx = 0; + this.tx = tx; /** * @member {number} * @default 0 */ - this.ty = 0; + this.ty = ty; this.array = null; } @@ -11055,7 +11814,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -11085,25 +11844,25 @@ var Rectangle = function () { * @member {number} * @default 0 */ - this.x = x; + this.x = Number(x); /** * @member {number} * @default 0 */ - this.y = y; + this.y = Number(y); /** * @member {number} * @default 0 */ - this.width = width; + this.width = Number(width); /** * @member {number} * @default 0 */ - this.height = height; + this.height = Number(height); /** * The type of the object, mainly used to avoid `instanceof` checks @@ -11323,17 +12082,17 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); -var _Texture = __webpack_require__(57); +var _Texture = __webpack_require__(37); var _Texture2 = _interopRequireDefault(_Texture); -var _Container2 = __webpack_require__(53); +var _Container2 = __webpack_require__(55); var _Container3 = _interopRequireDefault(_Container2); @@ -11489,14 +12248,15 @@ var Sprite = function (_Container) { Sprite.prototype._onTextureUpdate = function _onTextureUpdate() { this._textureID = -1; this._textureTrimmedID = -1; + this.cachedTint = 0xFFFFFF; // so if _width is 0 then width was not set.. if (this._width) { - this.scale.x = (0, _utils.sign)(this.scale.x) * this._width / this.texture.orig.width; + this.scale.x = (0, _utils.sign)(this.scale.x) * this._width / this._texture.orig.width; } if (this._height) { - this.scale.y = (0, _utils.sign)(this.scale.y) * this._height / this.texture.orig.height; + this.scale.y = (0, _utils.sign)(this.scale.y) * this._height / this._texture.orig.height; } }; @@ -11554,11 +12314,11 @@ var Sprite = function (_Container) { h1 = trim.y - anchor._y * orig.height; h0 = h1 + trim.height; } else { - w0 = orig.width * (1 - anchor._x); - w1 = orig.width * -anchor._x; + w1 = -anchor._x * orig.width; + w0 = w1 + orig.width; - h0 = orig.height * (1 - anchor._y); - h1 = orig.height * -anchor._y; + h1 = -anchor._y * orig.height; + h0 = h1 + orig.height; } // xy @@ -11609,11 +12369,11 @@ var Sprite = function (_Container) { var tx = wt.tx; var ty = wt.ty; - var w0 = orig.width * (1 - anchor._x); - var w1 = orig.width * -anchor._x; + var w1 = -anchor._x * orig.width; + var w0 = w1 + orig.width; - var h0 = orig.height * (1 - anchor._y); - var h1 = orig.height * -anchor._y; + var h1 = -anchor._y * orig.height; + var h0 = h1 + orig.height; // xy vertexData[0] = a * w1 + c * h1 + tx; @@ -11686,8 +12446,8 @@ var Sprite = function (_Container) { /** * Gets the local bounds of the sprite object. * - * @param {Rectangle} rect - The output rectangle. - * @return {Rectangle} The bounds. + * @param {PIXI.Rectangle} rect - The output rectangle. + * @return {PIXI.Rectangle} The bounds. */ @@ -11697,7 +12457,7 @@ var Sprite = function (_Container) { this._bounds.minX = this._texture.orig.width * -this._anchor._x; this._bounds.minY = this._texture.orig.height * -this._anchor._y; this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x); - this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._x); + this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y); if (!rect) { if (!this._localBoundsRect) { @@ -11729,10 +12489,10 @@ var Sprite = function (_Container) { var x1 = -width * this.anchor.x; var y1 = 0; - if (tempPoint.x > x1 && tempPoint.x < x1 + width) { + if (tempPoint.x >= x1 && tempPoint.x < x1 + width) { y1 = -height * this.anchor.y; - if (tempPoint.y > y1 && tempPoint.y < y1 + height) { + if (tempPoint.y >= y1 && tempPoint.y < y1 + height) { return true; } } @@ -11777,7 +12537,7 @@ var Sprite = function (_Container) { * * @static * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source Source to create texture from - * @return {PIXI.Texture} The newly created texture + * @return {PIXI.Sprite} The newly created sprite */ @@ -11881,8 +12641,8 @@ var Sprite = function (_Container) { } /** - * The tint applied to the sprite. This is a hex value. A value of - * 0xFFFFFF will remove any tint effect. + * The tint applied to the sprite. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. * * @member {number} * @default 0xFFFFFF @@ -11948,9 +12708,9 @@ exports.default = Sprite; exports.__esModule = true; -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); -var _canUseNewCanvasBlendModes = __webpack_require__(243); +var _canUseNewCanvasBlendModes = __webpack_require__(245); var _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes); @@ -11972,7 +12732,7 @@ var CanvasTinter = { * @return {HTMLCanvasElement} The tinted canvas */ getTintedTexture: function getTintedTexture(sprite, color) { - var texture = sprite.texture; + var texture = sprite._texture; color = CanvasTinter.roundColor(color); @@ -11980,16 +12740,24 @@ var CanvasTinter = { texture.tintCache = texture.tintCache || {}; - if (texture.tintCache[stringColor]) { - return texture.tintCache[stringColor]; - } + var cachedTexture = texture.tintCache[stringColor]; - // clone texture.. - var canvas = CanvasTinter.canvas || document.createElement('canvas'); + var canvas = void 0; + + if (cachedTexture) { + if (cachedTexture.tintId === texture._updateID) { + return texture.tintCache[stringColor]; + } + + canvas = texture.tintCache[stringColor]; + } else { + canvas = CanvasTinter.canvas || document.createElement('canvas'); + } - // CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); CanvasTinter.tintMethod(texture, color, canvas); + canvas.tintId = texture._updateID; + if (CanvasTinter.convertTintToImage) { // is this better? var tintImage = new Image(); @@ -12024,9 +12792,10 @@ var CanvasTinter = { crop.width *= resolution; crop.height *= resolution; - canvas.width = crop.width; - canvas.height = crop.height; + canvas.width = Math.ceil(crop.width); + canvas.height = Math.ceil(crop.height); + context.save(); context.fillStyle = '#' + ('00000' + (color | 0).toString(16)).substr(-6); context.fillRect(0, 0, crop.width, crop.height); @@ -12038,6 +12807,7 @@ var CanvasTinter = { context.globalCompositeOperation = 'destination-atop'; context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); + context.restore(); }, /** @@ -12058,9 +12828,10 @@ var CanvasTinter = { crop.width *= resolution; crop.height *= resolution; - canvas.width = crop.width; - canvas.height = crop.height; + canvas.width = Math.ceil(crop.width); + canvas.height = Math.ceil(crop.height); + context.save(); context.globalCompositeOperation = 'copy'; context.fillStyle = '#' + ('00000' + (color | 0).toString(16)).substr(-6); context.fillRect(0, 0, crop.width, crop.height); @@ -12069,6 +12840,7 @@ var CanvasTinter = { context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); // context.globalCompositeOperation = 'copy'; + context.restore(); }, @@ -12090,11 +12862,13 @@ var CanvasTinter = { crop.width *= resolution; crop.height *= resolution; - canvas.width = crop.width; - canvas.height = crop.height; + canvas.width = Math.ceil(crop.width); + canvas.height = Math.ceil(crop.height); + context.save(); context.globalCompositeOperation = 'copy'; context.drawImage(texture.baseTexture.source, crop.x, crop.y, crop.width, crop.height, 0, 0, crop.width, crop.height); + context.restore(); var rgbValues = (0, _utils.hex2rgb)(color); var r = rgbValues[0]; @@ -12190,11 +12964,11 @@ exports.default = CanvasTinter; exports.__esModule = true; -var _BaseRenderTexture = __webpack_require__(248); +var _BaseRenderTexture = __webpack_require__(251); var _BaseRenderTexture2 = _interopRequireDefault(_BaseRenderTexture); -var _Texture2 = __webpack_require__(57); +var _Texture2 = __webpack_require__(37); var _Texture3 = _interopRequireDefault(_Texture2); @@ -12207,7 +12981,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * A RenderTexture is a special texture that allows any Pixi display object to be rendered to it. + * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it. * * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded * otherwise black rectangles will be drawn instead. @@ -12260,8 +13034,8 @@ var RenderTexture = function (_Texture) { /* eslint-disable prefer-rest-params, no-console */ var width = arguments[1]; var height = arguments[2]; - var scaleMode = arguments[3] || 0; - var resolution = arguments[4] || 1; + var scaleMode = arguments[3]; + var resolution = arguments[4]; // we have an old render texture.. console.warn('Please use RenderTexture.create(' + width + ', ' + height + ') instead of the ctor directly.'); @@ -12344,6 +13118,91 @@ exports.default = RenderTexture; "use strict"; +exports.__esModule = true; +exports.Ticker = exports.shared = undefined; + +var _Ticker = __webpack_require__(554); + +var _Ticker2 = _interopRequireDefault(_Ticker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}. + * and by {@link PIXI.interaction.InteractionManager}. + * The property {@link PIXI.ticker.Ticker#autoStart} is set to `true` + * for this instance. Please follow the examples for usage, including + * how to opt-out of auto-starting the shared ticker. + * + * @example + * let ticker = PIXI.ticker.shared; + * // Set this to prevent starting this ticker when listeners are added. + * // By default this is true only for the PIXI.ticker.shared instance. + * ticker.autoStart = false; + * // FYI, call this to ensure the ticker is stopped. It should be stopped + * // if you have not attempted to render anything yet. + * ticker.stop(); + * // Call this when you are ready for a running shared ticker. + * ticker.start(); + * + * @example + * // You may use the shared ticker to render... + * let renderer = PIXI.autoDetectRenderer(800, 600); + * let stage = new PIXI.Container(); + * let interactionManager = PIXI.interaction.InteractionManager(renderer); + * document.body.appendChild(renderer.view); + * ticker.add(function (time) { + * renderer.render(stage); + * }); + * + * @example + * // Or you can just update it manually. + * ticker.autoStart = false; + * ticker.stop(); + * function animate(time) { + * ticker.update(time); + * renderer.render(stage); + * requestAnimationFrame(animate); + * } + * animate(performance.now()); + * + * @type {PIXI.ticker.Ticker} + * @memberof PIXI.ticker + */ +var shared = new _Ticker2.default(); + +shared.autoStart = true; +shared.destroy = function () { + // protect destroying shared ticker + // this is used by other internal systems + // like AnimatedSprite and InteractionManager +}; + +/** + * This namespace contains an API for interacting with PIXI's internal global update loop. + * + * This ticker is used for rendering, {@link PIXI.extras.AnimatedSprite AnimatedSprite}, + * {@link PIXI.interaction.InteractionManager InteractionManager} and many other time-based PIXI systems. + * @example + * const ticker = new PIXI.ticker.Ticker(); + * ticker.stop(); + * ticker.add((deltaTime) => { + * // do something every frame + * }); + * ticker.start(); + * @namespace PIXI.ticker + */ +exports.shared = shared; +exports.Ticker = _Ticker2.default; +//# sourceMappingURL=index.js.map + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + exports.__esModule = true; exports.default = createIndicesForQuads; /** @@ -12377,73 +13236,171 @@ function createIndicesForQuads(size) { //# sourceMappingURL=createIndicesForQuads.js.map /***/ }), -/* 132 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.BitmapText = exports.TilingSpriteRenderer = exports.TilingSprite = exports.AnimatedSprite = exports.TextureTransform = undefined; -var _TextureTransform = __webpack_require__(253); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -Object.defineProperty(exports, 'TextureTransform', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_TextureTransform).default; - } -}); +var _Matrix = __webpack_require__(125); -var _AnimatedSprite = __webpack_require__(563); +var _Matrix2 = _interopRequireDefault(_Matrix); -Object.defineProperty(exports, 'AnimatedSprite', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_AnimatedSprite).default; - } -}); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _TilingSprite = __webpack_require__(565); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -Object.defineProperty(exports, 'TilingSprite', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_TilingSprite).default; - } -}); +var tempMat = new _Matrix2.default(); -var _TilingSpriteRenderer = __webpack_require__(569); +/** + * class controls uv transform and frame clamp for texture + * + * @class + * @memberof PIXI.extras + */ -Object.defineProperty(exports, 'TilingSpriteRenderer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_TilingSpriteRenderer).default; - } -}); +var TextureTransform = function () { + /** + * + * @param {PIXI.Texture} texture observed texture + * @param {number} [clampMargin] Changes frame clamping, 0.5 by default. Use -0.5 for extra border. + * @constructor + */ + function TextureTransform(texture, clampMargin) { + _classCallCheck(this, TextureTransform); -var _BitmapText = __webpack_require__(564); + this._texture = texture; -Object.defineProperty(exports, 'BitmapText', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_BitmapText).default; - } -}); + this.mapCoord = new _Matrix2.default(); -__webpack_require__(566); + this.uClampFrame = new Float32Array(4); -__webpack_require__(567); + this.uClampOffset = new Float32Array(2); -__webpack_require__(568); + this._lastTextureID = -1; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * Changes frame clamping + * Works with TilingSprite and Mesh + * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders + * + * @default 0 + * @member {number} + */ + this.clampOffset = 0; -// imported for side effect of extending the prototype only, contains no exports -//# sourceMappingURL=index.js.map + /** + * Changes frame clamping + * Works with TilingSprite and Mesh + * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas + * + * @default 0.5 + * @member {number} + */ + this.clampMargin = typeof clampMargin === 'undefined' ? 0.5 : clampMargin; + } + + /** + * texture property + * @member {PIXI.Texture} + */ + + + /** + * Multiplies uvs array to transform + * @param {Float32Array} uvs mesh uvs + * @param {Float32Array} [out=uvs] output + * @returns {Float32Array} output + */ + TextureTransform.prototype.multiplyUvs = function multiplyUvs(uvs, out) { + if (out === undefined) { + out = uvs; + } + + var mat = this.mapCoord; + + for (var i = 0; i < uvs.length; i += 2) { + var x = uvs[i]; + var y = uvs[i + 1]; + + out[i] = x * mat.a + y * mat.c + mat.tx; + out[i + 1] = x * mat.b + y * mat.d + mat.ty; + } + + return out; + }; + + /** + * updates matrices if texture was changed + * @param {boolean} forceUpdate if true, matrices will be updated any case + * @returns {boolean} whether or not it was updated + */ + + + TextureTransform.prototype.update = function update(forceUpdate) { + var tex = this._texture; + + if (!tex || !tex.valid) { + return false; + } + + if (!forceUpdate && this._lastTextureID === tex._updateID) { + return false; + } + + this._lastTextureID = tex._updateID; + + var uvs = tex._uvs; + + this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0); + + var orig = tex.orig; + var trim = tex.trim; + + if (trim) { + tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height); + this.mapCoord.append(tempMat); + } + + var texBase = tex.baseTexture; + var frame = this.uClampFrame; + var margin = this.clampMargin / texBase.resolution; + var offset = this.clampOffset; + + frame[0] = (tex._frame.x + margin + offset) / texBase.width; + frame[1] = (tex._frame.y + margin + offset) / texBase.height; + frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width; + frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height; + this.uClampOffset[0] = offset / texBase.realWidth; + this.uClampOffset[1] = offset / texBase.realHeight; + + return true; + }; + + _createClass(TextureTransform, [{ + key: 'texture', + get: function get() { + return this._texture; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this._texture = value; + this._lastTextureID = -1; + } + }]); + + return TextureTransform; +}(); + +exports.default = TextureTransform; +//# sourceMappingURL=TextureTransform.js.map /***/ }), -/* 133 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -12451,11 +13408,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _CountLimiter = __webpack_require__(270); +var _CountLimiter = __webpack_require__(268); var _CountLimiter2 = _interopRequireDefault(_CountLimiter); @@ -12483,9 +13440,21 @@ core.settings.UPLOADS_PER_FRAME = 4; * basic queuing functionality and is extended by {@link PIXI.prepare.WebGLPrepare} and {@link PIXI.prepare.CanvasPrepare} * to provide preparation capabilities specific to their respective renderers. * + * @example + * // Create a sprite + * const sprite = new PIXI.Sprite.fromImage('something.png'); + * + * // Load object into GPU + * app.renderer.plugins.prepare.upload(sprite, () => { + * + * //Texture(s) has been uploaded to GPU + * app.stage.addChild(sprite); + * + * }) + * * @abstract * @class - * @memberof PIXI + * @memberof PIXI.prepare */ var BasePrepare = function () { @@ -12566,16 +13535,24 @@ var BasePrepare = function () { _this.prepareItems(); }; - this.register(findText, drawText); - this.register(findTextStyle, calculateTextStyle); + // hooks to find the correct texture + this.registerFindHook(findText); + this.registerFindHook(findTextStyle); + this.registerFindHook(findMultipleBaseTextures); + this.registerFindHook(findBaseTexture); + this.registerFindHook(findTexture); + + // upload hooks + this.registerUploadHook(drawText); + this.registerUploadHook(calculateTextStyle); } /** * Upload all the textures and graphics to the GPU. * - * @param {Function|PIXI.DisplayObject|PIXI.Container} item - Either - * the container or display object to search for items to upload or - * the callback function, if items have been added using `prepare.add`. + * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item - + * Either the container or display object to search for items to upload, the items to upload themselves, + * or the callback function, if items have been added using `prepare.add`. * @param {Function} [done] - Optional callback when all queued uploads have completed */ @@ -12600,7 +13577,7 @@ var BasePrepare = function () { if (!this.ticking) { this.ticking = true; - SharedTicker.addOnce(this.tick, this); + SharedTicker.addOnce(this.tick, this, core.UPDATE_PRIORITY.UTILITY); } } else if (done) { done(); @@ -12633,11 +13610,13 @@ var BasePrepare = function () { var item = this.queue[0]; var uploaded = false; - for (var i = 0, len = this.uploadHooks.length; i < len; i++) { - if (this.uploadHooks[i](this.uploadHookHelper, item)) { - this.queue.shift(); - uploaded = true; - break; + if (item && !item._destroyed) { + for (var i = 0, len = this.uploadHooks.length; i < len; i++) { + if (this.uploadHooks[i](this.uploadHookHelper, item)) { + this.queue.shift(); + uploaded = true; + break; + } } } @@ -12659,26 +13638,37 @@ var BasePrepare = function () { } } else { // if we are not finished, on the next rAF do this again - SharedTicker.addOnce(this.tick, this); + SharedTicker.addOnce(this.tick, this, core.UPDATE_PRIORITY.UTILITY); } }; /** - * Adds hooks for finding and uploading items. + * Adds hooks for finding items. * - * @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array` - function must return `true` if it was able to add item to the queue. - * @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and - * function must return `true` if it was able to handle upload of item. - * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. + * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array` + * function must return `true` if it was able to add item to the queue. + * @return {PIXI.BasePrepare} Instance of plugin for chaining. */ - BasePrepare.prototype.register = function register(addHook, uploadHook) { + BasePrepare.prototype.registerFindHook = function registerFindHook(addHook) { if (addHook) { this.addHooks.push(addHook); } + return this; + }; + + /** + * Adds hooks for uploading items. + * + * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and + * function must return `true` if it was able to handle upload of item. + * @return {PIXI.BasePrepare} Instance of plugin for chaining. + */ + + + BasePrepare.prototype.registerUploadHook = function registerUploadHook(uploadHook) { if (uploadHook) { this.uploadHooks.push(uploadHook); } @@ -12689,7 +13679,8 @@ var BasePrepare = function () { /** * Manually add an item to the uploading queue. * - * @param {PIXI.DisplayObject|PIXI.Container|*} item - Object to add to the queue + * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to + * add to the queue * @return {PIXI.CanvasPrepare} Instance of plugin for chaining. */ @@ -12736,6 +13727,80 @@ var BasePrepare = function () { return BasePrepare; }(); +/** + * Built-in hook to find multiple textures from objects like AnimatedSprites. + * + * @private + * @param {PIXI.DisplayObject} item - Display object to check + * @param {Array<*>} queue - Collection of items to upload + * @return {boolean} if a PIXI.Texture object was found. + */ + + +exports.default = BasePrepare; +function findMultipleBaseTextures(item, queue) { + var result = false; + + // Objects with mutliple textures + if (item && item._textures && item._textures.length) { + for (var i = 0; i < item._textures.length; i++) { + if (item._textures[i] instanceof core.Texture) { + var baseTexture = item._textures[i].baseTexture; + + if (queue.indexOf(baseTexture) === -1) { + queue.push(baseTexture); + result = true; + } + } + } + } + + return result; +} + +/** + * Built-in hook to find BaseTextures from Sprites. + * + * @private + * @param {PIXI.DisplayObject} item - Display object to check + * @param {Array<*>} queue - Collection of items to upload + * @return {boolean} if a PIXI.Texture object was found. + */ +function findBaseTexture(item, queue) { + // Objects with textures, like Sprites/Text + if (item instanceof core.BaseTexture) { + if (queue.indexOf(item) === -1) { + queue.push(item); + } + + return true; + } + + return false; +} + +/** + * Built-in hook to find textures from objects. + * + * @private + * @param {PIXI.DisplayObject} item - Display object to check + * @param {Array<*>} queue - Collection of items to upload + * @return {boolean} if a PIXI.Texture object was found. + */ +function findTexture(item, queue) { + if (item._texture && item._texture instanceof core.Texture) { + var texture = item._texture.baseTexture; + + if (queue.indexOf(texture) === -1) { + queue.push(texture); + } + + return true; + } + + return false; +} + /** * Built-in hook to draw PIXI.Text to its texture. * @@ -12744,9 +13809,6 @@ var BasePrepare = function () { * @param {PIXI.DisplayObject} item - Item to check * @return {boolean} If item was uploaded. */ - - -exports.default = BasePrepare; function drawText(helper, item) { if (item instanceof core.Text) { // updating text will return early if it is not dirty @@ -12768,11 +13830,9 @@ function drawText(helper, item) { */ function calculateTextStyle(helper, item) { if (item instanceof core.TextStyle) { - var font = core.Text.getFontStyle(item); + var font = item.toFontString(); - if (!core.Text.fontPropertiesCache[font]) { - core.Text.calculateFontProperties(font); - } + core.TextMetrics.measureFont(font); return true; } @@ -12833,7 +13893,7 @@ function findTextStyle(item, queue) { //# sourceMappingURL=BasePrepare.js.map /***/ }), -/* 134 */ +/* 135 */ /***/ (function(module, exports) { // shim for using process in browser @@ -13006,6 +14066,10 @@ process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); @@ -13019,7 +14083,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 135 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -13029,11 +14093,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _parseUri = __webpack_require__(223); +var _parseUri = __webpack_require__(224); var _parseUri2 = _interopRequireDefault(_parseUri); -var _miniSignals = __webpack_require__(222); +var _miniSignals = __webpack_require__(223); var _miniSignals2 = _interopRequireDefault(_miniSignals); @@ -13049,6 +14113,8 @@ var tempAnchor = null; var STATUS_NONE = 0; var STATUS_OK = 200; var STATUS_EMPTY = 204; +var STATUS_IE_BUG_EMPTY = 1223; +var STATUS_TYPE_OK = 2; // noop function _noop() {} /* empty */ @@ -13100,6 +14166,9 @@ var Resource = function () { * element to use for loading, instead of creating one. * @param {boolean} [options.metadata.skipSource=false] - Skips adding source(s) to the load element. This * is useful if you want to pass in a `loadElement` that you already added load sources to. + * @param {string|string[]} [options.metadata.mimeType] - The mime type to use for the source element of a video/audio + * elment. If the urls are an array, you can pass this as an array as well where each index is the mime type to + * use for the corresponding url index. */ @@ -13138,6 +14207,14 @@ var Resource = function () { */ this.url = url; + /** + * The extension used to load this resource. + * + * @member {string} + * @readonly + */ + this.extension = this._getExtension(); + /** * The data that was loaded by the resource. * @@ -13568,11 +14645,15 @@ var Resource = function () { if (navigator.isCocoonJS) { this.data.src = Array.isArray(this.url) ? this.url[0] : this.url; } else if (Array.isArray(this.url)) { + var mimeTypes = this.metadata.mimeType; + for (var i = 0; i < this.url.length; ++i) { - this.data.appendChild(this._createSource(type, this.url[i])); + this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes)); } } else { - this.data.appendChild(this._createSource(type, this.url)); + var _mimeTypes = this.metadata.mimeType; + + this.data.appendChild(this._createSource(type, this.url, Array.isArray(_mimeTypes) ? _mimeTypes[0] : _mimeTypes)); } } @@ -13667,7 +14748,7 @@ var Resource = function () { Resource.prototype._createSource = function _createSource(type, url, mime) { if (!mime) { - mime = type + '/' + url.substr(url.lastIndexOf('.') + 1); + mime = type + '/' + this._getExtension(url); } var source = document.createElement('source'); @@ -13752,19 +14833,36 @@ var Resource = function () { Resource.prototype._xhrOnLoad = function _xhrOnLoad() { var xhr = this.xhr; - var status = typeof xhr.status === 'undefined' ? xhr.status : STATUS_OK; // XDR has no `.status`, assume 200. + var text = ''; + var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200. - // status can be 0 when using the `file://` protocol so we also check if a response is set - if (status === STATUS_OK || status === STATUS_EMPTY || status === STATUS_NONE && xhr.responseText.length > 0) { + // responseText is accessible only if responseType is '' or 'text' and on older browsers + if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') { + text = xhr.responseText; + } + + // status can be 0 when using the `file://` protocol so we also check if a response is set. + // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request. + if (status === STATUS_NONE && text.length > 0) { + status = STATUS_OK; + } + // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + else if (status === STATUS_IE_BUG_EMPTY) { + status = STATUS_EMPTY; + } + + var statusType = status / 100 | 0; + + if (statusType === STATUS_TYPE_OK) { // if text, just return it if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) { - this.data = xhr.responseText; + this.data = text; this.type = Resource.TYPE.TEXT; } // if json, parse into json object else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) { try { - this.data = JSON.parse(xhr.responseText); + this.data = JSON.parse(text); this.type = Resource.TYPE.JSON; } catch (e) { this.abort('Error trying to parse loaded json: ' + e); @@ -13778,11 +14876,11 @@ var Resource = function () { if (window.DOMParser) { var domparser = new DOMParser(); - this.data = domparser.parseFromString(xhr.responseText, 'text/xml'); + this.data = domparser.parseFromString(text, 'text/xml'); } else { var div = document.createElement('div'); - div.innerHTML = xhr.responseText; + div.innerHTML = text; this.data = div; } @@ -13796,7 +14894,7 @@ var Resource = function () { } // other types just return the response else { - this.data = xhr.response || xhr.responseText; + this.data = xhr.response || text; } } else { this.abort('[' + xhr.status + '] ' + xhr.statusText + ': ' + xhr.responseURL); @@ -13859,7 +14957,7 @@ var Resource = function () { Resource.prototype._determineXhrType = function _determineXhrType() { - return Resource._xhrTypeMap[this._getExtension()] || Resource.XHR_RESPONSE_TYPE.TEXT; + return Resource._xhrTypeMap[this.extension] || Resource.XHR_RESPONSE_TYPE.TEXT; }; /** @@ -13872,7 +14970,7 @@ var Resource = function () { Resource.prototype._determineLoadType = function _determineLoadType() { - return Resource._loadTypeMap[this._getExtension()] || Resource.LOAD_TYPE.XHR; + return Resource._loadTypeMap[this.extension] || Resource.LOAD_TYPE.XHR; }; /** @@ -13893,11 +14991,10 @@ var Resource = function () { ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex)); } else { var queryStart = url.indexOf('?'); + var hashStart = url.indexOf('#'); + var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length); - if (queryStart !== -1) { - url = url.substring(0, queryStart); - } - + url = url.substring(0, index); ext = url.substring(url.lastIndexOf('.') + 1); } @@ -14147,7 +15244,7 @@ function reqType(xhr) { //# sourceMappingURL=Resource.js.map /***/ }), -/* 136 */ +/* 137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14187,7 +15284,7 @@ module.exports.directionOfTravel = function (pointStart, pointEnd) { }; /***/ }), -/* 137 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -14199,11 +15296,11 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _pixi = __webpack_require__(85); +var _pixi = __webpack_require__(84); -var _gsap = __webpack_require__(139); +var _gsap = __webpack_require__(140); -var _collection = __webpack_require__(207); +var _collection = __webpack_require__(208); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -14356,7 +15453,7 @@ var Character = function (_extras$AnimatedSprit) { exports.default = Character; /***/ }), -/* 138 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -15007,12 +16104,12 @@ earcut.flatten = function (data) { /***/ }), -/* 139 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * VERSION: 1.19.1 - * DATE: 2017-01-17 + * VERSION: 1.20.2 + * DATE: 2017-06-30 * UPDATES AND DOCS AT: http://greensock.com * * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin @@ -15049,7 +16146,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa TweenMax = function(target, duration, vars) { TweenLite.call(this, target, duration, vars); this._cycle = 0; - this._yoyo = (this.vars.yoyo === true); + this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); this._repeat = this.vars.repeat || 0; this._repeatDelay = this.vars.repeatDelay || 0; this._dirty = true; //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it. @@ -15062,7 +16159,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), _blankArray = []; - TweenMax.version = "1.19.1"; + TweenMax.version = "1.20.2"; p.constructor = TweenMax; p.kill()._gc = false; TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; @@ -15072,9 +16169,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa TweenMax.render = TweenLite.render; p.invalidate = function() { - this._yoyo = (this.vars.yoyo === true); + this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); this._repeat = this.vars.repeat || 0; this._repeatDelay = this.vars.repeatDelay || 0; + this._yoyoEase = null; this._uncache(true); return TweenLite.prototype.invalidate.call(this); }; @@ -15142,7 +16240,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa prevCycle = this._cycle, duration = this._duration, prevRawPrevTime = this._rawPrevTime, - isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime; + isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime, yoyoEase; if (time >= totalDur - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts. this._totalTime = totalDur; this._cycle = this._repeat; @@ -15201,6 +16299,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa this._time = this._totalTime - (this._cycle * cycleDuration); if (this._yoyo) if ((this._cycle & 1) !== 0) { this._time = duration - this._time; + yoyoEase = this._yoyoEase || this.vars.yoyoEase; //note: we don't set this._yoyoEase in _init() like we do other properties because it's TweenMax-specific and doing it here allows us to optimize performance (most tweens don't have a yoyoEase). Note that we also must skip the this.ratio calculation further down right after we _init() in this function, because we're doing it here. + if (yoyoEase) { + if (!this._yoyoEase) { + if (yoyoEase === true && !this._initted) { //if it's not initted and yoyoEase is true, this._ease won't have been populated yet so we must discern it here. + yoyoEase = this.vars.ease; + this._yoyoEase = yoyoEase = !yoyoEase ? TweenLite.defaultEase : (yoyoEase instanceof Ease) ? yoyoEase : (typeof(yoyoEase) === "function") ? new Ease(yoyoEase, this.vars.easeParams) : Ease.map[yoyoEase] || TweenLite.defaultEase; + } else { + this._yoyoEase = yoyoEase = (yoyoEase === true) ? this._ease : (yoyoEase instanceof Ease) ? yoyoEase : Ease.map[yoyoEase]; + } + } + this.ratio = yoyoEase ? 1 - yoyoEase.getRatio((duration - this._time) / duration) : 0; + } } if (this._time > duration) { this._time = duration; @@ -15209,7 +16319,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } } - if (this._easeType) { + if (this._easeType && !yoyoEase) { r = this._time / duration; type = this._easeType; pow = this._easePower; @@ -15239,7 +16349,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa this.ratio = 1 - (r / 2); } - } else { + } else if (!yoyoEase) { this.ratio = this._ease.getRatio(this._time / duration); } @@ -15264,9 +16374,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa return; } //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. - if (this._time && !isComplete) { + if (this._time && !isComplete && !yoyoEase) { this.ratio = this._ease.getRatio(this._time / duration); - } else if (isComplete && this._ease._calcEnd) { + } else if (isComplete && this._ease._calcEnd && !yoyoEase) { this.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1); } } @@ -15699,7 +16809,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa }, p = TimelineLite.prototype = new SimpleTimeline(); - TimelineLite.version = "1.19.1"; + TimelineLite.version = "1.20.2"; p.constructor = TimelineLite; p.kill()._gc = p._forcingPlayhead = p._hasPause = false; @@ -15863,6 +16973,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa SimpleTimeline.prototype.add.call(this, value, position); + if (value._time) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. + value.render((this.rawTime() - value._startTime) * value._timeScale, false, false); + } + //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) { //in case any of the ancestors had completed but should now be enabled... @@ -15946,7 +17060,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa }; p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { - var i; + var clippedDuration, i; //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). if (ignore instanceof Animation && ignore.timeline === this) { this.remove(ignore); @@ -15958,22 +17072,23 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } } } + clippedDuration = (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead. if (typeof(offsetOrLabel) === "string") { - return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent); + return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent); } offsetOrLabel = offsetOrLabel || 0; if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). i = timeOrLabel.indexOf("="); if (i === -1) { if (this._labels[timeOrLabel] == null) { - return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel; + return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel; } return this._labels[timeOrLabel] + offsetOrLabel; } offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); - timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration(); + timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration; } else if (timeOrLabel == null) { - timeOrLabel = this.duration(); + timeOrLabel = clippedDuration; } return Number(timeOrLabel) + offsetOrLabel; }; @@ -16430,7 +17545,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa p.constructor = TimelineMax; p.kill()._gc = false; - TimelineMax.version = "1.19.1"; + TimelineMax.version = "1.20.2"; p.invalidate = function() { this._yoyo = (this.vars.yoyo === true); @@ -16599,7 +17714,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } } - if (this._hasPause && !this._forcingPlayhead && !suppressEvents && time < dur) { + if (this._hasPause && !this._forcingPlayhead && !suppressEvents) { time = this._time; if (time >= prevTime || (this._repeat && prevCycle !== this._cycle)) { tween = this._first; @@ -16618,7 +17733,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa tween = tween._prev; } } - if (pauseTween) { + if (pauseTween && pauseTween._startTime < dur) { this._time = time = pauseTween._startTime; this._totalTime = time + (this._cycle * (this._totalDuration + this._repeatDelay)); } @@ -16841,11 +17956,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa //---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- p.progress = function(value, suppressEvents) { - return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); + return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); }; p.totalProgress = function(value, suppressEvents) { - return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents); + return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents); }; p.totalDuration = function(value) { @@ -17045,7 +18160,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } l = values.length - 2; if (l < 0) { - a[0] = new Segment(values[0][p], 0, 0, values[(l < -1) ? 0 : 1][p]); + a[0] = new Segment(values[0][p], 0, 0, values[0][p]); return a; } for (i = 0; i < l; i++) { @@ -17231,7 +18346,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa BezierPlugin = _gsScope._gsDefine.plugin({ propName: "bezier", priority: -1, - version: "1.3.7", + version: "1.3.8", API: 2, global:true, @@ -17557,7 +18672,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa p = CSSPlugin.prototype = new TweenPlugin("css"); p.constructor = CSSPlugin; - CSSPlugin.version = "1.19.1"; + CSSPlugin.version = "1.20.0"; CSSPlugin.API = 2; CSSPlugin.defaultTransformPerspective = 0; CSSPlugin.defaultSkewType = "compensated"; @@ -17690,7 +18805,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa * @return {number} value in pixels */ _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) { - if (sfx === "px" || !sfx) { return v; } + if (sfx === "px" || (!sfx && p !== "lineHeight")) { return v; } if (sfx === "auto" || !v) { return 0; } var horiz = _horizExp.test(p), node = t, @@ -17704,12 +18819,20 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa if (precise) { v *= 100; } - if (sfx === "%" && p.indexOf("border") !== -1) { + if (p === "lineHeight" && !sfx) { //special case of when a simple lineHeight (without a unit) is used. Set it to the value, read back the computed value, and then revert. + cache = _getComputedStyle(t).lineHeight; + t.style.lineHeight = v; + pix = parseFloat(_getComputedStyle(t).lineHeight); + t.style.lineHeight = cache; + } else if (sfx === "%" && p.indexOf("border") !== -1) { pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight); } else { style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;"; if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") { node = t.parentNode || _doc.body; + if (_getStyle(node, "display").indexOf("flex") !== -1) { //Edge and IE11 have a bug that causes offsetWidth to report as 0 if the container has display:flex and the child is position:relative. Switching to position: absolute solves it. + style.position = "absolute"; + } cache = node._gsCache; time = TweenLite.ticker.frame; if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick) @@ -18058,8 +19181,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa _formatColors = function(s, toHSL) { var colors = s.match(_colorExp) || [], charIndex = 0, - parsed = colors.length ? "" : s, + parsed = "", i, color, temp; + if (!colors.length) { + return s; + } for (i = 0; i < colors.length; i++) { color = colors[i]; temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex); @@ -18080,7 +19206,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa _colorExp = new RegExp(_colorExp+")", "gi"); CSSPlugin.colorStringFilter = function(a) { - var combined = a[0] + a[1], + var combined = a[0] + " " + a[1], toHSL; if (_colorExp.test(combined)) { toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1); @@ -18420,6 +19546,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa str = ev.indexOf(")") + 1; str = ")" + (str ? ev.substr(str) : ""); //if there's a comma or ) at the end, retain it. useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity); + temp = ev; //original string value so we can look for any prefix later. bv = _parseColor(bv, useHSL); ev = _parseColor(ev, useHSL); hasAlpha = (bv.length + ev.length > 6); @@ -18431,11 +19558,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa hasAlpha = false; } if (useHSL) { - pt.appendXtra((hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) + pt.appendXtra(temp.substr(0, temp.indexOf("hsl")) + (hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false) .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false); } else { - pt.appendXtra((hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true) + pt.appendXtra(temp.substr(0, temp.indexOf("rgb")) + (hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true) .appendXtra("", bv[1], ev[1] - bv[1], ",", true) .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), true); } @@ -18853,8 +19980,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : ""; } isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); - if (isDefault && _transformProp && ((none = (_getComputedStyle(e).display === "none")) || !e.parentNode)) { - if (none) { //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". + if (_transformProp && ((none = (_getComputedStyle(e).display === "none")) || !e.parentNode)) { + if (none) { //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px). n = style.display; style.display = "block"; } @@ -18939,7 +20066,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa a43 = m[11], angle = Math.atan2(a32, a33), t1, t2, t3, t4, cos, sin; - //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari if (tm.zOrigin) { a34 = -tm.zOrigin; @@ -18947,6 +20073,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa a24 = a23*a34-m[13]; a34 = a33*a34+tm.zOrigin-m[14]; } + //note for possible future consolidation: rotationX: Math.atan2(a32, a33), rotationY: Math.atan2(-a31, Math.sqrt(a33 * a33 + a32 * a32)), rotation: Math.atan2(a21, a11), skew: Math.atan2(a12, a22). However, it doesn't seem to be quite as reliable as the full-on backwards rotation procedure. tm.rotationX = angle * _RAD2DEG; //rotationX if (angle) { @@ -18983,13 +20110,17 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa angle = Math.atan2(a21, a11); tm.rotation = angle * _RAD2DEG; if (angle) { - cos = Math.cos(-angle); - sin = Math.sin(-angle); - a11 = a11*cos+a12*sin; - t2 = a21*cos+a22*sin; - a22 = a21*-sin+a22*cos; - a32 = a31*-sin+a32*cos; - a21 = t2; + cos = Math.cos(angle); + sin = Math.sin(angle); + t1 = a11*cos+a21*sin; + t2 = a12*cos+a22*sin; + t3 = a13*cos+a23*sin; + a21 = a21*cos-a11*sin; + a22 = a22*cos-a12*sin; + a23 = a23*cos-a13*sin; + a11 = t1; + a12 = t2; + a13 = t3; } if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here. @@ -18997,24 +20128,46 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa tm.rotationY = 180 - tm.rotationY; } - tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd; - tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd; - tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd; - if (tm.rotationX || tm.rotationY) { - tm.skewX = 0; - } else { - tm.skewX = (a12 || a22) ? Math.atan2(a12, a22) * _RAD2DEG + tm.rotation : tm.skewX || 0; - if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) { - if (invX) { - tm.scaleX *= -1; - tm.skewX += (tm.rotation <= 0) ? 180 : -180; - tm.rotation += (tm.rotation <= 0) ? 180 : -180; - } else { - tm.scaleY *= -1; - tm.skewX += (tm.skewX <= 0) ? 180 : -180; - } + //skewX + angle = Math.atan2(a12, a22); + + //scales + tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21 + a31 * a31) * rnd + 0.5) | 0) / rnd; + tm.scaleY = ((Math.sqrt(a22 * a22 + a32 * a32) * rnd + 0.5) | 0) / rnd; + tm.scaleZ = ((Math.sqrt(a13 * a13 + a23 * a23 + a33 * a33) * rnd + 0.5) | 0) / rnd; + a11 /= tm.scaleX; + a12 /= tm.scaleY; + a21 /= tm.scaleX; + a22 /= tm.scaleY; + if (Math.abs(angle) > min) { + tm.skewX = angle * _RAD2DEG; + a12 = 0; //unskews + if (tm.skewType !== "simple") { + tm.scaleY *= 1 / Math.cos(angle); //by default, we compensate the scale based on the skew so that the element maintains a similar proportion when skewed, so we have to alter the scaleY here accordingly to match the default (non-adjusted) skewing that CSS does (stretching more and more as it skews). } + + } else { + tm.skewX = 0; } + + /* //for testing purposes + var transform = "matrix3d(", + comma = ",", + zero = "0"; + a13 /= tm.scaleZ; + a23 /= tm.scaleZ; + a31 /= tm.scaleX; + a32 /= tm.scaleY; + a33 /= tm.scaleZ; + transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); + transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); + transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); + transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; + transform += a14 + comma + a24 + comma + a34 + comma + (tm.perspective ? (1 + (-a34 / tm.perspective)) : 1) + ")"; + console.log(transform); + document.querySelector(".test").style[_transformProp] = transform; + */ + tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0; tm.x = a14; tm.y = a24; @@ -19036,16 +20189,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa scaleY = Math.sqrt(d * d + c * c); rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist). skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0; - if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) { - if (invX) { - scaleX *= -1; - skewX += (rotation <= 0) ? 180 : -180; - rotation += (rotation <= 0) ? 180 : -180; - } else { - scaleY *= -1; - skewX += (skewX <= 0) ? 180 : -180; - } - } tm.scaleX = scaleX; tm.scaleY = scaleY; tm.rotation = rotation; @@ -19060,6 +20203,16 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d); } } + if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) { + if (invX) { + tm.scaleX *= -1; + tm.skewX += (tm.rotation <= 0) ? 180 : -180; + tm.rotation += (tm.rotation <= 0) ? 180 : -180; + } else { + tm.scaleY *= -1; + tm.skewX += (tm.skewX <= 0) ? 180 : -180; + } + } tm.zOrigin = zOrigin; //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate. for (i in tm) { @@ -19293,7 +20446,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa a11 = a22 = 1; a12 = a21 = 0; } - // KEY INDEX AFFECTS + // KEY INDEX AFFECTS a[row][column] // a11 0 rotation, rotationY, scaleX // a21 1 rotation, rotationY, scaleX // a31 2 rotationY, scaleX @@ -19429,6 +20582,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa m1 = _getTransform(t, _cs, true, v.parseTransform), orig = v.transform && ((typeof(v.transform) === "function") ? v.transform(_index, _target) : v.transform), m2, copy, has3D, hasChange, dr, x, y, matrix, p; + m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; cssp._transform = m1; if (orig && typeof(orig) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)" copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly. @@ -19437,6 +20591,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa copy.position = "absolute"; _doc.body.appendChild(_tempDiv); m2 = _getTransform(_tempDiv, null, false); + if (m1.skewType === "simple") { //the default _getTransform() reports the skewX/scaleY as if skewType is "compensated", thus we need to adjust that here if skewType is "simple". + m2.scaleY *= Math.cos(m2.skewX * _DEG2RAD); + } if (m1.svg) { //if it's an SVG element, x/y part of the matrix will be affected by whatever we use as the origin and the offsets, so compensate here... x = m1.xOrigin; y = m1.yOrigin; @@ -19508,8 +20665,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa hasChange = true; } - m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; - has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective); if (!has3D && v.scale != null) { m2.scaleZ = 1; //no need to tween scaleZ. @@ -20017,7 +21172,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa sp = _specialProps[p]; //SpecialProp lookup. if (sp) { pt = sp.parse(target, es, p, this, pt, plugin, vars); - + } else if (p.substr(0,2) === "--") { //for tweening CSS variables (which always start with "--"). To maximize performance and simplicity, we bypass CSSPlugin altogether and just add a normal property tween to the tween instance itself. + this._tween._propLookup[p] = this._addTween.call(this._tween, target.style, "setProperty", _getComputedStyle(target).getPropertyValue(p) + "", es + "", p, false, p); + continue; } else { bs = _getStyle(target, p, _cs) + ""; isStr = (typeof(es) === "string"); @@ -20064,9 +21221,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix. - //if the beginning/ending suffixes don't match, normalize them... - if (bsfx !== esfx) if (esfx !== "") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! + if (bsfx !== esfx) if (esfx !== "" || p === "lineHeight") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! bn = _convertToPixels(target, p, bn, bsfx); if (esfx === "%") { bn /= _convertToPixels(target, p, 100, "%") / 100; @@ -20488,7 +21644,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa _gsScope._gsDefine.plugin({ propName: "attr", API: 2, - version: "0.6.0", + version: "0.6.1", //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. init: function(target, value, tween, index) { @@ -20527,7 +21683,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa */ _gsScope._gsDefine.plugin({ propName: "directionalRotation", - version: "0.3.0", + version: "0.3.1", API: 2, //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. @@ -20706,10 +21862,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa //SteppedEase - SteppedEase = _class("easing.SteppedEase", function(steps) { + SteppedEase = _class("easing.SteppedEase", function(steps, immediateStart) { steps = steps || 1; this._p1 = 1 / steps; - this._p2 = steps + 1; + this._p2 = steps + (immediateStart ? 0 : 1); + this._p3 = immediateStart ? 1 : 0; }, true); p = SteppedEase.prototype = new Ease(); p.constructor = SteppedEase; @@ -20719,10 +21876,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa } else if (p >= 1) { p = 0.999999999; } - return ((this._p2 * p) >> 0) * this._p1; + return (((this._p2 * p) | 0) + this._p3) * this._p1; }; - p.config = SteppedEase.config = function(steps) { - return new SteppedEase(steps); + p.config = SteppedEase.config = function(steps, immediateStart) { + return new SteppedEase(steps, immediateStart); }; @@ -21035,7 +22192,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween this.check = function(init) { var i = dependencies.length, missing = i, - cur, a, n, cl, hasModule; + cur, a, n, cl; while (--i > -1) { if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) { _classes[i] = cur.gsClass; @@ -21052,11 +22209,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween //exports to multiple environments if (global) { _globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.) - hasModule = (typeof(module) !== "undefined" && module.exports); - if (!hasModule && "function" === "function" && __webpack_require__(604)){ //AMD - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return cl; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (hasModule){ //node + if (typeof(module) !== "undefined" && module.exports) { //node if (ns === moduleName) { module.exports = _exports[moduleName] = cl; for (i in _exports) { @@ -21065,6 +22218,9 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween } else if (_exports[moduleName]) { _exports[moduleName][n] = cl; } + } else if (true){ //AMD + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return cl; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } } for (i = 0; i < this.sc.length; i++) { @@ -21097,7 +22253,6 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween * ---------------------------------------------------------------- */ var _baseParams = [0, 0, 1, 1], - _blankArray = [], Ease = _class("easing.Ease", function(func, extraParams, type, power) { this._func = func; this._type = type || 0; @@ -21388,10 +22543,14 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. var _checkTimeout = function() { - if (_tickerActive && _getTime() - _lastUpdate > 2000) { + if (_tickerActive && _getTime() - _lastUpdate > 2000 && _doc.visibilityState !== "hidden") { _ticker.wake(); } - setTimeout(_checkTimeout, 2000); + var t = setTimeout(_checkTimeout, 2000); + if (t.unref) { + // allows a node process to exit even if the timeout’s callback hasn't been invoked. Without it, the node process could hang as this function is called every two seconds. + t.unref(); + } }; _checkTimeout(); @@ -21450,7 +22609,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active. startTime = this._startTime, rawTime; - return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale)); + return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale - 0.0000001)); }; p._enabled = function (enabled, ignoreTimeline) { @@ -21792,7 +22951,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween this._totalTime = this._time = this._rawPrevTime = time; while (tween) { next = tween._next; //record it here because the value could change after rendering... - if (tween._active || (time >= tween._startTime && !tween._paused)) { + if (tween._active || (time >= tween._startTime && !tween._paused && !tween._gc)) { if (!tween._reversed) { tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); } else { @@ -21894,7 +23053,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; p._notifyPluginsOfEnabled = p._lazy = false; - TweenLite.version = "1.19.1"; + TweenLite.version = "1.20.2"; TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); TweenLite.defaultOverwrite = "auto"; TweenLite.ticker = _ticker; @@ -21915,13 +23074,14 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween var _lazyTweens = [], _lazyLookup = {}, _numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig, + _relExp = /[\+-]=-?[\.\d]/, //_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig, _setRatio = function(v) { var pt = this._firstPT, min = 0.000001, val; while (pt) { - val = !pt.blob ? pt.c * v + pt.s : (v === 1) ? this.end : v ? this.join("") : this.start; + val = !pt.blob ? pt.c * v + pt.s : (v === 1 && this.end) ? this.end : v ? this.join("") : this.start; if (pt.m) { val = pt.m(val, this._target || pt.t); } else if (val < min) if (val > -min && !pt.blob) { //prevents issues with converting very small numbers to strings in the browser @@ -21991,6 +23151,9 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween a.push(s); } a.setRatio = _setRatio; + if (_relExp.test(end)) { //if the end string contains relative values, delete it so that on the final render (in _setRatio()), we don't actually set it to the string with += or -= characters (forces it to use the calculated value). + a.end = 0; + } return a; }, //note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example. @@ -22009,7 +23172,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween if (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === "boolean" || typeof(end) === "boolean") { //a blob (string that has multiple numbers in it) pt.fp = funcParam; - blob = _blobDif(s, (isRelative ? pt.s + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt); + blob = _blobDif(s, (isRelative ? parseFloat(pt.s) + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt); pt = {t: blob, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example. } else { pt.s = parseFloat(s); @@ -22030,7 +23193,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween _plugins = TweenLite._plugins = {}, _tweenLookup = _internals.tweenLookup = {}, _tweenLookupNum = 0, - _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1}, + _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1, yoyoEase:1}, _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0}, _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(), _rootTimeline = Animation._rootTimeline = new SimpleTimeline(), @@ -22215,6 +23378,8 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween startVars.immediateRender = true; startVars.lazy = (immediate && v.lazy !== false); startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop). + startVars.onUpdate = v.onUpdate; + startVars.onUpdateScope = v.onUpdateScope || v.callbackScope || this; this._startAt = TweenLite.to(this.target, 0, startVars); if (immediate) { if (this._time > 0) { @@ -22398,7 +23563,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. } } - if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. + if (!this._initted || (this._startAt && this._startAt.progress())) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. Also, we check progress() because if startAt has already rendered at its end, we should force a render at its beginning. Otherwise, if you put the playhead directly on top of where a fromTo({immediateRender:false}) starts, and then move it backwards, the from() won't revert its values. force = true; } } else { @@ -22689,7 +23854,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween } } } - } else { + } else if (target._gsTweenID) { a = _register(target).concat(); i = a.length; while (--i > -1) { @@ -22698,7 +23863,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween } } } - return a; + return a || []; }; TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) { @@ -22868,13 +24033,13 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated })((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenMax"); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(29))) /***/ }), -/* 140 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { -var root = __webpack_require__(8); +var root = __webpack_require__(9); /** Built-in value references. */ var Uint8Array = root.Uint8Array; @@ -22883,11 +24048,11 @@ module.exports = Uint8Array; /***/ }), -/* 141 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(33), - root = __webpack_require__(8); + root = __webpack_require__(9); /* Built-in method references that are verified to be native. */ var WeakMap = getNative(root, 'WeakMap'); @@ -22896,7 +24061,7 @@ module.exports = WeakMap; /***/ }), -/* 142 */ +/* 143 */ /***/ (function(module, exports) { /** @@ -22925,15 +24090,15 @@ module.exports = arrayEvery; /***/ }), -/* 143 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { -var baseTimes = __webpack_require__(165), - isArguments = __webpack_require__(77), - isArray = __webpack_require__(1), - isBuffer = __webpack_require__(49), - isIndex = __webpack_require__(44), - isTypedArray = __webpack_require__(78); +var baseTimes = __webpack_require__(166), + isArguments = __webpack_require__(76), + isArray = __webpack_require__(2), + isBuffer = __webpack_require__(51), + isIndex = __webpack_require__(45), + isTypedArray = __webpack_require__(77); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -22980,7 +24145,7 @@ module.exports = arrayLikeKeys; /***/ }), -/* 144 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { var baseRandom = __webpack_require__(102); @@ -23001,11 +24166,11 @@ module.exports = arraySample; /***/ }), -/* 145 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(22), - eq = __webpack_require__(45); + eq = __webpack_require__(46); /** * This function is like `assignValue` except that it doesn't assign @@ -23027,11 +24192,11 @@ module.exports = assignMergeValue; /***/ }), -/* 146 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { -var copyObject = __webpack_require__(19), - keys = __webpack_require__(9); +var copyObject = __webpack_require__(18), + keys = __webpack_require__(10); /** * The base implementation of `_.assign` without support for multiple sources @@ -23050,7 +24215,7 @@ module.exports = baseAssign; /***/ }), -/* 147 */ +/* 148 */ /***/ (function(module, exports) { /** Error message constants. */ @@ -23077,11 +24242,11 @@ module.exports = baseDelay; /***/ }), -/* 148 */ +/* 149 */ /***/ (function(module, exports, __webpack_require__) { var baseForOwnRight = __webpack_require__(98), - createBaseEach = __webpack_require__(173); + createBaseEach = __webpack_require__(174); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. @@ -23097,10 +24262,10 @@ module.exports = baseEachRight; /***/ }), -/* 149 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { -var baseEach = __webpack_require__(25); +var baseEach = __webpack_require__(24); /** * The base implementation of `_.filter` without support for iteratee shorthands. @@ -23124,7 +24289,7 @@ module.exports = baseFilter; /***/ }), -/* 150 */ +/* 151 */ /***/ (function(module, exports) { /** @@ -23153,10 +24318,10 @@ module.exports = baseFindKey; /***/ }), -/* 151 */ +/* 152 */ /***/ (function(module, exports, __webpack_require__) { -var createBaseFor = __webpack_require__(174); +var createBaseFor = __webpack_require__(175); /** * This function is like `baseFor` except that it iterates over properties @@ -23174,11 +24339,11 @@ module.exports = baseForRight; /***/ }), -/* 152 */ +/* 153 */ /***/ (function(module, exports, __webpack_require__) { -var arrayPush = __webpack_require__(47), - isArray = __webpack_require__(1); +var arrayPush = __webpack_require__(49), + isArray = __webpack_require__(2); /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses @@ -23200,7 +24365,7 @@ module.exports = baseGetAllKeys; /***/ }), -/* 153 */ +/* 154 */ /***/ (function(module, exports, __webpack_require__) { var baseFindIndex = __webpack_require__(96), @@ -23226,11 +24391,11 @@ module.exports = baseIndexOf; /***/ }), -/* 154 */ +/* 155 */ /***/ (function(module, exports, __webpack_require__) { var baseIsEqualDeep = __webpack_require__(307), - isObjectLike = __webpack_require__(21); + isObjectLike = __webpack_require__(20); /** * The base implementation of `_.isEqual` which supports partial comparisons @@ -23260,10 +24425,10 @@ module.exports = baseIsEqual; /***/ }), -/* 155 */ +/* 156 */ /***/ (function(module, exports, __webpack_require__) { -var isPrototype = __webpack_require__(74), +var isPrototype = __webpack_require__(73), nativeKeys = __webpack_require__(376); /** Used for built-in method references. */ @@ -23296,10 +24461,10 @@ module.exports = baseKeys; /***/ }), -/* 156 */ +/* 157 */ /***/ (function(module, exports, __webpack_require__) { -var baseEach = __webpack_require__(25), +var baseEach = __webpack_require__(24), isArrayLike = __webpack_require__(16); /** @@ -23324,12 +24489,12 @@ module.exports = baseMap; /***/ }), -/* 157 */ +/* 158 */ /***/ (function(module, exports, __webpack_require__) { var baseIsMatch = __webpack_require__(308), getMatchData = __webpack_require__(348), - matchesStrictComparable = __webpack_require__(192); + matchesStrictComparable = __webpack_require__(193); /** * The base implementation of `_.matches` which doesn't clone `source`. @@ -23352,16 +24517,16 @@ module.exports = baseMatches; /***/ }), -/* 158 */ +/* 159 */ /***/ (function(module, exports, __webpack_require__) { -var baseIsEqual = __webpack_require__(154), +var baseIsEqual = __webpack_require__(155), get = __webpack_require__(113), hasIn = __webpack_require__(114), isKey = __webpack_require__(108), - isStrictComparable = __webpack_require__(191), - matchesStrictComparable = __webpack_require__(192), - toKey = __webpack_require__(20); + isStrictComparable = __webpack_require__(192), + matchesStrictComparable = __webpack_require__(193), + toKey = __webpack_require__(19); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, @@ -23391,16 +24556,16 @@ module.exports = baseMatchesProperty; /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(12), - baseIteratee = __webpack_require__(3), - baseMap = __webpack_require__(156), + baseIteratee = __webpack_require__(4), + baseMap = __webpack_require__(157), baseSortBy = __webpack_require__(323), - baseUnary = __webpack_require__(68), + baseUnary = __webpack_require__(67), compareMultiple = __webpack_require__(335), - identity = __webpack_require__(29); + identity = __webpack_require__(28); /** * The base implementation of `_.orderBy` without param guards. @@ -23431,12 +24596,12 @@ module.exports = baseOrderBy; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { -var baseGet = __webpack_require__(41), - baseSet = __webpack_require__(67), - castPath = __webpack_require__(27); +var baseGet = __webpack_require__(42), + baseSet = __webpack_require__(66), + castPath = __webpack_require__(26); /** * The base implementation of `_.pickBy` without support for iteratee shorthands. @@ -23467,7 +24632,7 @@ module.exports = basePickBy; /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports) { /** @@ -23487,7 +24652,7 @@ module.exports = baseProperty; /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports) { /** @@ -23516,11 +24681,11 @@ module.exports = baseReduce; /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { -var identity = __webpack_require__(29), - metaMap = __webpack_require__(193); +var identity = __webpack_require__(28), + metaMap = __webpack_require__(194); /** * The base implementation of `setData` without support for hot loop shorting. @@ -23539,7 +24704,7 @@ module.exports = baseSetData; /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports) { /** @@ -23576,7 +24741,7 @@ module.exports = baseSlice; /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports) { /** @@ -23602,13 +24767,13 @@ module.exports = baseTimes; /***/ }), -/* 166 */ +/* 167 */ /***/ (function(module, exports, __webpack_require__) { -var castPath = __webpack_require__(27), - last = __webpack_require__(212), - parent = __webpack_require__(196), - toKey = __webpack_require__(20); +var castPath = __webpack_require__(26), + last = __webpack_require__(213), + parent = __webpack_require__(197), + toKey = __webpack_require__(19); /** * The base implementation of `_.unset`. @@ -23628,11 +24793,11 @@ module.exports = baseUnset; /***/ }), -/* 167 */ +/* 168 */ /***/ (function(module, exports, __webpack_require__) { -var baseGet = __webpack_require__(41), - baseSet = __webpack_require__(67); +var baseGet = __webpack_require__(42), + baseSet = __webpack_require__(66); /** * The base implementation of `_.update`. @@ -23652,7 +24817,7 @@ module.exports = baseUpdate; /***/ }), -/* 168 */ +/* 169 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(12); @@ -23677,10 +24842,10 @@ module.exports = baseValues; /***/ }), -/* 169 */ +/* 170 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(8); +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(9); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; @@ -23716,10 +24881,10 @@ function cloneBuffer(buffer, isDeep) { module.exports = cloneBuffer; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(85)(module))) /***/ }), -/* 170 */ +/* 171 */ /***/ (function(module, exports, __webpack_require__) { var cloneArrayBuffer = __webpack_require__(103); @@ -23741,7 +24906,7 @@ module.exports = cloneTypedArray; /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, exports) { /* Built-in method references for those with the same name as other `lodash` methods. */ @@ -23786,7 +24951,7 @@ module.exports = composeArgs; /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, exports) { /* Built-in method references for those with the same name as other `lodash` methods. */ @@ -23833,7 +24998,7 @@ module.exports = composeArgsRight; /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { var isArrayLike = __webpack_require__(16); @@ -23871,7 +25036,7 @@ module.exports = createBaseEach; /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, exports) { /** @@ -23902,12 +25067,12 @@ module.exports = createBaseFor; /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { -var baseIteratee = __webpack_require__(3), +var baseIteratee = __webpack_require__(4), isArrayLike = __webpack_require__(16), - keys = __webpack_require__(9); + keys = __webpack_require__(10); /** * Creates a `_.find` or `_.findLast` function. @@ -23933,15 +25098,15 @@ module.exports = createFind; /***/ }), -/* 176 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { var LodashWrapper = __webpack_require__(90), flatRest = __webpack_require__(32), getData = __webpack_require__(106), - getFuncName = __webpack_require__(186), - isArray = __webpack_require__(1), - isLaziable = __webpack_require__(190); + getFuncName = __webpack_require__(187), + isArray = __webpack_require__(2), + isLaziable = __webpack_require__(191); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -24017,18 +25182,18 @@ module.exports = createFlow; /***/ }), -/* 177 */ +/* 178 */ /***/ (function(module, exports, __webpack_require__) { -var composeArgs = __webpack_require__(171), - composeArgsRight = __webpack_require__(172), +var composeArgs = __webpack_require__(172), + composeArgsRight = __webpack_require__(173), countHolders = __webpack_require__(339), - createCtor = __webpack_require__(70), - createRecurry = __webpack_require__(180), - getHolder = __webpack_require__(43), + createCtor = __webpack_require__(69), + createRecurry = __webpack_require__(181), + getHolder = __webpack_require__(44), reorder = __webpack_require__(381), replaceHolders = __webpack_require__(35), - root = __webpack_require__(8); + root = __webpack_require__(9); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, @@ -24115,7 +25280,7 @@ module.exports = createHybrid; /***/ }), -/* 178 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { var baseInverter = __webpack_require__(305); @@ -24138,12 +25303,12 @@ module.exports = createInverter; /***/ }), -/* 179 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { var baseRange = __webpack_require__(317), isIterateeCall = __webpack_require__(34), - toFinite = __webpack_require__(80); + toFinite = __webpack_require__(79); /** * Creates a `_.range` or `_.rangeRight` function. @@ -24174,12 +25339,12 @@ module.exports = createRange; /***/ }), -/* 180 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { -var isLaziable = __webpack_require__(190), - setData = __webpack_require__(197), - setWrapToString = __webpack_require__(199); +var isLaziable = __webpack_require__(191), + setData = __webpack_require__(198), + setWrapToString = __webpack_require__(200); /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, @@ -24236,11 +25401,11 @@ module.exports = createRecurry; /***/ }), -/* 181 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { var baseToPairs = __webpack_require__(324), - getTag = __webpack_require__(73), + getTag = __webpack_require__(72), mapToArray = __webpack_require__(109), setToPairs = __webpack_require__(384); @@ -24272,7 +25437,7 @@ module.exports = createToPairs; /***/ }), -/* 182 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(33); @@ -24289,7 +25454,7 @@ module.exports = defineProperty; /***/ }), -/* 183 */ +/* 184 */ /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__(286), @@ -24378,7 +25543,7 @@ module.exports = equalArrays; /***/ }), -/* 184 */ +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ @@ -24386,15 +25551,15 @@ var freeGlobal = typeof global == 'object' && global && global.Object === Object module.exports = freeGlobal; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(29))) /***/ }), -/* 185 */ +/* 186 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetAllKeys = __webpack_require__(152), +var baseGetAllKeys = __webpack_require__(153), getSymbols = __webpack_require__(107), - keys = __webpack_require__(9); + keys = __webpack_require__(10); /** * Creates an array of own enumerable property names and symbols of `object`. @@ -24411,7 +25576,7 @@ module.exports = getAllKeys; /***/ }), -/* 186 */ +/* 187 */ /***/ (function(module, exports, __webpack_require__) { var realNames = __webpack_require__(380); @@ -24448,11 +25613,11 @@ module.exports = getFuncName; /***/ }), -/* 187 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { -var arrayPush = __webpack_require__(47), - getPrototype = __webpack_require__(72), +var arrayPush = __webpack_require__(49), + getPrototype = __webpack_require__(71), getSymbols = __webpack_require__(107), stubArray = __webpack_require__(119); @@ -24479,15 +25644,15 @@ module.exports = getSymbolsIn; /***/ }), -/* 188 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { -var castPath = __webpack_require__(27), - isArguments = __webpack_require__(77), - isArray = __webpack_require__(1), - isIndex = __webpack_require__(44), +var castPath = __webpack_require__(26), + isArguments = __webpack_require__(76), + isArray = __webpack_require__(2), + isIndex = __webpack_require__(45), isLength = __webpack_require__(115), - toKey = __webpack_require__(20); + toKey = __webpack_require__(19); /** * Checks if `path` exists on `object`. @@ -24524,12 +25689,12 @@ module.exports = hasPath; /***/ }), -/* 189 */ +/* 190 */ /***/ (function(module, exports, __webpack_require__) { -var baseCreate = __webpack_require__(39), - getPrototype = __webpack_require__(72), - isPrototype = __webpack_require__(74); +var baseCreate = __webpack_require__(40), + getPrototype = __webpack_require__(71), + isPrototype = __webpack_require__(73); /** * Initializes an object clone. @@ -24548,12 +25713,12 @@ module.exports = initCloneObject; /***/ }), -/* 190 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { var LazyWrapper = __webpack_require__(89), getData = __webpack_require__(106), - getFuncName = __webpack_require__(186), + getFuncName = __webpack_require__(187), lodash = __webpack_require__(510); /** @@ -24582,10 +25747,10 @@ module.exports = isLaziable; /***/ }), -/* 191 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(6); +var isObject = __webpack_require__(7); /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. @@ -24603,7 +25768,7 @@ module.exports = isStrictComparable; /***/ }), -/* 192 */ +/* 193 */ /***/ (function(module, exports) { /** @@ -24629,10 +25794,10 @@ module.exports = matchesStrictComparable; /***/ }), -/* 193 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { -var WeakMap = __webpack_require__(141); +var WeakMap = __webpack_require__(142); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; @@ -24641,7 +25806,7 @@ module.exports = metaMap; /***/ }), -/* 194 */ +/* 195 */ /***/ (function(module, exports) { /** @@ -24662,7 +25827,7 @@ module.exports = overArg; /***/ }), -/* 195 */ +/* 196 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(11); @@ -24704,11 +25869,11 @@ module.exports = overRest; /***/ }), -/* 196 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { -var baseGet = __webpack_require__(41), - baseSlice = __webpack_require__(164); +var baseGet = __webpack_require__(42), + baseSlice = __webpack_require__(165); /** * Gets the parent value at `path` of `object`. @@ -24726,11 +25891,11 @@ module.exports = parent; /***/ }), -/* 197 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { -var baseSetData = __webpack_require__(163), - shortOut = __webpack_require__(200); +var baseSetData = __webpack_require__(164), + shortOut = __webpack_require__(201); /** * Sets metadata for `func`. @@ -24752,7 +25917,7 @@ module.exports = setData; /***/ }), -/* 198 */ +/* 199 */ /***/ (function(module, exports) { /** @@ -24776,7 +25941,7 @@ module.exports = setToArray; /***/ }), -/* 199 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { var getWrapDetails = __webpack_require__(351), @@ -24803,7 +25968,7 @@ module.exports = setWrapToString; /***/ }), -/* 200 */ +/* 201 */ /***/ (function(module, exports) { /** Used to detect hot functions by number of calls within a span of milliseconds. */ @@ -24846,7 +26011,7 @@ module.exports = shortOut; /***/ }), -/* 201 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(374); @@ -24880,7 +26045,7 @@ module.exports = stringToPath; /***/ }), -/* 202 */ +/* 203 */ /***/ (function(module, exports) { /** Used for built-in method references. */ @@ -24912,7 +26077,7 @@ module.exports = toSource; /***/ }), -/* 203 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { var createWrap = __webpack_require__(23); @@ -24947,11 +26112,11 @@ module.exports = ary; /***/ }), -/* 204 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { -var copyObject = __webpack_require__(19), - createAssigner = __webpack_require__(42), +var copyObject = __webpack_require__(18), + createAssigner = __webpack_require__(43), keysIn = __webpack_require__(13); /** @@ -24993,7 +26158,7 @@ module.exports = assignIn; /***/ }), -/* 205 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(14); @@ -25039,12 +26204,12 @@ module.exports = before; /***/ }), -/* 206 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { -var baseRest = __webpack_require__(4), +var baseRest = __webpack_require__(5), createWrap = __webpack_require__(23), - getHolder = __webpack_require__(43), + getHolder = __webpack_require__(44), replaceHolders = __webpack_require__(35); /** Used to compose bitmasks for function metadata. */ @@ -25102,7 +26267,7 @@ module.exports = bind; /***/ }), -/* 207 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { module.exports = { @@ -25116,13 +26281,13 @@ module.exports = { 'flatMap': __webpack_require__(428), 'flatMapDeep': __webpack_require__(429), 'flatMapDepth': __webpack_require__(430), - 'forEach': __webpack_require__(209), - 'forEachRight': __webpack_require__(210), + 'forEach': __webpack_require__(210), + 'forEachRight': __webpack_require__(211), 'groupBy': __webpack_require__(442), 'includes': __webpack_require__(445), 'invokeMap': __webpack_require__(449), 'keyBy': __webpack_require__(453), - 'map': __webpack_require__(79), + 'map': __webpack_require__(78), 'orderBy': __webpack_require__(468), 'partition': __webpack_require__(474), 'reduce': __webpack_require__(481), @@ -25138,12 +26303,12 @@ module.exports = { /***/ }), -/* 208 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(6), +var isObject = __webpack_require__(7), now = __webpack_require__(462), - toNumber = __webpack_require__(50); + toNumber = __webpack_require__(52); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -25332,13 +26497,13 @@ module.exports = debounce; /***/ }), -/* 209 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { -var arrayEach = __webpack_require__(38), - baseEach = __webpack_require__(25), - castFunction = __webpack_require__(18), - isArray = __webpack_require__(1); +var arrayEach = __webpack_require__(39), + baseEach = __webpack_require__(24), + castFunction = __webpack_require__(17), + isArray = __webpack_require__(2); /** * Iterates over elements of `collection` and invokes `iteratee` for each element. @@ -25379,13 +26544,13 @@ module.exports = forEach; /***/ }), -/* 210 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { var arrayEachRight = __webpack_require__(290), - baseEachRight = __webpack_require__(148), - castFunction = __webpack_require__(18), - isArray = __webpack_require__(1); + baseEachRight = __webpack_require__(149), + castFunction = __webpack_require__(17), + isArray = __webpack_require__(2); /** * This method is like `_.forEach` except that it iterates over elements of @@ -25416,12 +26581,12 @@ module.exports = forEachRight; /***/ }), -/* 211 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetTag = __webpack_require__(26), - isArray = __webpack_require__(1), - isObjectLike = __webpack_require__(21); +var baseGetTag = __webpack_require__(25), + isArray = __webpack_require__(2), + isObjectLike = __webpack_require__(20); /** `Object#toString` result references. */ var stringTag = '[object String]'; @@ -25452,7 +26617,7 @@ module.exports = isString; /***/ }), -/* 212 */ +/* 213 */ /***/ (function(module, exports) { /** @@ -25478,7 +26643,7 @@ module.exports = last; /***/ }), -/* 213 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(92); @@ -25557,11 +26722,11 @@ module.exports = memoize; /***/ }), -/* 214 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { var baseMerge = __webpack_require__(101), - createAssigner = __webpack_require__(42); + createAssigner = __webpack_require__(43); /** * This method is like `_.merge` except that it accepts `customizer` which @@ -25602,7 +26767,7 @@ module.exports = mergeWith; /***/ }), -/* 215 */ +/* 216 */ /***/ (function(module, exports) { /** @@ -25625,12 +26790,12 @@ module.exports = noop; /***/ }), -/* 216 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { -var baseRest = __webpack_require__(4), +var baseRest = __webpack_require__(5), createWrap = __webpack_require__(23), - getHolder = __webpack_require__(43), + getHolder = __webpack_require__(44), replaceHolders = __webpack_require__(35); /** Used to compose bitmasks for function metadata. */ @@ -25681,12 +26846,12 @@ module.exports = partial; /***/ }), -/* 217 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__(12), - baseIteratee = __webpack_require__(3), - basePickBy = __webpack_require__(160), + baseIteratee = __webpack_require__(4), + basePickBy = __webpack_require__(161), getAllKeysIn = __webpack_require__(105); /** @@ -25724,13 +26889,13 @@ module.exports = pickBy; /***/ }), -/* 218 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { -var baseProperty = __webpack_require__(161), +var baseProperty = __webpack_require__(162), basePropertyDeep = __webpack_require__(316), isKey = __webpack_require__(108), - toKey = __webpack_require__(20); + toKey = __webpack_require__(19); /** * Creates a function that returns the value at `path` of a given object. @@ -25762,7 +26927,7 @@ module.exports = property; /***/ }), -/* 219 */ +/* 220 */ /***/ (function(module, exports) { /** @@ -25786,11 +26951,11 @@ module.exports = stubFalse; /***/ }), -/* 220 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { -var createToPairs = __webpack_require__(181), - keys = __webpack_require__(9); +var createToPairs = __webpack_require__(182), + keys = __webpack_require__(10); /** * Creates an array of own enumerable string keyed-value pairs for `object` @@ -25822,10 +26987,10 @@ module.exports = toPairs; /***/ }), -/* 221 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { -var createToPairs = __webpack_require__(181), +var createToPairs = __webpack_require__(182), keysIn = __webpack_require__(13); /** @@ -25858,7 +27023,7 @@ module.exports = toPairsIn; /***/ }), -/* 222 */ +/* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26030,7 +27195,7 @@ module.exports = exports['default']; /***/ }), -/* 223 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26067,7 +27232,7 @@ module.exports = function parseURI (str, opts) { /***/ }), -/* 224 */ +/* 225 */ /***/ (function(module, exports) { @@ -26406,7 +27571,7 @@ module.exports = Texture; /***/ }), -/* 225 */ +/* 226 */ /***/ (function(module, exports) { // var GL_MAP = {}; @@ -26467,7 +27632,7 @@ module.exports = setVertexAttribArrays; /***/ }), -/* 226 */ +/* 227 */ /***/ (function(module, exports) { @@ -26553,7 +27718,7 @@ module.exports = compileProgram; /***/ }), -/* 227 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -26637,12 +27802,12 @@ module.exports = defaultValue; /***/ }), -/* 228 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { var mapType = __webpack_require__(122); -var mapSize = __webpack_require__(231); +var mapSize = __webpack_require__(232); /** * Extracts the attributes @@ -26684,11 +27849,11 @@ module.exports = extractAttributes; /***/ }), -/* 229 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { var mapType = __webpack_require__(122); -var defaultValue = __webpack_require__(227); +var defaultValue = __webpack_require__(228); /** * Extracts the uniforms @@ -26725,7 +27890,7 @@ module.exports = extractUniforms; /***/ }), -/* 230 */ +/* 231 */ /***/ (function(module, exports) { /** @@ -26872,7 +28037,7 @@ module.exports = generateUniformAccessObject; /***/ }), -/* 231 */ +/* 232 */ /***/ (function(module, exports) { /** @@ -26914,7 +28079,7 @@ module.exports = mapSize; /***/ }), -/* 232 */ +/* 233 */ /***/ (function(module, exports) { /** @@ -26938,7 +28103,7 @@ module.exports = setPrecision; /***/ }), -/* 233 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27001,7 +28166,235 @@ exports.default = { //# sourceMappingURL=accessibleTarget.js.map /***/ }), -/* 234 */ +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _autoDetectRenderer = __webpack_require__(236); + +var _Container = __webpack_require__(55); + +var _Container2 = _interopRequireDefault(_Container); + +var _ticker = __webpack_require__(131); + +var _settings = __webpack_require__(6); + +var _settings2 = _interopRequireDefault(_settings); + +var _const = __webpack_require__(0); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Convenience class to create a new PIXI application. + * This class automatically creates the renderer, ticker + * and root container. + * + * @example + * // Create the application + * const app = new PIXI.Application(); + * + * // Add the view to the DOM + * document.body.appendChild(app.view); + * + * // ex, add display objects + * app.stage.addChild(PIXI.Sprite.fromImage('something.png')); + * + * @class + * @memberof PIXI + */ +var Application = function () { + // eslint-disable-next-line valid-jsdoc + /** + * @param {object} [options] - The optional renderer parameters + * @param {boolean} [options.autoStart=true] - automatically starts the rendering after the construction. + * Note that setting this parameter to false does NOT stop the shared ticker even if you set + * options.sharedTicker to true in case that it is already started. Stop it by your own. + * @param {number} [options.width=800] - the width of the renderers view + * @param {number} [options.height=600] - the height of the renderers view + * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional + * @param {boolean} [options.transparent=false] - If the render view is transparent, default false + * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment) + * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you + * need to call toDataUrl on the webgl context + * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2 + * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present + * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area + * (shown if not transparent). + * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or + * not before the new render pass. + * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering, + * stopping pixel interpolation. + * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native. + * FXAA is faster, but may not always look as great **webgl only** + * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. + * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** + * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker. + * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader. + */ + function Application(options, arg2, arg3, arg4, arg5) { + _classCallCheck(this, Application); + + // Support for constructor(width, height, options, noWebGL, useSharedTicker) + if (typeof options === 'number') { + options = Object.assign({ + width: options, + height: arg2 || _settings2.default.RENDER_OPTIONS.height, + forceCanvas: !!arg4, + sharedTicker: !!arg5 + }, arg3); + } + + /** + * The default options, so we mixin functionality later. + * @member {object} + * @protected + */ + this._options = options = Object.assign({ + autoStart: true, + sharedTicker: false, + forceCanvas: false, + sharedLoader: false + }, options); + + /** + * WebGL renderer if available, otherwise CanvasRenderer + * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer} + */ + this.renderer = (0, _autoDetectRenderer.autoDetectRenderer)(options); + + /** + * The root display container that's rendered. + * @member {PIXI.Container} + */ + this.stage = new _Container2.default(); + + /** + * Internal reference to the ticker + * @member {PIXI.ticker.Ticker} + * @private + */ + this._ticker = null; + + /** + * Ticker for doing render updates. + * @member {PIXI.ticker.Ticker} + * @default PIXI.ticker.shared + */ + this.ticker = options.sharedTicker ? _ticker.shared : new _ticker.Ticker(); + + // Start the rendering + if (options.autoStart) { + this.start(); + } + } + + /** + * Render the current stage. + */ + Application.prototype.render = function render() { + this.renderer.render(this.stage); + }; + + /** + * Convenience method for stopping the render. + */ + + + Application.prototype.stop = function stop() { + this._ticker.stop(); + }; + + /** + * Convenience method for starting the render. + */ + + + Application.prototype.start = function start() { + this._ticker.start(); + }; + + /** + * Reference to the renderer's canvas element. + * @member {HTMLCanvasElement} + * @readonly + */ + + + /** + * Destroy and don't use after this. + * @param {Boolean} [removeView=false] Automatically remove canvas from DOM. + */ + Application.prototype.destroy = function destroy(removeView) { + var oldTicker = this._ticker; + + this.ticker = null; + + oldTicker.destroy(); + + this.stage.destroy(); + this.stage = null; + + this.renderer.destroy(removeView); + this.renderer = null; + + this._options = null; + }; + + _createClass(Application, [{ + key: 'ticker', + set: function set(ticker) // eslint-disable-line require-jsdoc + { + if (this._ticker) { + this._ticker.remove(this.render, this); + } + this._ticker = ticker; + if (ticker) { + ticker.add(this.render, this, _const.UPDATE_PRIORITY.LOW); + } + }, + get: function get() // eslint-disable-line require-jsdoc + { + return this._ticker; + } + }, { + key: 'view', + get: function get() { + return this.renderer.view; + } + + /** + * Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen + * @member {PIXI.Rectangle} + * @readonly + */ + + }, { + key: 'screen', + get: function get() { + return this.renderer.screen; + } + }]); + + return Application; +}(); + +exports.default = Application; +//# sourceMappingURL=Application.js.map + +/***/ }), +/* 236 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27010,15 +28403,15 @@ exports.default = { exports.__esModule = true; exports.autoDetectRenderer = autoDetectRenderer; -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); var utils = _interopRequireWildcard(_utils); -var _CanvasRenderer = __webpack_require__(54); +var _CanvasRenderer = __webpack_require__(56); var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); -var _WebGLRenderer = __webpack_require__(82); +var _WebGLRenderer = __webpack_require__(81); var _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer); @@ -27026,6 +28419,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +// eslint-disable-next-line valid-jsdoc /** * This helper function will automatically detect which renderer you should be using. * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by @@ -27033,34 +28427,48 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; * * @memberof PIXI * @function autoDetectRenderer - * @param {number} [width=800] - the width of the renderers view - * @param {number} [height=600] - the height of the renderers view * @param {object} [options] - The optional renderer parameters + * @param {number} [options.width=800] - the width of the renderers view + * @param {number} [options.height=600] - the height of the renderers view * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional * @param {boolean} [options.transparent=false] - If the render view is transparent, default false * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment) * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you - * need to call toDataUrl on the webgl context + * need to call toDataUrl on the webgl context + * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area + * (shown if not transparent). + * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or + * not before the new render pass. * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2 - * @param {boolean} [noWebGL=false] - prevents selection of WebGL renderer, even if such is present + * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present + * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering, + * stopping pixel interpolation. + * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native. + * FXAA is faster, but may not always look as great **webgl only** + * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices. + * If you experience unexplained flickering try setting this to true. **webgl only** + * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to "high-performance" + * for devices with dual graphics card **webgl only** * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer */ -function autoDetectRenderer() { - var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 800; - var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 600; - var options = arguments[2]; - var noWebGL = arguments[3]; +function autoDetectRenderer(options, arg1, arg2, arg3) { + // Backward-compatible support for noWebGL option + var forceCanvas = options && options.forceCanvas; + + if (arg3 !== undefined) { + forceCanvas = arg3; + } - if (!noWebGL && utils.isWebGLSupported()) { - return new _WebGLRenderer2.default(width, height, options); + if (!forceCanvas && utils.isWebGLSupported()) { + return new _WebGLRenderer2.default(options, arg1, arg2); } - return new _CanvasRenderer2.default(width, height, options); + return new _CanvasRenderer2.default(options, arg1, arg2); } //# sourceMappingURL=autoDetectRenderer.js.map /***/ }), -/* 235 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27070,21 +28478,21 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _eventemitter = __webpack_require__(24); +var _eventemitter = __webpack_require__(30); var _eventemitter2 = _interopRequireDefault(_eventemitter); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); -var _TransformStatic = __webpack_require__(237); +var _TransformStatic = __webpack_require__(239); var _TransformStatic2 = _interopRequireDefault(_TransformStatic); -var _Transform = __webpack_require__(236); +var _Transform = __webpack_require__(238); var _Transform2 = _interopRequireDefault(_Transform); @@ -27092,7 +28500,7 @@ var _Bounds = __webpack_require__(123); var _Bounds2 = _interopRequireDefault(_Bounds); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -27110,7 +28518,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * * @class * @extends EventEmitter - * @mixes PIXI.interaction.interactiveTarget * @memberof PIXI */ var DisplayObject = function (_EventEmitter) { @@ -27208,10 +28615,33 @@ var DisplayObject = function (_EventEmitter) { /** * The original, cached mask of the object * - * @member {PIXI.Rectangle} + * @member {PIXI.Graphics|PIXI.Sprite} * @private */ _this._mask = null; + + /** + * If the object has been destroyed via destroy(). If true, it should not be used. + * + * @member {boolean} + * @private + * @readonly + */ + _this._destroyed = false; + + /** + * Fired when this DisplayObject is added to a Container. + * + * @event PIXI.DisplayObject#added + * @param {PIXI.Container} container - The container added to. + */ + + /** + * Fired when this DisplayObject is removed from a Container. + * + * @event PIXI.DisplayObject#removed + * @param {PIXI.Container} container - The container removed from. + */ return _this; } @@ -27495,6 +28925,8 @@ var DisplayObject = function (_EventEmitter) { this.interactive = false; this.interactiveChildren = false; + + this._destroyed = true; }; /** @@ -27733,7 +29165,7 @@ DisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.u //# sourceMappingURL=DisplayObject.js.map /***/ }), -/* 236 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27743,7 +29175,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); var _TransformBase2 = __webpack_require__(124); @@ -27919,7 +29351,7 @@ exports.default = Transform; //# sourceMappingURL=Transform.js.map /***/ }), -/* 237 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -27929,7 +29361,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); var _TransformBase2 = __webpack_require__(124); @@ -28134,7 +29566,7 @@ exports.default = TransformStatic; //# sourceMappingURL=TransformStatic.js.map /***/ }), -/* 238 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28159,15 +29591,20 @@ var GraphicsData = function () { * @param {number} fillColor - the color of the fill * @param {number} fillAlpha - the alpha of the fill * @param {boolean} fill - whether or not the shape is filled with a colour + * @param {boolean} nativeLines - the method for drawing lines * @param {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Polygon} shape - The shape object to draw. */ - function GraphicsData(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, shape) { + function GraphicsData(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, nativeLines, shape) { _classCallCheck(this, GraphicsData); /** * @member {number} the width of the line to draw */ this.lineWidth = lineWidth; + /** + * @member {boolean} if true the liens will be draw using LINES instead of TRIANGLE_STRIP + */ + this.nativeLines = nativeLines; /** * @member {number} the color of the line to draw @@ -28225,7 +29662,7 @@ var GraphicsData = function () { GraphicsData.prototype.clone = function clone() { - return new GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.shape); + return new GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.nativeLines, this.shape); }; /** @@ -28256,7 +29693,7 @@ exports.default = GraphicsData; //# sourceMappingURL=GraphicsData.js.map /***/ }), -/* 239 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28453,7 +29890,7 @@ exports.default = GroupD8; //# sourceMappingURL=GroupD8.js.map /***/ }), -/* 240 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28575,7 +30012,7 @@ exports.default = ObservablePoint; //# sourceMappingURL=ObservablePoint.js.map /***/ }), -/* 241 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28585,17 +30022,17 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); -var _Container = __webpack_require__(53); +var _Container = __webpack_require__(55); var _Container2 = _interopRequireDefault(_Container); @@ -28603,7 +30040,7 @@ var _RenderTexture = __webpack_require__(130); var _RenderTexture2 = _interopRequireDefault(_RenderTexture); -var _eventemitter = __webpack_require__(24); +var _eventemitter = __webpack_require__(30); var _eventemitter2 = _interopRequireDefault(_eventemitter); @@ -28618,8 +30055,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" var tempMatrix = new _math.Matrix(); /** - * The SystemRenderer is the base for a Pixi Renderer. It is extended by the {@link PIXI.CanvasRenderer} - * and {@link PIXI.WebGLRenderer} which can be used for rendering a Pixi scene. + * The SystemRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer} + * and {@link PIXI.WebGLRenderer} which can be used for rendering a PixiJS scene. * * @abstract * @class @@ -28630,42 +30067,53 @@ var tempMatrix = new _math.Matrix(); var SystemRenderer = function (_EventEmitter) { _inherits(SystemRenderer, _EventEmitter); + // eslint-disable-next-line valid-jsdoc /** * @param {string} system - The name of the system this renderer is for. - * @param {number} [width=800] - the width of the canvas view - * @param {number} [height=600] - the height of the canvas view * @param {object} [options] - The optional renderer parameters + * @param {number} [options.width=800] - the width of the screen + * @param {number} [options.height=600] - the height of the screen * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional * @param {boolean} [options.transparent=false] - If the render view is transparent, default false * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment) * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The * resolution of the renderer retina would be 2. - * @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or + * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, + * enable this if you need to call toDataUrl on the webgl context. + * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or * not before the new render pass. * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area * (shown if not transparent). - * @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering, + * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering, * stopping pixel interpolation. */ - function SystemRenderer(system, width, height, options) { + function SystemRenderer(system, options, arg2, arg3) { _classCallCheck(this, SystemRenderer); var _this = _possibleConstructorReturn(this, _EventEmitter.call(this)); (0, _utils.sayHello)(system); - // prepare options - if (options) { - for (var i in _settings2.default.RENDER_OPTIONS) { - if (typeof options[i] === 'undefined') { - options[i] = _settings2.default.RENDER_OPTIONS[i]; - } - } - } else { - options = _settings2.default.RENDER_OPTIONS; + // Support for constructor(system, screenWidth, screenHeight, options) + if (typeof options === 'number') { + options = Object.assign({ + width: options, + height: arg2 || _settings2.default.RENDER_OPTIONS.height + }, arg3); } + // Add the default render options + options = Object.assign({}, _settings2.default.RENDER_OPTIONS, options); + + /** + * The supplied constructor options. + * + * @member {Object} + * @readOnly + */ + _this.options = options; + /** * The type of the renderer. * @@ -28676,20 +30124,13 @@ var SystemRenderer = function (_EventEmitter) { _this.type = _const.RENDERER_TYPE.UNKNOWN; /** - * The width of the canvas view + * Measurements of the screen. (0, 0, screenWidth, screenHeight) * - * @member {number} - * @default 800 - */ - _this.width = width || 800; - - /** - * The height of the canvas view + * Its safe to use as filterArea or hitArea for whole stage * - * @member {number} - * @default 600 + * @member {PIXI.Rectangle} */ - _this.height = height || 600; + _this.screen = new _math.Rectangle(0, 0, options.width, options.height); /** * The canvas element that everything is drawn to @@ -28714,7 +30155,7 @@ var SystemRenderer = function (_EventEmitter) { _this.transparent = options.transparent; /** - * Whether the render view should be resized automatically + * Whether css dimensions of canvas view should be resized to screen dimensions automatically * * @member {boolean} */ @@ -28737,8 +30178,8 @@ var SystemRenderer = function (_EventEmitter) { /** * This sets if the CanvasRenderer will clear the canvas or not before the new render pass. - * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every - * frame to set the canvas background color. If the scene is transparent Pixi will use clearRect + * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every + * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect * to clear the canvas every frame. Disable this by setting this to false. For example if * your game has a canvas filling background image you often don't need this set. * @@ -28748,7 +30189,7 @@ var SystemRenderer = function (_EventEmitter) { _this.clearBeforeRender = options.clearBeforeRender; /** - * If true Pixi will Math.floor() x/y values when rendering, stopping pixel interpolation. + * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. * Handy for crisp pixel art and speed on legacy devices. * * @member {boolean} @@ -28800,23 +30241,31 @@ var SystemRenderer = function (_EventEmitter) { } /** - * Resizes the canvas view to the specified width and height + * Same as view.width, actual number of pixels in the canvas by horizontal * - * @param {number} width - the new width of the canvas view - * @param {number} height - the new height of the canvas view + * @member {number} + * @readonly + * @default 800 */ - SystemRenderer.prototype.resize = function resize(width, height) { - this.width = width * this.resolution; - this.height = height * this.resolution; + /** + * Resizes the screen and canvas to the specified width and height + * Canvas dimensions are multiplied by resolution + * + * @param {number} screenWidth - the new width of the screen + * @param {number} screenHeight - the new height of the screen + */ + SystemRenderer.prototype.resize = function resize(screenWidth, screenHeight) { + this.screen.width = screenWidth; + this.screen.height = screenHeight; - this.view.width = this.width; - this.view.height = this.height; + this.view.width = screenWidth * this.resolution; + this.view.height = screenHeight * this.resolution; if (this.autoResize) { - this.view.style.width = this.width / this.resolution + 'px'; - this.view.style.height = this.height / this.resolution + 'px'; + this.view.style.width = screenWidth + 'px'; + this.view.style.height = screenHeight + 'px'; } }; @@ -28858,11 +30307,10 @@ var SystemRenderer = function (_EventEmitter) { this.type = _const.RENDERER_TYPE.UNKNOWN; - this.width = 0; - this.height = 0; - this.view = null; + this.screen = null; + this.resolution = 0; this.transparent = false; @@ -28871,6 +30319,8 @@ var SystemRenderer = function (_EventEmitter) { this.blendModes = null; + this.options = null; + this.preserveDrawingBuffer = false; this.clearBeforeRender = false; @@ -28880,7 +30330,6 @@ var SystemRenderer = function (_EventEmitter) { this._backgroundColorRgba = null; this._backgroundColorString = null; - this.backgroundColor = 0; this._tempDisplayObjectParent = null; this._lastObjectRendered = null; }; @@ -28893,6 +30342,25 @@ var SystemRenderer = function (_EventEmitter) { _createClass(SystemRenderer, [{ + key: 'width', + get: function get() { + return this.view.width; + } + + /** + * Same as view.height, actual number of pixels in the canvas by vertical + * + * @member {number} + * @readonly + * @default 600 + */ + + }, { + key: 'height', + get: function get() { + return this.view.height; + } + }, { key: 'backgroundColor', get: function get() { return this._backgroundColor; @@ -28912,7 +30380,7 @@ exports.default = SystemRenderer; //# sourceMappingURL=SystemRenderer.js.map /***/ }), -/* 242 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -28922,7 +30390,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); @@ -28930,15 +30398,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var RESOLUTION = _settings2.default.RESOLUTION; - /** * Creates a Canvas element of the given size. * * @class * @memberof PIXI */ - var CanvasRenderTarget = function () { /** * @param {number} width - the width for the newly created canvas @@ -28962,7 +30427,7 @@ var CanvasRenderTarget = function () { */ this.context = this.canvas.getContext('2d'); - this.resolution = resolution || RESOLUTION; + this.resolution = resolution || _settings2.default.RESOLUTION; this.resize(width, height); } @@ -29044,7 +30509,7 @@ exports.default = CanvasRenderTarget; //# sourceMappingURL=CanvasRenderTarget.js.map /***/ }), -/* 243 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29110,7 +30575,7 @@ function canUseNewCanvasBlendModes() { //# sourceMappingURL=canUseNewCanvasBlendModes.js.map /***/ }), -/* 244 */ +/* 246 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29120,13 +30585,17 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _extractUniformsFromSrc = __webpack_require__(541); +var _extractUniformsFromSrc = __webpack_require__(539); var _extractUniformsFromSrc2 = _interopRequireDefault(_extractUniformsFromSrc); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); + +var _const = __webpack_require__(0); -var _const = __webpack_require__(2); +var _settings = __webpack_require__(6); + +var _settings2 = _interopRequireDefault(_settings); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -29164,10 +30633,8 @@ var Filter = function () { */ this.fragmentSrc = fragmentSrc || Filter.defaultFragmentSrc; - this.blendMode = _const.BLEND_MODES.NORMAL; + this._blendMode = _const.BLEND_MODES.NORMAL; - // pull out the vertex and shader uniforms if they are not specified.. - // currently this does not extract structs only default types this.uniformData = uniforms || (0, _extractUniformsFromSrc2.default)(this.vertexSrc, this.fragmentSrc, 'projectionMatrix|uSampler'); /** @@ -29181,6 +30648,9 @@ var Filter = function () { for (var i in this.uniformData) { this.uniforms[i] = this.uniformData[i].value; + if (this.uniformData[i].type) { + this.uniformData[i].type = this.uniformData[i].type.toLowerCase(); + } } // this is where we store shader references.. @@ -29209,7 +30679,7 @@ var Filter = function () { * * @member {number} */ - this.resolution = 1; + this.resolution = _settings2.default.RESOLUTION; /** * If enabled is true the filter is applied, if false it will not. @@ -29217,6 +30687,14 @@ var Filter = function () { * @member {boolean} */ this.enabled = true; + + /** + * If enabled, PixiJS will fit the filter area into boundaries for better performance. + * Switch it off if it does not work for specific shader. + * + * @member {boolean} + */ + this.autoFit = true; } /** @@ -29226,10 +30704,14 @@ var Filter = function () { * @param {PIXI.RenderTarget} input - The input render target. * @param {PIXI.RenderTarget} output - The target to output to. * @param {boolean} clear - Should the output be cleared before rendering to it + * @param {object} [currentState] - It's current state of filter. + * There are some useful properties in the currentState : + * target, filters, sourceFrame, destinationFrame, renderTarget, resolution */ - Filter.prototype.apply = function apply(filterManager, input, output, clear) { + Filter.prototype.apply = function apply(filterManager, input, output, clear, currentState) // eslint-disable-line no-unused-vars + { // --- // // this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(tempMatrix, window.panda ); @@ -29241,14 +30723,31 @@ var Filter = function () { }; /** - * The default vertex shader source + * Sets the blendmode of the filter * - * @static - * @constant + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL */ - _createClass(Filter, null, [{ + _createClass(Filter, [{ + key: 'blendMode', + get: function get() { + return this._blendMode; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this._blendMode = value; + } + + /** + * The default vertex shader source + * + * @static + * @constant + */ + + }], [{ key: 'defaultVertexSrc', get: function get() { return ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 projectionMatrix;', 'uniform mat3 filterMatrix;', 'varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;', ' vTextureCoord = aTextureCoord ;', '}'].join('\n'); @@ -29277,7 +30776,7 @@ exports.default = Filter; //# sourceMappingURL=Filter.js.map /***/ }), -/* 245 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29285,13 +30784,13 @@ exports.default = Filter; exports.__esModule = true; -var _Filter2 = __webpack_require__(244); +var _Filter2 = __webpack_require__(246); var _Filter3 = _interopRequireDefault(_Filter2); -var _math = __webpack_require__(7); +var _math = __webpack_require__(8); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -29354,7 +30853,7 @@ exports.default = SpriteMaskFilter; //# sourceMappingURL=SpriteMaskFilter.js.map /***/ }), -/* 246 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29366,7 +30865,7 @@ var _pixiGlCore = __webpack_require__(15); var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); -var _createIndicesForQuads = __webpack_require__(131); +var _createIndicesForQuads = __webpack_require__(132); var _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads); @@ -29388,7 +30887,7 @@ var Quad = function () { function Quad(gl, state) { _classCallCheck(this, Quad); - /* + /** * the current WebGL drawing context * * @member {WebGLRenderingContext} @@ -29418,23 +30917,31 @@ var Quad = function () { this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1]; } - /* - * @member {Uint16Array} An array containing the indices of the vertices + /** + * An array containing the indices of the vertices + * + * @member {Uint16Array} */ this.indices = (0, _createIndicesForQuads2.default)(1); - /* - * @member {glCore.GLBuffer} The vertex buffer + /** + * The vertex buffer + * + * @member {glCore.GLBuffer} */ this.vertexBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.interleaved, gl.STATIC_DRAW); - /* - * @member {glCore.GLBuffer} The index buffer + /** + * The index buffer + * + * @member {glCore.GLBuffer} */ this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW); - /* - * @member {glCore.VertexArrayObject} The index buffer + /** + * The vertex array object + * + * @member {glCore.VertexArrayObject} */ this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, state); } @@ -29532,7 +31039,314 @@ exports.default = Quad; //# sourceMappingURL=Quad.js.map /***/ }), -/* 247 */ +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * The TextMetrics object represents the measurement of a block of text with a specified style. + * + * @class + * @memberOf PIXI + */ +var TextMetrics = function () { + /** + * @param {string} text - the text that was measured + * @param {PIXI.TextStyle} style - the style that was measured + * @param {number} width - the measured width of the text + * @param {number} height - the measured height of the text + * @param {array} lines - an array of the lines of text broken by new lines and wrapping if specified in style + * @param {array} lineWidths - an array of the line widths for each line matched to `lines` + * @param {number} lineHeight - the measured line height for this style + * @param {number} maxLineWidth - the maximum line width for all measured lines + * @param {Object} fontProperties - the font properties object from TextMetrics.measureFont + */ + function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) { + _classCallCheck(this, TextMetrics); + + this.text = text; + this.style = style; + this.width = width; + this.height = height; + this.lines = lines; + this.lineWidths = lineWidths; + this.lineHeight = lineHeight; + this.maxLineWidth = maxLineWidth; + this.fontProperties = fontProperties; + } + + /** + * Measures the supplied string of text and returns a Rectangle. + * + * @param {string} text - the text to measure. + * @param {PIXI.TextStyle} style - the text style to use for measuring + * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text. + * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring. + * @return {PIXI.TextMetrics} measured width and height of the text. + */ + + + TextMetrics.measureText = function measureText(text, style, wordWrap) { + var canvas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : TextMetrics._canvas; + + wordWrap = wordWrap || style.wordWrap; + var font = style.toFontString(); + var fontProperties = TextMetrics.measureFont(font); + var context = canvas.getContext('2d'); + + context.font = font; + + var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text; + var lines = outputText.split(/(?:\r\n|\r|\n)/); + var lineWidths = new Array(lines.length); + var maxLineWidth = 0; + + for (var i = 0; i < lines.length; i++) { + var lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * style.letterSpacing; + + lineWidths[i] = lineWidth; + maxLineWidth = Math.max(maxLineWidth, lineWidth); + } + var width = maxLineWidth + style.strokeThickness; + + if (style.dropShadow) { + width += style.dropShadowDistance; + } + + var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness; + var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness) + (lines.length - 1) * (lineHeight + style.leading); + + if (style.dropShadow) { + height += style.dropShadowDistance; + } + + return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties); + }; + + /** + * Applies newlines to a string to have it optimally fit into the horizontal + * bounds set by the Text object's wordWrapWidth property. + * + * @private + * @param {string} text - String to apply word wrapping to + * @param {PIXI.TextStyle} style - the style to use when wrapping + * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring. + * @return {string} New string with new lines applied where required + */ + + + TextMetrics.wordWrap = function wordWrap(text, style) { + var canvas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TextMetrics._canvas; + + var context = canvas.getContext('2d'); + + // Greedy wrapping algorithm that will wrap words as the line grows longer + // than its horizontal bounds. + var result = ''; + var lines = text.split('\n'); + var wordWrapWidth = style.wordWrapWidth; + var characterCache = {}; + + for (var i = 0; i < lines.length; i++) { + var spaceLeft = wordWrapWidth; + var words = lines[i].split(' '); + + for (var j = 0; j < words.length; j++) { + var wordWidth = context.measureText(words[j]).width; + + if (style.breakWords && wordWidth > wordWrapWidth) { + // Word should be split in the middle + var characters = words[j].split(''); + + for (var c = 0; c < characters.length; c++) { + var character = characters[c]; + var characterWidth = characterCache[character]; + + if (characterWidth === undefined) { + characterWidth = context.measureText(character).width; + characterCache[character] = characterWidth; + } + + if (characterWidth > spaceLeft) { + result += '\n' + character; + spaceLeft = wordWrapWidth - characterWidth; + } else { + if (c === 0) { + result += ' '; + } + + result += character; + spaceLeft -= characterWidth; + } + } + } else { + var wordWidthWithSpace = wordWidth + context.measureText(' ').width; + + if (j === 0 || wordWidthWithSpace > spaceLeft) { + // Skip printing the newline if it's the first word of the line that is + // greater than the word wrap width. + if (j > 0) { + result += '\n'; + } + result += words[j]; + spaceLeft = wordWrapWidth - wordWidth; + } else { + spaceLeft -= wordWidthWithSpace; + result += ' ' + words[j]; + } + } + } + + if (i < lines.length - 1) { + result += '\n'; + } + } + + return result; + }; + + /** + * Calculates the ascent, descent and fontSize of a given font-style + * + * @static + * @param {string} font - String representing the style of the font + * @return {PIXI.TextMetrics~FontMetrics} Font properties object + */ + + + TextMetrics.measureFont = function measureFont(font) { + // as this method is used for preparing assets, don't recalculate things if we don't need to + if (TextMetrics._fonts[font]) { + return TextMetrics._fonts[font]; + } + + var properties = {}; + + var canvas = TextMetrics._canvas; + var context = TextMetrics._context; + + context.font = font; + + var width = Math.ceil(context.measureText('|MÉq').width); + var baseline = Math.ceil(context.measureText('M').width); + var height = 2 * baseline; + + baseline = baseline * 1.4 | 0; + + canvas.width = width; + canvas.height = height; + + context.fillStyle = '#f00'; + context.fillRect(0, 0, width, height); + + context.font = font; + + context.textBaseline = 'alphabetic'; + context.fillStyle = '#000'; + context.fillText('|MÉq', 0, baseline); + + var imagedata = context.getImageData(0, 0, width, height).data; + var pixels = imagedata.length; + var line = width * 4; + + var i = 0; + var idx = 0; + var stop = false; + + // ascent. scan from top to bottom until we find a non red pixel + for (i = 0; i < baseline; ++i) { + for (var j = 0; j < line; j += 4) { + if (imagedata[idx + j] !== 255) { + stop = true; + break; + } + } + if (!stop) { + idx += line; + } else { + break; + } + } + + properties.ascent = baseline - i; + + idx = pixels - line; + stop = false; + + // descent. scan from bottom to top until we find a non red pixel + for (i = height; i > baseline; --i) { + for (var _j = 0; _j < line; _j += 4) { + if (imagedata[idx + _j] !== 255) { + stop = true; + break; + } + } + + if (!stop) { + idx -= line; + } else { + break; + } + } + + properties.descent = i - baseline; + properties.fontSize = properties.ascent + properties.descent; + + TextMetrics._fonts[font] = properties; + + return properties; + }; + + return TextMetrics; +}(); + +/** + * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}. + * @class FontMetrics + * @memberof PIXI.TextMetrics~ + * @property {number} ascent - The ascent distance + * @property {number} descent - The descent distance + * @property {number} fontSize - Font size from ascent to descent + */ + +exports.default = TextMetrics; +var canvas = document.createElement('canvas'); + +canvas.width = canvas.height = 10; + +/** + * Cached canvas element for measuring text + * @memberof PIXI.TextMetrics + * @type {HTMLCanvasElement} + * @private + */ +TextMetrics._canvas = canvas; + +/** + * Cache for context to use. + * @memberof PIXI.TextMetrics + * @type {CanvasRenderingContext2D} + * @private + */ +TextMetrics._context = canvas.getContext('2d'); + +/** + * Cache of PIXI.TextMetrics~FontMetrics objects. + * @memberof PIXI.TextMetrics + * @type {Object} + * @private + */ +TextMetrics._fonts = {}; +//# sourceMappingURL=TextMetrics.js.map + +/***/ }), +/* 250 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29543,9 +31357,9 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // disabling eslint for now, going to rewrite this in v5 /* eslint-disable */ -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -29553,12 +31367,14 @@ var defaultStyle = { align: 'left', breakWords: false, dropShadow: false, + dropShadowAlpha: 1, dropShadowAngle: Math.PI / 6, dropShadowBlur: 0, - dropShadowColor: '#000000', + dropShadowColor: 'black', dropShadowDistance: 5, fill: 'black', fillGradientType: _const.TEXT_GRADIENT.LINEAR_VERTICAL, + fillGradientStops: [], fontFamily: 'Arial', fontSize: 26, fontStyle: 'normal', @@ -29572,8 +31388,10 @@ var defaultStyle = { stroke: 'black', strokeThickness: 0, textBaseline: 'alphabetic', + trim: false, wordWrap: false, - wordWrapWidth: 100 + wordWrapWidth: 100, + leading: 0 }; /** @@ -29592,16 +31410,19 @@ var TextStyle = function () { * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it * needs wordWrap to be set to true * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text + * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius - * @param {string} [style.dropShadowColor='#000000'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00' + * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00' * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient * eg ['#000000','#FFFFFF'] * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN} - * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fills styles are - * supplied, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT} for possible values + * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours + * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT} + * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set + * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them. * @param {string|string[]} [style.fontFamily='Arial'] - The font family * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string, * equivalents are '26px','20pt','160%' or '1.6em') @@ -29609,6 +31430,7 @@ var TextStyle = function () { * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps') * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100', * '200', '300', '400', '500', '600', '700', 800' or '900') + * @param {number} [style.leading=0] - The space between lines * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0 * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve @@ -29621,6 +31443,7 @@ var TextStyle = function () { * e.g 'blue', '#FCFF00' * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke. * Default is 0 (no stroke) + * @param {boolean} [style.trim=false] - Trim transparent borders * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered. * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true @@ -29660,268 +31483,580 @@ var TextStyle = function () { Object.assign(this, defaultStyle); }; + /** + * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text + * + * @member {string} + */ + + + /** + * Generates a font style string to use for `TextMetrics.measureFont()`. + * + * @return {string} Font style string, for passing to `TextMetrics.measureFont()` + */ + TextStyle.prototype.toFontString = function toFontString() { + // build canvas api font setting from individual components. Convert a numeric this.fontSize to px + var fontSizeString = typeof this.fontSize === 'number' ? this.fontSize + 'px' : this.fontSize; + + // Clean-up fontFamily property by quoting each font name + // this will support font names with spaces + var fontFamilies = this.fontFamily; + + if (!Array.isArray(this.fontFamily)) { + fontFamilies = this.fontFamily.split(','); + } + + for (var i = fontFamilies.length - 1; i >= 0; i--) { + // Trim any extra white-space + var fontFamily = fontFamilies[i].trim(); + + // Check if font already contains strings + if (!/([\"\'])[^\'\"]+\1/.test(fontFamily)) { + fontFamily = '"' + fontFamily + '"'; + } + fontFamilies[i] = fontFamily; + } + + return this.fontStyle + ' ' + this.fontVariant + ' ' + this.fontWeight + ' ' + fontSizeString + ' ' + fontFamilies.join(','); + }; + _createClass(TextStyle, [{ key: 'align', get: function get() { return this._align; }, - set: function set(align) { + set: function set(align) // eslint-disable-line require-jsdoc + { if (this._align !== align) { this._align = align; this.styleID++; } } + + /** + * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true + * + * @member {boolean} + */ + }, { key: 'breakWords', get: function get() { return this._breakWords; }, - set: function set(breakWords) { + set: function set(breakWords) // eslint-disable-line require-jsdoc + { if (this._breakWords !== breakWords) { this._breakWords = breakWords; this.styleID++; } } + + /** + * Set a drop shadow for the text + * + * @member {boolean} + */ + }, { key: 'dropShadow', get: function get() { return this._dropShadow; }, - set: function set(dropShadow) { + set: function set(dropShadow) // eslint-disable-line require-jsdoc + { if (this._dropShadow !== dropShadow) { this._dropShadow = dropShadow; this.styleID++; } } + + /** + * Set alpha for the drop shadow + * + * @member {number} + */ + + }, { + key: 'dropShadowAlpha', + get: function get() { + return this._dropShadowAlpha; + }, + set: function set(dropShadowAlpha) // eslint-disable-line require-jsdoc + { + if (this._dropShadowAlpha !== dropShadowAlpha) { + this._dropShadowAlpha = dropShadowAlpha; + this.styleID++; + } + } + + /** + * Set a angle of the drop shadow + * + * @member {number} + */ + }, { key: 'dropShadowAngle', get: function get() { return this._dropShadowAngle; }, - set: function set(dropShadowAngle) { + set: function set(dropShadowAngle) // eslint-disable-line require-jsdoc + { if (this._dropShadowAngle !== dropShadowAngle) { this._dropShadowAngle = dropShadowAngle; this.styleID++; } } + + /** + * Set a shadow blur radius + * + * @member {number} + */ + }, { key: 'dropShadowBlur', get: function get() { return this._dropShadowBlur; }, - set: function set(dropShadowBlur) { + set: function set(dropShadowBlur) // eslint-disable-line require-jsdoc + { if (this._dropShadowBlur !== dropShadowBlur) { this._dropShadowBlur = dropShadowBlur; this.styleID++; } } + + /** + * A fill style to be used on the dropshadow e.g 'red', '#00FF00' + * + * @member {string|number} + */ + }, { key: 'dropShadowColor', get: function get() { return this._dropShadowColor; }, - set: function set(dropShadowColor) { + set: function set(dropShadowColor) // eslint-disable-line require-jsdoc + { var outputColor = getColor(dropShadowColor); if (this._dropShadowColor !== outputColor) { this._dropShadowColor = outputColor; this.styleID++; } } + + /** + * Set a distance of the drop shadow + * + * @member {number} + */ + }, { key: 'dropShadowDistance', get: function get() { return this._dropShadowDistance; }, - set: function set(dropShadowDistance) { + set: function set(dropShadowDistance) // eslint-disable-line require-jsdoc + { if (this._dropShadowDistance !== dropShadowDistance) { this._dropShadowDistance = dropShadowDistance; this.styleID++; } } + + /** + * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'. + * Can be an array to create a gradient eg ['#000000','#FFFFFF'] + * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN} + * + * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern} + */ + }, { key: 'fill', get: function get() { return this._fill; }, - set: function set(fill) { + set: function set(fill) // eslint-disable-line require-jsdoc + { var outputColor = getColor(fill); if (this._fill !== outputColor) { this._fill = outputColor; this.styleID++; } } + + /** + * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient. + * See {@link PIXI.TEXT_GRADIENT} + * + * @member {number} + */ + }, { key: 'fillGradientType', get: function get() { return this._fillGradientType; }, - set: function set(fillGradientType) { + set: function set(fillGradientType) // eslint-disable-line require-jsdoc + { if (this._fillGradientType !== fillGradientType) { this._fillGradientType = fillGradientType; this.styleID++; } } + + /** + * If fill is an array of colours to create a gradient, this array can set the stop points + * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them. + * + * @member {number[]} + */ + + }, { + key: 'fillGradientStops', + get: function get() { + return this._fillGradientStops; + }, + set: function set(fillGradientStops) // eslint-disable-line require-jsdoc + { + if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) { + this._fillGradientStops = fillGradientStops; + this.styleID++; + } + } + + /** + * The font family + * + * @member {string|string[]} + */ + }, { key: 'fontFamily', get: function get() { return this._fontFamily; }, - set: function set(fontFamily) { + set: function set(fontFamily) // eslint-disable-line require-jsdoc + { if (this.fontFamily !== fontFamily) { this._fontFamily = fontFamily; this.styleID++; } } + + /** + * The font size + * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em') + * + * @member {number|string} + */ + }, { key: 'fontSize', get: function get() { return this._fontSize; }, - set: function set(fontSize) { + set: function set(fontSize) // eslint-disable-line require-jsdoc + { if (this._fontSize !== fontSize) { this._fontSize = fontSize; this.styleID++; } } + + /** + * The font style + * ('normal', 'italic' or 'oblique') + * + * @member {string} + */ + }, { key: 'fontStyle', get: function get() { return this._fontStyle; }, - set: function set(fontStyle) { + set: function set(fontStyle) // eslint-disable-line require-jsdoc + { if (this._fontStyle !== fontStyle) { this._fontStyle = fontStyle; this.styleID++; } } + + /** + * The font variant + * ('normal' or 'small-caps') + * + * @member {string} + */ + }, { key: 'fontVariant', get: function get() { return this._fontVariant; }, - set: function set(fontVariant) { + set: function set(fontVariant) // eslint-disable-line require-jsdoc + { if (this._fontVariant !== fontVariant) { this._fontVariant = fontVariant; this.styleID++; } } + + /** + * The font weight + * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900') + * + * @member {string} + */ + }, { key: 'fontWeight', get: function get() { return this._fontWeight; }, - set: function set(fontWeight) { + set: function set(fontWeight) // eslint-disable-line require-jsdoc + { if (this._fontWeight !== fontWeight) { this._fontWeight = fontWeight; this.styleID++; } } + + /** + * The amount of spacing between letters, default is 0 + * + * @member {number} + */ + }, { key: 'letterSpacing', get: function get() { return this._letterSpacing; }, - set: function set(letterSpacing) { + set: function set(letterSpacing) // eslint-disable-line require-jsdoc + { if (this._letterSpacing !== letterSpacing) { this._letterSpacing = letterSpacing; this.styleID++; } } + + /** + * The line height, a number that represents the vertical space that a letter uses + * + * @member {number} + */ + }, { key: 'lineHeight', get: function get() { return this._lineHeight; }, - set: function set(lineHeight) { + set: function set(lineHeight) // eslint-disable-line require-jsdoc + { if (this._lineHeight !== lineHeight) { this._lineHeight = lineHeight; this.styleID++; } } + + /** + * The space between lines + * + * @member {number} + */ + + }, { + key: 'leading', + get: function get() { + return this._leading; + }, + set: function set(leading) // eslint-disable-line require-jsdoc + { + if (this._leading !== leading) { + this._leading = leading; + this.styleID++; + } + } + + /** + * The lineJoin property sets the type of corner created, it can resolve spiked text issues. + * Default is 'miter' (creates a sharp corner). + * + * @member {string} + */ + }, { key: 'lineJoin', get: function get() { return this._lineJoin; }, - set: function set(lineJoin) { + set: function set(lineJoin) // eslint-disable-line require-jsdoc + { if (this._lineJoin !== lineJoin) { this._lineJoin = lineJoin; this.styleID++; } } + + /** + * The miter limit to use when using the 'miter' lineJoin mode + * This can reduce or increase the spikiness of rendered text. + * + * @member {number} + */ + }, { key: 'miterLimit', get: function get() { return this._miterLimit; }, - set: function set(miterLimit) { + set: function set(miterLimit) // eslint-disable-line require-jsdoc + { if (this._miterLimit !== miterLimit) { this._miterLimit = miterLimit; this.styleID++; } } + + /** + * Occasionally some fonts are cropped. Adding some padding will prevent this from happening + * by adding padding to all sides of the text. + * + * @member {number} + */ + }, { key: 'padding', get: function get() { return this._padding; }, - set: function set(padding) { + set: function set(padding) // eslint-disable-line require-jsdoc + { if (this._padding !== padding) { this._padding = padding; this.styleID++; } } + + /** + * A canvas fillstyle that will be used on the text stroke + * e.g 'blue', '#FCFF00' + * + * @member {string|number} + */ + }, { key: 'stroke', get: function get() { return this._stroke; }, - set: function set(stroke) { + set: function set(stroke) // eslint-disable-line require-jsdoc + { var outputColor = getColor(stroke); if (this._stroke !== outputColor) { this._stroke = outputColor; this.styleID++; } } + + /** + * A number that represents the thickness of the stroke. + * Default is 0 (no stroke) + * + * @member {number} + */ + }, { key: 'strokeThickness', get: function get() { return this._strokeThickness; }, - set: function set(strokeThickness) { + set: function set(strokeThickness) // eslint-disable-line require-jsdoc + { if (this._strokeThickness !== strokeThickness) { this._strokeThickness = strokeThickness; this.styleID++; } } + + /** + * The baseline of the text that is rendered. + * + * @member {string} + */ + }, { key: 'textBaseline', get: function get() { return this._textBaseline; }, - set: function set(textBaseline) { + set: function set(textBaseline) // eslint-disable-line require-jsdoc + { if (this._textBaseline !== textBaseline) { this._textBaseline = textBaseline; this.styleID++; } } + + /** + * Trim transparent borders + * + * @member {boolean} + */ + + }, { + key: 'trim', + get: function get() { + return this._trim; + }, + set: function set(trim) // eslint-disable-line require-jsdoc + { + if (this._trim !== trim) { + this._trim = trim; + this.styleID++; + } + } + + /** + * Indicates if word wrap should be used + * + * @member {boolean} + */ + }, { key: 'wordWrap', get: function get() { return this._wordWrap; }, - set: function set(wordWrap) { + set: function set(wordWrap) // eslint-disable-line require-jsdoc + { if (this._wordWrap !== wordWrap) { this._wordWrap = wordWrap; this.styleID++; } } + + /** + * The width at which text will wrap, it needs wordWrap to be set to true + * + * @member {number} + */ + }, { key: 'wordWrapWidth', get: function get() { return this._wordWrapWidth; }, - set: function set(wordWrapWidth) { + set: function set(wordWrapWidth) // eslint-disable-line require-jsdoc + { if (this._wordWrapWidth !== wordWrapWidth) { this._wordWrapWidth = wordWrapWidth; this.styleID++; @@ -29971,10 +32106,36 @@ function getColor(color) { return color; } } + +/** + * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string. + * This version can also convert array of colors + * + * @param {Array} array1 First array to compare + * @param {Array} array2 Second array to compare + * @return {boolean} Do the arrays contain the same values in the same order + */ +function areArraysEqual(array1, array2) { + if (!Array.isArray(array1) || !Array.isArray(array2)) { + return false; + } + + if (array1.length !== array2.length) { + return false; + } + + for (var i = 0; i < array1.length; ++i) { + if (array1[i] !== array2[i]) { + return false; + } + } + + return true; +} //# sourceMappingURL=TextStyle.js.map /***/ }), -/* 248 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -29982,11 +32143,11 @@ function getColor(color) { exports.__esModule = true; -var _BaseTexture2 = __webpack_require__(56); +var _BaseTexture2 = __webpack_require__(48); var _BaseTexture3 = _interopRequireDefault(_BaseTexture2); -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); @@ -29998,11 +32159,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var RESOLUTION = _settings2.default.RESOLUTION, - SCALE_MODE = _settings2.default.SCALE_MODE; - /** - * A BaseRenderTexture is a special texture that allows any Pixi display object to be rendered to it. + * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it. * * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded * otherwise black rectangles will be drawn instead. @@ -30040,7 +32198,6 @@ var RESOLUTION = _settings2.default.RESOLUTION, * @extends PIXI.BaseTexture * @memberof PIXI */ - var BaseRenderTexture = function (_BaseTexture) { _inherits(BaseRenderTexture, _BaseTexture); @@ -30060,7 +32217,7 @@ var BaseRenderTexture = function (_BaseTexture) { var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, null, scaleMode)); - _this.resolution = resolution || RESOLUTION; + _this.resolution = resolution || _settings2.default.RESOLUTION; _this.width = width; _this.height = height; @@ -30068,7 +32225,7 @@ var BaseRenderTexture = function (_BaseTexture) { _this.realWidth = _this.width * _this.resolution; _this.realHeight = _this.height * _this.resolution; - _this.scaleMode = scaleMode || SCALE_MODE; + _this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE; _this.hasLoaded = true; /** @@ -30142,7 +32299,7 @@ exports.default = BaseRenderTexture; //# sourceMappingURL=BaseRenderTexture.js.map /***/ }), -/* 249 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30150,7 +32307,7 @@ exports.default = BaseRenderTexture; exports.__esModule = true; -var _GroupD = __webpack_require__(239); +var _GroupD = __webpack_require__(241); var _GroupD2 = _interopRequireDefault(_GroupD); @@ -30252,7 +32409,7 @@ exports.default = TextureUvs; //# sourceMappingURL=TextureUvs.js.map /***/ }), -/* 250 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -30262,17 +32419,15 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _BaseTexture2 = __webpack_require__(56); +var _BaseTexture2 = __webpack_require__(48); var _BaseTexture3 = _interopRequireDefault(_BaseTexture2); -var _utils = __webpack_require__(5); +var _utils = __webpack_require__(3); -var _ticker = __webpack_require__(252); - -var ticker = _interopRequireWildcard(_ticker); +var _ticker = __webpack_require__(131); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _const = __webpack_require__(0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -30285,7 +32440,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * A texture of a [playing] Video. * - * Video base textures mimic Pixi BaseTexture.from.... method in their creation process. + * Video base textures mimic PixiJS BaseTexture.from.... method in their creation process. * * This can be used in several ways, such as: * @@ -30403,7 +32558,7 @@ var VideoBaseTexture = function (_BaseTexture) { } if (!this._isAutoUpdating && this.autoUpdate) { - ticker.shared.add(this.update, this); + _ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH); this._isAutoUpdating = true; } }; @@ -30417,7 +32572,7 @@ var VideoBaseTexture = function (_BaseTexture) { VideoBaseTexture.prototype._onPlayStop = function _onPlayStop() { if (this._isAutoUpdating) { - ticker.shared.remove(this.update, this); + _ticker.shared.remove(this.update, this); this._isAutoUpdating = false; } }; @@ -30461,11 +32616,11 @@ var VideoBaseTexture = function (_BaseTexture) { VideoBaseTexture.prototype.destroy = function destroy() { if (this._isAutoUpdating) { - ticker.shared.remove(this.update, this); + _ticker.shared.remove(this.update, this); } if (this.source && this.source._pixiId) { - delete _utils.BaseTextureCache[this.source._pixiId]; + _BaseTexture3.default.removeFromCache(this.source._pixiId); delete this.source._pixiId; } @@ -30473,7 +32628,7 @@ var VideoBaseTexture = function (_BaseTexture) { }; /** - * Mimic Pixi BaseTexture.from.... method. + * Mimic PixiJS BaseTexture.from.... method. * * @static * @param {HTMLVideoElement} video - Video to create texture from @@ -30491,7 +32646,7 @@ var VideoBaseTexture = function (_BaseTexture) { if (!baseTexture) { baseTexture = new VideoBaseTexture(video, scaleMode); - _utils.BaseTextureCache[video._pixiId] = baseTexture; + _BaseTexture3.default.addToCache(baseTexture, video._pixiId); } return baseTexture; @@ -30551,10 +32706,10 @@ var VideoBaseTexture = function (_BaseTexture) { this._autoUpdate = value; if (!this._autoUpdate && this._isAutoUpdating) { - ticker.shared.remove(this.update, this); + _ticker.shared.remove(this.update, this); this._isAutoUpdating = false; } else if (this._autoUpdate && !this._isAutoUpdating) { - ticker.shared.add(this.update, this); + _ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH); this._isAutoUpdating = true; } } @@ -30584,827 +32739,288 @@ function createSource(path, type) { //# sourceMappingURL=VideoBaseTexture.js.map /***/ }), -/* 251 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.BitmapText = exports.TilingSpriteRenderer = exports.TilingSprite = exports.TextureTransform = exports.AnimatedSprite = undefined; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _settings = __webpack_require__(10); - -var _settings2 = _interopRequireDefault(_settings); +var _AnimatedSprite = __webpack_require__(567); -var _eventemitter = __webpack_require__(24); +Object.defineProperty(exports, 'AnimatedSprite', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_AnimatedSprite).default; + } +}); -var _eventemitter2 = _interopRequireDefault(_eventemitter); +var _TextureTransform = __webpack_require__(133); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +Object.defineProperty(exports, 'TextureTransform', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TextureTransform).default; + } +}); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _TilingSprite = __webpack_require__(569); -// Internal event used by composed emitter -var TICK = 'tick'; +Object.defineProperty(exports, 'TilingSprite', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TilingSprite).default; + } +}); -/** - * A Ticker class that runs an update loop that other objects listen to. - * This class is composed around an EventEmitter object to add listeners - * meant for execution on the next requested animation frame. - * Animation frames are requested only when necessary, - * e.g. When the ticker is started and the emitter has listeners. - * - * @class - * @memberof PIXI.ticker - */ +var _TilingSpriteRenderer = __webpack_require__(573); -var Ticker = function () { - /** - * - */ - function Ticker() { - var _this = this; +Object.defineProperty(exports, 'TilingSpriteRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TilingSpriteRenderer).default; + } +}); - _classCallCheck(this, Ticker); +var _BitmapText = __webpack_require__(568); - /** - * Internal emitter used to fire 'tick' event - * @private - */ - this._emitter = new _eventemitter2.default(); +Object.defineProperty(exports, 'BitmapText', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BitmapText).default; + } +}); - /** - * Internal current frame request ID - * @private - */ - this._requestId = null; +__webpack_require__(570); - /** - * Internal value managed by minFPS property setter and getter. - * This is the maximum allowed milliseconds between updates. - * @private - */ - this._maxElapsedMS = 100; +__webpack_require__(571); - /** - * Whether or not this ticker should invoke the method - * {@link PIXI.ticker.Ticker#start} automatically - * when a listener is added. - * - * @member {boolean} - * @default false - */ - this.autoStart = false; +__webpack_require__(572); - /** - * Scalar time value from last frame to this frame. - * This value is capped by setting {@link PIXI.ticker.Ticker#minFPS} - * and is scaled with {@link PIXI.ticker.Ticker#speed}. - * **Note:** The cap may be exceeded by scaling. - * - * @member {number} - * @default 1 - */ - this.deltaTime = 1; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Time elapsed in milliseconds from last frame to this frame. - * Opposed to what the scalar {@link PIXI.ticker.Ticker#deltaTime} - * is based, this value is neither capped nor scaled. - * If the platform supports DOMHighResTimeStamp, - * this value will have a precision of 1 µs. - * - * @member {number} - * @default 1 / TARGET_FPMS - */ - this.elapsedMS = 1 / _settings2.default.TARGET_FPMS; // default to target frame time +// imported for side effect of extending the prototype only, contains no exports +//# sourceMappingURL=index.js.map - /** - * The last time {@link PIXI.ticker.Ticker#update} was invoked. - * This value is also reset internally outside of invoking - * update, but only when a new animation frame is requested. - * If the platform supports DOMHighResTimeStamp, - * this value will have a precision of 1 µs. - * - * @member {number} - * @default 0 - */ - this.lastTime = 0; +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { - /** - * Factor of current {@link PIXI.ticker.Ticker#deltaTime}. - * @example - * // Scales ticker.deltaTime to what would be - * // the equivalent of approximately 120 FPS - * ticker.speed = 2; - * - * @member {number} - * @default 1 - */ - this.speed = 1; +"use strict"; - /** - * Whether or not this ticker has been started. - * `true` if {@link PIXI.ticker.Ticker#start} has been called. - * `false` if {@link PIXI.ticker.Ticker#stop} has been called. - * While `false`, this value may change to `true` in the - * event of {@link PIXI.ticker.Ticker#autoStart} being `true` - * and a listener is added. - * - * @member {boolean} - * @default false - */ - this.started = false; - /** - * Internal tick method bound to ticker instance. - * This is because in early 2015, Function.bind - * is still 60% slower in high performance scenarios. - * Also separating frame requests from update method - * so listeners may be called at any time and with - * any animation API, just invoke ticker.update(time). - * - * @private - * @param {number} time - Time since last tick. - */ - this._tick = function (time) { - _this._requestId = null; +exports.__esModule = true; - if (_this.started) { - // Invoke listeners now - _this.update(time); - // Listener side effects may have modified ticker state. - if (_this.started && _this._requestId === null && _this._emitter.listeners(TICK, true)) { - _this._requestId = requestAnimationFrame(_this._tick); - } - } - }; - } +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - /** - * Conditionally requests a new animation frame. - * If a frame has not already been requested, and if the internal - * emitter has listeners, a new frame is requested. - * - * @private - */ +var _core = __webpack_require__(1); +var core = _interopRequireWildcard(_core); - Ticker.prototype._requestIfNeeded = function _requestIfNeeded() { - if (this._requestId === null && this._emitter.listeners(TICK, true)) { - // ensure callbacks get correct delta - this.lastTime = performance.now(); - this._requestId = requestAnimationFrame(this._tick); - } - }; +var _generateBlurVertSource = __webpack_require__(258); - /** - * Conditionally cancels a pending animation frame. - * - * @private - */ +var _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource); +var _generateBlurFragSource = __webpack_require__(257); - Ticker.prototype._cancelIfNeeded = function _cancelIfNeeded() { - if (this._requestId !== null) { - cancelAnimationFrame(this._requestId); - this._requestId = null; - } - }; +var _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource); - /** - * Conditionally requests a new animation frame. - * If the ticker has been started it checks if a frame has not already - * been requested, and if the internal emitter has listeners. If these - * conditions are met, a new frame is requested. If the ticker has not - * been started, but autoStart is `true`, then the ticker starts now, - * and continues with the previous conditions to request a new frame. - * - * @private - */ +var _getMaxBlurKernelSize = __webpack_require__(259); +var _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize); - Ticker.prototype._startIfPossible = function _startIfPossible() { - if (this.started) { - this._requestIfNeeded(); - } else if (this.autoStart) { - this.start(); - } - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * Calls {@link module:eventemitter3.EventEmitter#on} internally for the - * internal 'tick' event. It checks if the emitter has listeners, - * and if so it requests a new animation frame at this point. - * - * @param {Function} fn - The listener function to be added for updates - * @param {Function} [context] - The listener context - * @returns {PIXI.ticker.Ticker} This instance of a ticker - */ +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - Ticker.prototype.add = function add(fn, context) { - this._emitter.on(TICK, fn, context); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - this._startIfPossible(); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - return this; - }; +/** + * The BlurXFilter applies a horizontal Gaussian blur to an object. + * + * @class + * @extends PIXI.Filter + * @memberof PIXI.filters + */ +var BlurXFilter = function (_core$Filter) { + _inherits(BlurXFilter, _core$Filter); /** - * Calls {@link module:eventemitter3.EventEmitter#once} internally for the - * internal 'tick' event. It checks if the emitter has listeners, - * and if so it requests a new animation frame at this point. - * - * @param {Function} fn - The listener function to be added for one update - * @param {Function} [context] - The listener context - * @returns {PIXI.ticker.Ticker} This instance of a ticker + * @param {number} strength - The strength of the blur filter. + * @param {number} quality - The quality of the blur filter. + * @param {number} resolution - The resolution of the blur filter. + * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. */ + function BlurXFilter(strength, quality, resolution, kernelSize) { + _classCallCheck(this, BlurXFilter); + kernelSize = kernelSize || 5; + var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, true); + var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize); - Ticker.prototype.addOnce = function addOnce(fn, context) { - this._emitter.once(TICK, fn, context); - - this._startIfPossible(); - - return this; - }; - - /** - * Calls {@link module:eventemitter3.EventEmitter#off} internally for 'tick' event. - * It checks if the emitter has listeners for 'tick' event. - * If it does, then it cancels the animation frame. - * - * @param {Function} [fn] - The listener function to be removed - * @param {Function} [context] - The listener context to be removed - * @returns {PIXI.ticker.Ticker} This instance of a ticker - */ + var _this = _possibleConstructorReturn(this, _core$Filter.call(this, + // vertex shader + vertSrc, + // fragment shader + fragSrc)); + _this.resolution = resolution || core.settings.RESOLUTION; - Ticker.prototype.remove = function remove(fn, context) { - this._emitter.off(TICK, fn, context); + _this._quality = 0; - if (!this._emitter.listeners(TICK, true)) { - this._cancelIfNeeded(); - } + _this.quality = quality || 4; + _this.strength = strength || 8; - return this; - }; + _this.firstRun = true; + return _this; + } /** - * Starts the ticker. If the ticker has listeners - * a new animation frame is requested at this point. + * Applies the filter. + * + * @param {PIXI.FilterManager} filterManager - The manager. + * @param {PIXI.RenderTarget} input - The input target. + * @param {PIXI.RenderTarget} output - The output target. + * @param {boolean} clear - Should the output be cleared before rendering? */ - Ticker.prototype.start = function start() { - if (!this.started) { - this.started = true; - this._requestIfNeeded(); - } - }; - - /** - * Stops the ticker. If the ticker has requested - * an animation frame it is canceled at this point. - */ + BlurXFilter.prototype.apply = function apply(filterManager, input, output, clear) { + if (this.firstRun) { + var gl = filterManager.renderer.gl; + var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl); + this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, true); + this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize); - Ticker.prototype.stop = function stop() { - if (this.started) { - this.started = false; - this._cancelIfNeeded(); + this.firstRun = false; } - }; - - /** - * Triggers an update. An update entails setting the - * current {@link PIXI.ticker.Ticker#elapsedMS}, - * the current {@link PIXI.ticker.Ticker#deltaTime}, - * invoking all listeners with current deltaTime, - * and then finally setting {@link PIXI.ticker.Ticker#lastTime} - * with the value of currentTime that was provided. - * This method will be called automatically by animation - * frame callbacks if the ticker instance has been started - * and listeners are added. - * - * @param {number} [currentTime=performance.now()] - the current time of execution - */ + this.uniforms.strength = 1 / output.size.width * (output.size.width / input.size.width); - Ticker.prototype.update = function update() { - var currentTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now(); + // screen space! + this.uniforms.strength *= this.strength; + this.uniforms.strength /= this.passes; // / this.passes//Math.pow(1, this.passes); - var elapsedMS = void 0; + if (this.passes === 1) { + filterManager.applyFilter(this, input, output, clear); + } else { + var renderTarget = filterManager.getRenderTarget(true); + var flip = input; + var flop = renderTarget; - // If the difference in time is zero or negative, we ignore most of the work done here. - // If there is no valid difference, then should be no reason to let anyone know about it. - // A zero delta, is exactly that, nothing should update. - // - // The difference in time can be negative, and no this does not mean time traveling. - // This can be the result of a race condition between when an animation frame is requested - // on the current JavaScript engine event loop, and when the ticker's start method is invoked - // (which invokes the internal _requestIfNeeded method). If a frame is requested before - // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests, - // can receive a time argument that can be less than the lastTime value that was set within - // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems. - // - // This check covers this browser engine timing issue, as well as if consumers pass an invalid - // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves. + for (var i = 0; i < this.passes - 1; i++) { + filterManager.applyFilter(this, flip, flop, true); - if (currentTime > this.lastTime) { - // Save uncapped elapsedMS for measurement - elapsedMS = this.elapsedMS = currentTime - this.lastTime; + var temp = flop; - // cap the milliseconds elapsed used for deltaTime - if (elapsedMS > this._maxElapsedMS) { - elapsedMS = this._maxElapsedMS; + flop = flip; + flip = temp; } - this.deltaTime = elapsedMS * _settings2.default.TARGET_FPMS * this.speed; + filterManager.applyFilter(this, flip, output, clear); - // Invoke listeners added to internal emitter - this._emitter.emit(TICK, this.deltaTime); - } else { - this.deltaTime = this.elapsedMS = 0; + filterManager.returnRenderTarget(renderTarget); } - - this.lastTime = currentTime; }; /** - * The frames per second at which this ticker is running. - * The default is approximately 60 in most modern browsers. - * **Note:** This does not factor in the value of - * {@link PIXI.ticker.Ticker#speed}, which is specific - * to scaling {@link PIXI.ticker.Ticker#deltaTime}. + * Sets the strength of both the blur. * * @member {number} - * @readonly + * @default 16 */ - _createClass(Ticker, [{ - key: 'FPS', + _createClass(BlurXFilter, [{ + key: 'blur', get: function get() { - return 1000 / this.elapsedMS; + return this.strength; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this.padding = Math.abs(value) * 2; + this.strength = value; } /** - * Manages the maximum amount of milliseconds allowed to - * elapse between invoking {@link PIXI.ticker.Ticker#update}. - * This value is used to cap {@link PIXI.ticker.Ticker#deltaTime}, - * but does not effect the measured value of {@link PIXI.ticker.Ticker#FPS}. - * When setting this property it is clamped to a value between - * `0` and `PIXI.settings.TARGET_FPMS * 1000`. - * - * @member {number} - * @default 10 - */ + * Sets the quality of the blur by modifying the number of passes. More passes means higher + * quaility bluring but the lower the performance. + * + * @member {number} + * @default 4 + */ }, { - key: 'minFPS', + key: 'quality', get: function get() { - return 1000 / this._maxElapsedMS; + return this._quality; }, - set: function set(fps) // eslint-disable-line require-jsdoc + set: function set(value) // eslint-disable-line require-jsdoc { - // Clamp: 0 to TARGET_FPMS - var minFPMS = Math.min(Math.max(0, fps) / 1000, _settings2.default.TARGET_FPMS); - - this._maxElapsedMS = 1 / minFPMS; + this._quality = value; + this.passes = value; } }]); - return Ticker; -}(); + return BlurXFilter; +}(core.Filter); -exports.default = Ticker; -//# sourceMappingURL=Ticker.js.map +exports.default = BlurXFilter; +//# sourceMappingURL=BlurXFilter.js.map /***/ }), -/* 252 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.Ticker = exports.shared = undefined; - -var _Ticker = __webpack_require__(251); - -var _Ticker2 = _interopRequireDefault(_Ticker); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The shared ticker instance used by {@link PIXI.extras.AnimatedSprite}. - * and by {@link PIXI.interaction.InteractionManager}. - * The property {@link PIXI.ticker.Ticker#autoStart} is set to `true` - * for this instance. Please follow the examples for usage, including - * how to opt-out of auto-starting the shared ticker. - * - * @example - * let ticker = PIXI.ticker.shared; - * // Set this to prevent starting this ticker when listeners are added. - * // By default this is true only for the PIXI.ticker.shared instance. - * ticker.autoStart = false; - * // FYI, call this to ensure the ticker is stopped. It should be stopped - * // if you have not attempted to render anything yet. - * ticker.stop(); - * // Call this when you are ready for a running shared ticker. - * ticker.start(); - * - * @example - * // You may use the shared ticker to render... - * let renderer = PIXI.autoDetectRenderer(800, 600); - * let stage = new PIXI.Container(); - * let interactionManager = PIXI.interaction.InteractionManager(renderer); - * document.body.appendChild(renderer.view); - * ticker.add(function (time) { - * renderer.render(stage); - * }); - * - * @example - * // Or you can just update it manually. - * ticker.autoStart = false; - * ticker.stop(); - * function animate(time) { - * ticker.update(time); - * renderer.render(stage); - * requestAnimationFrame(animate); - * } - * animate(performance.now()); - * - * @type {PIXI.ticker.Ticker} - * @memberof PIXI.ticker - */ -var shared = new _Ticker2.default(); -shared.autoStart = true; +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/** - * @namespace PIXI.ticker - */ -exports.shared = shared; -exports.Ticker = _Ticker2.default; -//# sourceMappingURL=index.js.map +var _core = __webpack_require__(1); -/***/ }), -/* 253 */ -/***/ (function(module, exports, __webpack_require__) { +var core = _interopRequireWildcard(_core); -"use strict"; +var _generateBlurVertSource = __webpack_require__(258); +var _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource); -exports.__esModule = true; +var _generateBlurFragSource = __webpack_require__(257); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +var _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource); -var _Matrix = __webpack_require__(125); +var _getMaxBlurKernelSize = __webpack_require__(259); -var _Matrix2 = _interopRequireDefault(_Matrix); +var _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var tempMat = new _Matrix2.default(); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * class controls uv transform and frame clamp for texture + * The BlurYFilter applies a horizontal Gaussian blur to an object. * * @class - * @memberof PIXI.extras + * @extends PIXI.Filter + * @memberof PIXI.filters */ - -var TextureTransform = function () { - /** - * - * @param {PIXI.Texture} texture observed texture - * @param {number} [clampMargin] Changes frame clamping, 0.5 by default. Use -0.5 for extra border. - * @constructor - */ - function TextureTransform(texture, clampMargin) { - _classCallCheck(this, TextureTransform); - - this._texture = texture; - - this.mapCoord = new _Matrix2.default(); - - this.uClampFrame = new Float32Array(4); - - this.uClampOffset = new Float32Array(2); - - this._lastTextureID = -1; - - /** - * Changes frame clamping - * Works with TilingSprite and Mesh - * Change to 1.5 if you texture has repeated right and bottom lines, that leads to smoother borders - * - * @default 0 - * @member {number} - */ - this.clampOffset = 0; - - /** - * Changes frame clamping - * Works with TilingSprite and Mesh - * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas - * - * @default 0.5 - * @member {number} - */ - this.clampMargin = typeof clampMargin === 'undefined' ? 0.5 : clampMargin; - } - - /** - * texture property - * @member {PIXI.Texture} - */ - - - /** - * updates matrices if texture was changed - * @param {boolean} forceUpdate if true, matrices will be updated any case - */ - TextureTransform.prototype.update = function update(forceUpdate) { - var tex = this._texture; - - if (!tex || !tex.valid) { - return; - } - - if (!forceUpdate && this._lastTextureID === tex._updateID) { - return; - } - - this._lastTextureID = tex._updateID; - - var uvs = tex._uvs; - - this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0); - - var orig = tex.orig; - var trim = tex.trim; - - if (trim) { - tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height); - this.mapCoord.append(tempMat); - } - - var texBase = tex.baseTexture; - var frame = this.uClampFrame; - var margin = this.clampMargin / texBase.resolution; - var offset = this.clampOffset; - - frame[0] = (tex._frame.x + margin + offset) / texBase.width; - frame[1] = (tex._frame.y + margin + offset) / texBase.height; - frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width; - frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height; - this.uClampOffset[0] = offset / texBase.realWidth; - this.uClampOffset[1] = offset / texBase.realHeight; - }; - - _createClass(TextureTransform, [{ - key: 'texture', - get: function get() { - return this._texture; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - this._texture = value; - this._lastTextureID = -1; - } - }]); - - return TextureTransform; -}(); - -exports.default = TextureTransform; -//# sourceMappingURL=TextureTransform.js.map - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _core = __webpack_require__(0); - -var core = _interopRequireWildcard(_core); - -var _generateBlurVertSource = __webpack_require__(257); - -var _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource); - -var _generateBlurFragSource = __webpack_require__(256); - -var _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource); - -var _getMaxBlurKernelSize = __webpack_require__(258); - -var _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * The BlurXFilter applies a horizontal Gaussian blur to an object. - * - * @class - * @extends PIXI.Filter - * @memberof PIXI.filters - */ -var BlurXFilter = function (_core$Filter) { - _inherits(BlurXFilter, _core$Filter); - - /** - * @param {number} strength - The strength of the blur filter. - * @param {number} quality - The quality of the blur filter. - * @param {number} resolution - The resolution of the blur filter. - * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15. - */ - function BlurXFilter(strength, quality, resolution, kernelSize) { - _classCallCheck(this, BlurXFilter); - - kernelSize = kernelSize || 5; - var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, true); - var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize); - - var _this = _possibleConstructorReturn(this, _core$Filter.call(this, - // vertex shader - vertSrc, - // fragment shader - fragSrc)); - - _this.resolution = resolution || 1; - - _this._quality = 0; - - _this.quality = quality || 4; - _this.strength = strength || 8; - - _this.firstRun = true; - return _this; - } - - /** - * Applies the filter. - * - * @param {PIXI.FilterManager} filterManager - The manager. - * @param {PIXI.RenderTarget} input - The input target. - * @param {PIXI.RenderTarget} output - The output target. - * @param {boolean} clear - Should the output be cleared before rendering? - */ - - - BlurXFilter.prototype.apply = function apply(filterManager, input, output, clear) { - if (this.firstRun) { - var gl = filterManager.renderer.gl; - var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl); - - this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, true); - this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize); - - this.firstRun = false; - } - - this.uniforms.strength = 1 / output.size.width * (output.size.width / input.size.width); - - // screen space! - this.uniforms.strength *= this.strength; - this.uniforms.strength /= this.passes; // / this.passes//Math.pow(1, this.passes); - - if (this.passes === 1) { - filterManager.applyFilter(this, input, output, clear); - } else { - var renderTarget = filterManager.getRenderTarget(true); - var flip = input; - var flop = renderTarget; - - for (var i = 0; i < this.passes - 1; i++) { - filterManager.applyFilter(this, flip, flop, true); - - var temp = flop; - - flop = flip; - flip = temp; - } - - filterManager.applyFilter(this, flip, output, clear); - - filterManager.returnRenderTarget(renderTarget); - } - }; - - /** - * Sets the strength of both the blur. - * - * @member {number} - * @default 16 - */ - - - _createClass(BlurXFilter, [{ - key: 'blur', - get: function get() { - return this.strength; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - this.padding = Math.abs(value) * 2; - this.strength = value; - } - - /** - * Sets the quality of the blur by modifying the number of passes. More passes means higher - * quaility bluring but the lower the performance. - * - * @member {number} - * @default 4 - */ - - }, { - key: 'quality', - get: function get() { - return this._quality; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - this._quality = value; - this.passes = value; - } - }]); - - return BlurXFilter; -}(core.Filter); - -exports.default = BlurXFilter; -//# sourceMappingURL=BlurXFilter.js.map - -/***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _core = __webpack_require__(0); - -var core = _interopRequireWildcard(_core); - -var _generateBlurVertSource = __webpack_require__(257); - -var _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource); - -var _generateBlurFragSource = __webpack_require__(256); - -var _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource); - -var _getMaxBlurKernelSize = __webpack_require__(258); - -var _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * The BlurYFilter applies a horizontal Gaussian blur to an object. - * - * @class - * @extends PIXI.Filter - * @memberof PIXI.filters - */ -var BlurYFilter = function (_core$Filter) { - _inherits(BlurYFilter, _core$Filter); +var BlurYFilter = function (_core$Filter) { + _inherits(BlurYFilter, _core$Filter); /** * @param {number} strength - The strength of the blur filter. @@ -31425,7 +33041,7 @@ var BlurYFilter = function (_core$Filter) { // fragment shader fragSrc)); - _this.resolution = resolution || 1; + _this.resolution = resolution || core.settings.RESOLUTION; _this._quality = 0; @@ -31530,7 +33146,7 @@ exports.default = BlurYFilter; //# sourceMappingURL=BlurYFilter.js.map /***/ }), -/* 256 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31582,7 +33198,7 @@ function generateFragBlurSource(kernelSize) { //# sourceMappingURL=generateBlurFragSource.js.map /***/ }), -/* 257 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31631,7 +33247,7 @@ function generateVertBlurSource(kernelSize, x) { //# sourceMappingURL=generateBlurVertSource.js.map /***/ }), -/* 258 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31651,90 +33267,6 @@ function getMaxKernelSize(gl) { } //# sourceMappingURL=getMaxBlurKernelSize.js.map -/***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _FXAAFilter = __webpack_require__(573); - -Object.defineProperty(exports, 'FXAAFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_FXAAFilter).default; - } -}); - -var _NoiseFilter = __webpack_require__(574); - -Object.defineProperty(exports, 'NoiseFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_NoiseFilter).default; - } -}); - -var _DisplacementFilter = __webpack_require__(572); - -Object.defineProperty(exports, 'DisplacementFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_DisplacementFilter).default; - } -}); - -var _BlurFilter = __webpack_require__(570); - -Object.defineProperty(exports, 'BlurFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_BlurFilter).default; - } -}); - -var _BlurXFilter = __webpack_require__(254); - -Object.defineProperty(exports, 'BlurXFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_BlurXFilter).default; - } -}); - -var _BlurYFilter = __webpack_require__(255); - -Object.defineProperty(exports, 'BlurYFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_BlurYFilter).default; - } -}); - -var _ColorMatrixFilter = __webpack_require__(571); - -Object.defineProperty(exports, 'ColorMatrixFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ColorMatrixFilter).default; - } -}); - -var _VoidFilter = __webpack_require__(575); - -Object.defineProperty(exports, 'VoidFilter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_VoidFilter).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map - /***/ }), /* 260 */ /***/ (function(module, exports, __webpack_require__) { @@ -31744,7 +33276,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de exports.__esModule = true; -var _core = __webpack_require__(0); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -31773,20 +33307,125 @@ var InteractionData = function () { this.global = new core.Point(); /** - * The target Sprite that was interacted with + * The target DisplayObject that was interacted with * - * @member {PIXI.Sprite} + * @member {PIXI.DisplayObject} */ this.target = null; /** * When passed to an event handler, this will be the original DOM Event that was captured * - * @member {Event} + * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent + * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent + * @member {MouseEvent|TouchEvent|PointerEvent} */ this.originalEvent = null; + + /** + * Unique identifier for this interaction + * + * @member {number} + */ + this.identifier = null; + + /** + * Indicates whether or not the pointer device that created the event is the primary pointer. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary + * @type {Boolean} + */ + this.isPrimary = false; + + /** + * Indicates which button was pressed on the mouse or pointer device to trigger the event. + * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button + * @type {number} + */ + this.button = 0; + + /** + * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered. + * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons + * @type {number} + */ + this.buttons = 0; + + /** + * The width of the pointer's contact along the x-axis, measured in CSS pixels. + * radiusX of TouchEvents will be represented by this value. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width + * @type {number} + */ + this.width = 0; + + /** + * The height of the pointer's contact along the y-axis, measured in CSS pixels. + * radiusY of TouchEvents will be represented by this value. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height + * @type {number} + */ + this.height = 0; + + /** + * The angle, in degrees, between the pointer device and the screen. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX + * @type {number} + */ + this.tiltX = 0; + + /** + * The angle, in degrees, between the pointer device and the screen. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY + * @type {number} + */ + this.tiltY = 0; + + /** + * The type of pointer that triggered the event. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType + * @type {string} + */ + this.pointerType = null; + + /** + * Pressure applied by the pointing device during the event. A Touch's force property + * will be represented by this value. + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure + * @type {number} + */ + this.pressure = 0; + + /** + * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch. + * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle + * @type {number} + */ + this.rotationAngle = 0; + + /** + * Twist of a stylus pointer. + * @see https://w3c.github.io/pointerevents/#pointerevent-interface + * @type {number} + */ + this.twist = 0; + + /** + * Barrel pressure on a stylus pointer. + * @see https://w3c.github.io/pointerevents/#pointerevent-interface + * @type {number} + */ + this.tangentialPressure = 0; } + /** + * The unique identifier of the pointer. It will be the same as `identifier`. + * @readonly + * @member {number} + * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId + */ + + /** * This will return the local coordinates of the specified displayObject for this InteractionData * @@ -31799,12 +33438,58 @@ var InteractionData = function () { * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative * to the DisplayObject */ - - InteractionData.prototype.getLocalPosition = function getLocalPosition(displayObject, point, globalPos) { return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; + /** + * Copies properties from normalized event data. + * + * @param {Touch|MouseEvent|PointerEvent} event The normalized event data + * @private + */ + + + InteractionData.prototype._copyEvent = function _copyEvent(event) { + // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite + // it with "false" on later events when our shim for it on touch events might not be + // accurate + if (event.isPrimary) { + this.isPrimary = true; + } + this.button = event.button; + this.buttons = event.buttons; + this.width = event.width; + this.height = event.height; + this.tiltX = event.tiltX; + this.tiltY = event.tiltY; + this.pointerType = event.pointerType; + this.pressure = event.pressure; + this.rotationAngle = event.rotationAngle; + this.twist = event.twist || 0; + this.tangentialPressure = event.tangentialPressure || 0; + }; + + /** + * Resets the data for pooling. + * + * @private + */ + + + InteractionData.prototype._reset = function _reset() { + // isPrimary is the only property that we really need to reset - everything else is + // guaranteed to be overwritten + this.isPrimary = false; + }; + + _createClass(InteractionData, [{ + key: 'pointerId', + get: function get() { + return this.identifier; + } + }]); + return InteractionData; }(); @@ -31819,115 +33504,393 @@ exports.default = InteractionData; exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /** - * Default property values of interactive objects - * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties + * Event class that mimics native DOM events. * - * @mixin - * @name interactiveTarget + * @class * @memberof PIXI.interaction - * @example - * function MyObject() {} - * - * Object.assign( - * MyObject.prototype, - * PIXI.interaction.interactiveTarget - * ); */ -exports.default = { +var InteractionEvent = function () { /** - * Determines if the displayObject be clicked/touched * - * @inner {boolean} */ - interactive: false, + function InteractionEvent() { + _classCallCheck(this, InteractionEvent); - /** - * Determines if the children to the displayObject can be clicked/touched - * Setting this to false allows pixi to bypass a recursive hitTest function - * - * @inner {boolean} - */ - interactiveChildren: true, + /** + * Whether this event will continue propagating in the tree + * + * @member {boolean} + */ + this.stopped = false; - /** - * Interaction shape. Children will be hit first, then this shape will be checked. - * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. + /** + * The object which caused this event to be dispatched. + * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}. + * + * @member {PIXI.DisplayObject} + */ + this.target = null; + + /** + * The object whose event listener’s callback is currently being invoked. + * + * @member {PIXI.DisplayObject} + */ + this.currentTarget = null; + + /** + * Type of the event + * + * @member {string} + */ + this.type = null; + + /** + * InteractionData related to this event + * + * @member {PIXI.interaction.InteractionData} + */ + this.data = null; + } + + /** + * Prevents event from reaching any objects other than the current object. * - * @inner {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} */ - hitArea: null, + + + InteractionEvent.prototype.stopPropagation = function stopPropagation() { + this.stopped = true; + }; /** - * If enabled, the mouse cursor will change when hovered over the displayObject if it is interactive + * Resets the event. * - * @inner {boolean} + * @private */ - buttonMode: false, + + + InteractionEvent.prototype._reset = function _reset() { + this.stopped = false; + this.currentTarget = null; + this.target = null; + }; + + return InteractionEvent; +}(); + +exports.default = InteractionEvent; +//# sourceMappingURL=InteractionEvent.js.map + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * DisplayObjects with the {@link PIXI.interaction.interactiveTarget} mixin use this class to track interactions + * + * @class + * @private + * @memberof PIXI.interaction + */ +var InteractionTrackingData = function () { + /** + * @param {number} pointerId - Unique pointer id of the event + */ + function InteractionTrackingData(pointerId) { + _classCallCheck(this, InteractionTrackingData); + + this._pointerId = pointerId; + this._flags = InteractionTrackingData.FLAGS.NONE; + } + + /** + * + * @private + * @param {number} flag - The interaction flag to set + * @param {boolean} yn - Should the flag be set or unset + */ + + + InteractionTrackingData.prototype._doSet = function _doSet(flag, yn) { + if (yn) { + this._flags = this._flags | flag; + } else { + this._flags = this._flags & ~flag; + } + }; + + /** + * Unique pointer id of the event + * + * @readonly + * @member {number} + */ + + + _createClass(InteractionTrackingData, [{ + key: "pointerId", + get: function get() { + return this._pointerId; + } + + /** + * State of the tracking data, expressed as bit flags + * + * @member {number} + * @memberof PIXI.interaction.InteractionTrackingData# + */ + + }, { + key: "flags", + get: function get() { + return this._flags; + } + + /** + * Set the flags for the tracking data + * + * @param {number} flags - Flags to set + */ + , + set: function set(flags) { + this._flags = flags; + } + + /** + * Is the tracked event inactive (not over or down)? + * + * @member {number} + * @memberof PIXI.interaction.InteractionTrackingData# + */ + + }, { + key: "none", + get: function get() { + return this._flags === this.constructor.FLAGS.NONE; + } + + /** + * Is the tracked event over the DisplayObject? + * + * @member {boolean} + * @memberof PIXI.interaction.InteractionTrackingData# + */ + + }, { + key: "over", + get: function get() { + return (this._flags & this.constructor.FLAGS.OVER) !== 0; + } + + /** + * Set the over flag + * + * @param {boolean} yn - Is the event over? + */ + , + set: function set(yn) { + this._doSet(this.constructor.FLAGS.OVER, yn); + } + + /** + * Did the right mouse button come down in the DisplayObject? + * + * @member {boolean} + * @memberof PIXI.interaction.InteractionTrackingData# + */ + + }, { + key: "rightDown", + get: function get() { + return (this._flags & this.constructor.FLAGS.RIGHT_DOWN) !== 0; + } + + /** + * Set the right down flag + * + * @param {boolean} yn - Is the right mouse button down? + */ + , + set: function set(yn) { + this._doSet(this.constructor.FLAGS.RIGHT_DOWN, yn); + } + + /** + * Did the left mouse button come down in the DisplayObject? + * + * @member {boolean} + * @memberof PIXI.interaction.InteractionTrackingData# + */ + + }, { + key: "leftDown", + get: function get() { + return (this._flags & this.constructor.FLAGS.LEFT_DOWN) !== 0; + } + + /** + * Set the left down flag + * + * @param {boolean} yn - Is the left mouse button down? + */ + , + set: function set(yn) { + this._doSet(this.constructor.FLAGS.LEFT_DOWN, yn); + } + }]); + + return InteractionTrackingData; +}(); + +exports.default = InteractionTrackingData; + + +InteractionTrackingData.FLAGS = Object.freeze({ + NONE: 0, + OVER: 1 << 0, + LEFT_DOWN: 1 << 1, + RIGHT_DOWN: 1 << 2 +}); +//# sourceMappingURL=InteractionTrackingData.js.map + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +/** + * Default property values of interactive objects + * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties + * + * @private + * @name interactiveTarget + * @memberof PIXI.interaction + * @example + * function MyObject() {} + * + * Object.assign( + * core.DisplayObject.prototype, + * PIXI.interaction.interactiveTarget + * ); + */ +exports.default = { /** - * If buttonMode is enabled, this defines what CSS cursor property is used when the mouse cursor - * is hovered over the displayObject - * - * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * Enable interaction events for the DisplayObject. Touch, pointer and mouse + * events will not be emitted unless `interactive` is set to `true`. * - * @inner {string} + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.on('tap', (event) => { + * //handle event + * }); + * @member {boolean} + * @memberof PIXI.DisplayObject# */ - defaultCursor: 'pointer', + interactive: false, - // some internal checks.. /** - * Internal check to detect if the mouse cursor is hovered over the displayObject + * Determines if the children to the displayObject can be clicked/touched + * Setting this to false allows PixiJS to bypass a recursive `hitTest` function * - * @inner {boolean} - * @private + * @member {boolean} + * @memberof PIXI.Container# */ - _over: false, + interactiveChildren: true, /** - * Internal check to detect if the left mouse button is pressed on the displayObject + * Interaction shape. Children will be hit first, then this shape will be checked. + * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds. * - * @inner {boolean} - * @private + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100); + * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle} + * @memberof PIXI.DisplayObject# */ - _isLeftDown: false, + hitArea: null, /** - * Internal check to detect if the right mouse button is pressed on the displayObject + * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive + * Setting this changes the 'cursor' property to `'pointer'`. * - * @inner {boolean} - * @private + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.buttonMode = true; + * @member {boolean} + * @memberof PIXI.DisplayObject# */ - _isRightDown: false, + get buttonMode() { + return this.cursor === 'pointer'; + }, + set buttonMode(value) { + if (value) { + this.cursor = 'pointer'; + } else if (this.cursor === 'pointer') { + this.cursor = null; + } + }, /** - * Internal check to detect if the pointer cursor is hovered over the displayObject + * This defines what cursor mode is used when the mouse cursor + * is hovered over the displayObject. * - * @inner {boolean} - * @private + * @example + * const sprite = new PIXI.Sprite(texture); + * sprite.interactive = true; + * sprite.cursor = 'wait'; + * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor + * + * @member {string} + * @memberof PIXI.DisplayObject# */ - _pointerOver: false, + cursor: null, /** - * Internal check to detect if the pointer is down on the displayObject + * Internal set of all active pointers, by identifier * - * @inner {boolean} + * @member {Map} + * @memberof PIXI.DisplayObject# * @private */ - _pointerDown: false, + get trackedPointers() { + if (this._trackedPointers === undefined) this._trackedPointers = {}; + + return this._trackedPointers; + }, /** - * Internal check to detect if a user has touched the displayObject + * Map of all tracked pointers, by identifier. Use trackedPointers to access. * - * @inner {boolean} * @private + * @type {Map} */ - _touchDown: false + _trackedPointers: undefined }; //# sourceMappingURL=interactiveTarget.js.map /***/ }), -/* 262 */ +/* 264 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -31964,12 +33927,12 @@ exports.default = function () { if (this.baseUrl.charAt(this.baseUrl.length - 1) === '/') { xmlUrl += '/'; } - - // remove baseUrl from xmlUrl - xmlUrl = xmlUrl.replace(this.baseUrl, ''); } } + // remove baseUrl from xmlUrl + xmlUrl = xmlUrl.replace(this.baseUrl, ''); + // if there is an xmlUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty. if (xmlUrl && xmlUrl.charAt(xmlUrl.length - 1) !== '/') { xmlUrl += '/'; @@ -31998,132 +33961,33 @@ exports.default = function () { }; }; -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); var path = _interopRequireWildcard(_path); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var _resourceLoader = __webpack_require__(59); -var _extras = __webpack_require__(132); +var _extras = __webpack_require__(254); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +/** + * Register a BitmapText font from loader resource. + * + * @function parseBitmapFontData + * @memberof PIXI.loaders + * @param {PIXI.loaders.Resource} resource - Loader resource. + * @param {PIXI.Texture} texture - Reference to texture. + */ function parse(resource, texture) { - var data = {}; - var info = resource.data.getElementsByTagName('info')[0]; - var common = resource.data.getElementsByTagName('common')[0]; - - data.font = info.getAttribute('face'); - data.size = parseInt(info.getAttribute('size'), 10); - data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10); - data.chars = {}; - - // parse letters - var letters = resource.data.getElementsByTagName('char'); - - for (var i = 0; i < letters.length; i++) { - var charCode = parseInt(letters[i].getAttribute('id'), 10); - - var textureRect = new _core.Rectangle(parseInt(letters[i].getAttribute('x'), 10) + texture.frame.x, parseInt(letters[i].getAttribute('y'), 10) + texture.frame.y, parseInt(letters[i].getAttribute('width'), 10), parseInt(letters[i].getAttribute('height'), 10)); - - data.chars[charCode] = { - xOffset: parseInt(letters[i].getAttribute('xoffset'), 10), - yOffset: parseInt(letters[i].getAttribute('yoffset'), 10), - xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10), - kerning: {}, - texture: new _core.Texture(texture.baseTexture, textureRect) - - }; - } - - // parse kernings - var kernings = resource.data.getElementsByTagName('kerning'); - - for (var _i = 0; _i < kernings.length; _i++) { - var first = parseInt(kernings[_i].getAttribute('first'), 10); - var second = parseInt(kernings[_i].getAttribute('second'), 10); - var amount = parseInt(kernings[_i].getAttribute('amount'), 10); - - if (data.chars[second]) { - data.chars[second].kerning[first] = amount; - } - } - - resource.bitmapFont = data; - - // I'm leaving this as a temporary fix so we can test the bitmap fonts in v3 - // but it's very likely to change - _extras.BitmapText.fonts[data.font] = data; + resource.bitmapFont = _extras.BitmapText.registerFont(resource.data, texture); } //# sourceMappingURL=bitmapFontParser.js.map /***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _loader = __webpack_require__(579); - -Object.defineProperty(exports, 'Loader', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_loader).default; - } -}); - -var _bitmapFontParser = __webpack_require__(262); - -Object.defineProperty(exports, 'bitmapFontParser', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_bitmapFontParser).default; - } -}); -Object.defineProperty(exports, 'parseBitmapFontData', { - enumerable: true, - get: function get() { - return _bitmapFontParser.parse; - } -}); - -var _spritesheetParser = __webpack_require__(264); - -Object.defineProperty(exports, 'spritesheetParser', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_spritesheetParser).default; - } -}); - -var _textureParser = __webpack_require__(265); - -Object.defineProperty(exports, 'textureParser', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_textureParser).default; - } -}); - -var _resourceLoader = __webpack_require__(59); - -Object.defineProperty(exports, 'Resource', { - enumerable: true, - get: function get() { - return _resourceLoader.Resource; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map - -/***/ }), -/* 264 */ +/* 265 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32133,7 +33997,6 @@ exports.__esModule = true; exports.default = function () { return function spritesheetParser(resource, next) { - var resourcePath = void 0; var imageResourceName = resource.name + '_image'; // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists @@ -32150,121 +34013,45 @@ exports.default = function () { parentResource: resource }; - // Prepend url path unless the resource image is a data url - if (resource.isDataUrl) { - resourcePath = resource.data.meta.image; - } else { - resourcePath = _path2.default.dirname(resource.url.replace(this.baseUrl, '')) + '/' + resource.data.meta.image; - } + var resourcePath = getResourcePath(resource, this.baseUrl); // load the image for this sheet this.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) { - resource.textures = {}; - - var frames = resource.data.frames; - var frameKeys = Object.keys(frames); - var baseTexture = res.texture.baseTexture; - var scale = resource.data.meta.scale; - - // Use a defaultValue of `null` to check if a url-based resolution is set - var resolution = core.utils.getResolutionOfUrl(resource.url, null); - - // No resolution found via URL - if (resolution === null) { - // Use the scale value or default to 1 - resolution = scale !== undefined ? scale : 1; - } - - // For non-1 resolutions, update baseTexture - if (resolution !== 1) { - baseTexture.resolution = resolution; - baseTexture.update(); - } - - var batchIndex = 0; - - function processFrames(initialFrameIndex, maxFrames) { - var frameIndex = initialFrameIndex; - - while (frameIndex - initialFrameIndex < maxFrames && frameIndex < frameKeys.length) { - var i = frameKeys[frameIndex]; - var rect = frames[i].frame; - - if (rect) { - var frame = null; - var trim = null; - var orig = new core.Rectangle(0, 0, frames[i].sourceSize.w / resolution, frames[i].sourceSize.h / resolution); - - if (frames[i].rotated) { - frame = new core.Rectangle(rect.x / resolution, rect.y / resolution, rect.h / resolution, rect.w / resolution); - } else { - frame = new core.Rectangle(rect.x / resolution, rect.y / resolution, rect.w / resolution, rect.h / resolution); - } - - // Check to see if the sprite is trimmed - if (frames[i].trimmed) { - trim = new core.Rectangle(frames[i].spriteSourceSize.x / resolution, frames[i].spriteSourceSize.y / resolution, rect.w / resolution, rect.h / resolution); - } - - resource.textures[i] = new core.Texture(baseTexture, frame, orig, trim, frames[i].rotated ? 2 : 0); - - // lets also add the frame to pixi's global cache for fromFrame and fromImage functions - core.utils.TextureCache[i] = resource.textures[i]; - } - - frameIndex++; - } - } - - function shouldProcessNextBatch() { - return batchIndex * BATCH_SIZE < frameKeys.length; - } - - function processNextBatch(done) { - processFrames(batchIndex * BATCH_SIZE, BATCH_SIZE); - batchIndex++; - setTimeout(done, 0); - } - - function iteration() { - processNextBatch(function () { - if (shouldProcessNextBatch()) { - iteration(); - } else { - next(); - } - }); - } + var spritesheet = new _core.Spritesheet(res.texture.baseTexture, resource.data, resource.url); - if (frameKeys.length <= BATCH_SIZE) { - processFrames(0, BATCH_SIZE); + spritesheet.parse(function () { + resource.spritesheet = spritesheet; + resource.textures = spritesheet.textures; next(); - } else { - iteration(); - } + }); }); }; }; -var _resourceLoader = __webpack_require__(59); - -var _path = __webpack_require__(17); +exports.getResourcePath = getResourcePath; -var _path2 = _interopRequireDefault(_path); +var _resourceLoader = __webpack_require__(59); -var _core = __webpack_require__(0); +var _url = __webpack_require__(271); -var core = _interopRequireWildcard(_core); +var _url2 = _interopRequireDefault(_url); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _core = __webpack_require__(1); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var BATCH_SIZE = 1000; +function getResourcePath(resource, baseUrl) { + // Prepend url path unless the resource image is a data url + if (resource.isDataUrl) { + return resource.data.meta.image; + } + + return _url2.default.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image); +} //# sourceMappingURL=spritesheetParser.js.map /***/ }), -/* 265 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32276,37 +34063,23 @@ exports.default = function () { return function textureParser(resource, next) { // create a new texture if the data is an Image object if (resource.data && resource.type === _resourceLoader.Resource.TYPE.IMAGE) { - var baseTexture = new core.BaseTexture(resource.data, null, core.utils.getResolutionOfUrl(resource.url)); - - baseTexture.imageUrl = resource.url; - resource.texture = new core.Texture(baseTexture); - - // lets also add the frame to pixi's global cache for fromFrame and fromImage fucntions - core.utils.BaseTextureCache[resource.name] = baseTexture; - core.utils.TextureCache[resource.name] = resource.texture; - - // also add references by url if they are different. - if (resource.name !== resource.url) { - core.utils.BaseTextureCache[resource.url] = baseTexture; - core.utils.TextureCache[resource.url] = resource.texture; - } + resource.texture = _Texture2.default.fromLoader(resource.data, resource.url, resource.name); } - next(); }; }; -var _core = __webpack_require__(0); +var _resourceLoader = __webpack_require__(59); -var core = _interopRequireWildcard(_core); +var _Texture = __webpack_require__(37); -var _resourceLoader = __webpack_require__(59); +var _Texture2 = _interopRequireDefault(_Texture); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=textureParser.js.map /***/ }), -/* 266 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32372,18 +34145,18 @@ var Plane = function (_Mesh) { } /** - * Refreshes + * Refreshes plane coordinates * */ - Plane.prototype.refresh = function refresh() { + Plane.prototype._refresh = function _refresh() { + var texture = this._texture; var total = this.verticesX * this.verticesY; var verts = []; var colors = []; var uvs = []; var indices = []; - var texture = this.texture; var segmentsX = this.verticesX - 1; var segmentsY = this.verticesY - 1; @@ -32392,17 +34165,12 @@ var Plane = function (_Mesh) { var sizeY = texture.height / segmentsY; for (var i = 0; i < total; i++) { - if (texture._uvs) { - var x = i % this.verticesX; - var y = i / this.verticesX | 0; + var x = i % this.verticesX; + var y = i / this.verticesX | 0; - verts.push(x * sizeX, y * sizeY); + verts.push(x * sizeX, y * sizeY); - // this works for rectangular textures. - uvs.push(texture._uvs.x0 + (texture._uvs.x1 - texture._uvs.x0) * (x / (this.verticesX - 1)), texture._uvs.y0 + (texture._uvs.y3 - texture._uvs.y0) * (y / (this.verticesY - 1))); - } else { - uvs.push(0); - } + uvs.push(x / segmentsX, y / segmentsY); } // cons @@ -32427,8 +34195,9 @@ var Plane = function (_Mesh) { this.uvs = new Float32Array(uvs); this.colors = new Float32Array(colors); this.indices = new Uint16Array(indices); + this.indexDirty++; - this.indexDirty = true; + this.multiplyUvs(); }; /** @@ -32453,72 +34222,6 @@ var Plane = function (_Mesh) { exports.default = Plane; //# sourceMappingURL=Plane.js.map -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _Mesh = __webpack_require__(58); - -Object.defineProperty(exports, 'Mesh', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Mesh).default; - } -}); - -var _MeshRenderer = __webpack_require__(583); - -Object.defineProperty(exports, 'MeshRenderer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_MeshRenderer).default; - } -}); - -var _CanvasMeshRenderer = __webpack_require__(582); - -Object.defineProperty(exports, 'CanvasMeshRenderer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CanvasMeshRenderer).default; - } -}); - -var _Plane = __webpack_require__(266); - -Object.defineProperty(exports, 'Plane', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Plane).default; - } -}); - -var _NineSlicePlane = __webpack_require__(580); - -Object.defineProperty(exports, 'NineSlicePlane', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_NineSlicePlane).default; - } -}); - -var _Rope = __webpack_require__(581); - -Object.defineProperty(exports, 'Rope', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Rope).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map - /***/ }), /* 268 */ /***/ (function(module, exports, __webpack_require__) { @@ -32526,93 +34229,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de "use strict"; -exports.__esModule = true; - -var _ParticleContainer = __webpack_require__(584); - -Object.defineProperty(exports, 'ParticleContainer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ParticleContainer).default; - } -}); - -var _ParticleRenderer = __webpack_require__(586); - -Object.defineProperty(exports, 'ParticleRenderer', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ParticleRenderer).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _WebGLPrepare = __webpack_require__(594); - -Object.defineProperty(exports, 'webgl', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_WebGLPrepare).default; - } -}); - -var _CanvasPrepare = __webpack_require__(592); - -Object.defineProperty(exports, 'canvas', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CanvasPrepare).default; - } -}); - -var _BasePrepare = __webpack_require__(133); - -Object.defineProperty(exports, 'BasePrepare', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_BasePrepare).default; - } -}); - -var _CountLimiter = __webpack_require__(270); - -Object.defineProperty(exports, 'CountLimiter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_CountLimiter).default; - } -}); - -var _TimeLimiter = __webpack_require__(593); - -Object.defineProperty(exports, 'TimeLimiter', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_TimeLimiter).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - exports.__esModule = true; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -32670,7 +34286,7 @@ exports.default = CountLimiter; //# sourceMappingURL=CountLimiter.js.map /***/ }), -/* 271 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32688,11 +34304,12 @@ function _noop() {} /* empty */ /** * Iterates an array in series. * - * @param {*[]} array - Array to iterate. + * @param {Array.<*>} array - Array to iterate. * @param {function} iterator - Function to call for each element. * @param {function} callback - Function to call when done, or on error. + * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1. */ -function eachSeries(array, iterator, callback) { +function eachSeries(array, iterator, callback, deferNext) { var i = 0; var len = array.length; @@ -32705,7 +34322,13 @@ function eachSeries(array, iterator, callback) { return; } - iterator(array[i++], next); + if (deferNext) { + setTimeout(function () { + iterator(array[i++], next); + }, 1); + } else { + iterator(array[i++], next); + } })(); } @@ -32877,7 +34500,7 @@ function queue(worker, concurrency) { //# sourceMappingURL=async.js.map /***/ }), -/* 272 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -32950,19 +34573,758 @@ function encodeBinary(input) { //# sourceMappingURL=b64.js.map /***/ }), -/* 273 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -Object.defineProperty(exports, "__esModule", { +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +var punycode = __webpack_require__(603); +var util = __webpack_require__(612); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = __webpack_require__(606); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _pixi = __webpack_require__(85); +var _pixi = __webpack_require__(84); var _util = __webpack_require__(121); @@ -32974,7 +35336,7 @@ var _Stage = __webpack_require__(277); var _Stage2 = _interopRequireDefault(_Stage); -var _Sound = __webpack_require__(87); +var _Sound = __webpack_require__(86); var _Sound2 = _interopRequireDefault(_Sound); @@ -33147,23 +35509,67 @@ var Game = function () { value: function win() { _Sound2.default.play('champ'); this.gameStatus = 'You Win!'; + this.showReplay(this.getScoreMessage()); } }, { key: 'loss', value: function loss() { _Sound2.default.play('loserSound'); this.gameStatus = 'You Lose!'; + this.showReplay(this.getScoreMessage()); + } + }, { + key: 'getScoreMessage', + value: function getScoreMessage() { + var scoreMessage = void 0; + + if (this.score === 9400) { + scoreMessage = 'Flawless victory.'; + } + + if (this.score < 9400) { + scoreMessage = 'Close to perfection.'; + } + + if (this.score <= 9000) { + scoreMessage = 'Truly impressive score.'; + } + + if (this.score <= 8000) { + scoreMessage = 'Solid score.'; + } + + if (this.score <= 6000) { + scoreMessage = 'Yikes.'; + } + + return scoreMessage; + } + }, { + key: 'showReplay', + value: function showReplay(replayText) { + this.stage.hud.createTextBox('replayButton', { + location: _Stage2.default.replayButtonLocation() + }); + this.stage.hud.replayButton = replayText + ' Play Again?'; + this.bindInteractions(); } }, { key: 'handleClick', value: function handleClick(event) { - if (!this.outOfAmmo()) { + var clickPoint = { + x: event.data.global.x, + y: event.data.global.y + }; + + if (!this.stage.hud.replayButton && !this.outOfAmmo()) { _Sound2.default.play('gunSound'); this.bullets -= 1; - this.updateScore(this.stage.shotsFired({ - x: event.data.global.x, - y: event.data.global.y - })); + this.updateScore(this.stage.shotsFired(clickPoint)); + } + + if (this.stage.hud.replayButton && this.stage.clickedReplay(clickPoint)) { + window.location.reload(); } } }, { @@ -33408,6 +35814,26 @@ var Game = function () { exports.default = Game; +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _Game = __webpack_require__(272); + +var _Game2 = _interopRequireDefault(_Game); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +document.addEventListener('DOMContentLoaded', function () { + + var game = new _Game2.default({ + spritesheet: 'sprites.json' + }).load(); +}, false); + /***/ }), /* 274 */ /***/ (function(module, exports, __webpack_require__) { @@ -33423,17 +35849,17 @@ var _createClass = function () { function defineProperties(target, props) { for var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; -var _gsap = __webpack_require__(139); +var _gsap = __webpack_require__(140); var _util = __webpack_require__(121); var _object = __webpack_require__(118); -var _Sound = __webpack_require__(87); +var _Sound = __webpack_require__(86); var _Sound2 = _interopRequireDefault(_Sound); -var _Character2 = __webpack_require__(137); +var _Character2 = __webpack_require__(138); var _Character3 = _interopRequireDefault(_Character2); @@ -33733,15 +36159,15 @@ var _object = __webpack_require__(118); var _util = __webpack_require__(121); -var _utils = __webpack_require__(136); +var _utils = __webpack_require__(137); var _utils2 = _interopRequireDefault(_utils); -var _Character2 = __webpack_require__(137); +var _Character2 = __webpack_require__(138); var _Character3 = _interopRequireDefault(_Character2); -var _Sound = __webpack_require__(87); +var _Sound = __webpack_require__(86); var _Sound2 = _interopRequireDefault(_Sound); @@ -34027,7 +36453,7 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _pixi = __webpack_require__(85); +var _pixi = __webpack_require__(84); var _object = __webpack_require__(118); @@ -34150,17 +36576,17 @@ Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _pixi = __webpack_require__(85); +var _pixi = __webpack_require__(84); var _bluebird = __webpack_require__(278); var _bluebird2 = _interopRequireDefault(_bluebird); -var _collection = __webpack_require__(207); +var _collection = __webpack_require__(208); var _function = __webpack_require__(439); -var _utils = __webpack_require__(136); +var _utils = __webpack_require__(137); var _utils2 = _interopRequireDefault(_utils); @@ -34200,6 +36626,7 @@ var HUD_LOCATIONS = { SCORE: new _pixi.Point(MAX_X - 10, 10), WAVE_STATUS: new _pixi.Point(MAX_X - 10, MAX_Y - 20), GAME_STATUS: new _pixi.Point(MAX_X / 2, MAX_Y * 0.45), + REPLAY_BUTTON: new _pixi.Point(MAX_X / 2, MAX_Y * 0.56), BULLET_STATUS: new _pixi.Point(10, 10), DEAD_DUCK_STATUS: new _pixi.Point(10, MAX_Y * 0.91), MISSED_DUCK_STATUS: new _pixi.Point(10, MAX_Y * 0.95) @@ -34361,12 +36788,10 @@ var Stage = function (_Container) { _this3.flashScreen.visible = false; }, FLASH_MS); - clickPoint.x /= this.scale.x; - clickPoint.y /= this.scale.y; var ducksShot = 0; for (var i = 0; i < this.ducks.length; i++) { var duck = this.ducks[i]; - if (duck.alive && _utils2.default.pointDistance(duck.position, clickPoint) < 60) { + if (duck.alive && _utils2.default.pointDistance(duck.position, this.getScaledClickLocation(clickPoint)) < 60) { ducksShot++; duck.shot(); duck.timeline.add(function () { @@ -34376,7 +36801,19 @@ var Stage = function (_Container) { } return ducksShot; } - + }, { + key: 'clickedReplay', + value: function clickedReplay(clickPoint) { + return _utils2.default.pointDistance(this.getScaledClickLocation(clickPoint), HUD_LOCATIONS.REPLAY_BUTTON) < 200; + } + }, { + key: 'getScaledClickLocation', + value: function getScaledClickLocation(clickPoint) { + return { + x: clickPoint.x / this.scale.x, + y: clickPoint.y / this.scale.y + }; + } /** * flyAway * Helper method that causes the sky to change color and the ducks to fly away @@ -34494,6 +36931,11 @@ var Stage = function (_Container) { value: function gameStatusBoxLocation() { return HUD_LOCATIONS.GAME_STATUS; } + }, { + key: 'replayButtonLocation', + value: function replayButtonLocation() { + return HUD_LOCATIONS.REPLAY_BUTTON; + } }, { key: 'bulletStatusBoxLocation', value: function bulletStatusBoxLocation() { @@ -34523,7 +36965,7 @@ exports.default = Stage; /* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/* @preserve * The MIT License (MIT) * - * Copyright (c) 2013-2015 Petka Antonov + * Copyright (c) 2013-2017 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34545,7 +36987,7 @@ exports.default = Stage; * */ /** - * bluebird build version 3.4.7 + * bluebird build version 3.5.0 * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ !function(e){if(true)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o= 55. + if (typeof self.ctx.resume === 'function') { + self.ctx.resume(); + } + // Setup a timeout to check that we are unlocked on the next event loop. source.onended = function() { source.disconnect(0); @@ -40503,7 +42994,6 @@ module.exports = ret; clearTimeout(self._suspendTimer); self._suspendTimer = null; } else if (self.state === 'suspended') { - self.state = 'resuming'; self.ctx.resume().then(function() { self.state = 'running'; @@ -40668,8 +43158,13 @@ module.exports = ret; } } + // Log a warning if no extension was found. + if (!ext) { + console.warn('No file extension was found. Consider using the "format" property or specify an extension.'); + } + // Check if this extension is available. - if (Howler.codecs(ext)) { + if (ext && Howler.codecs(ext)) { url = self._src[i]; break; } @@ -40752,17 +43247,26 @@ module.exports = ret; sprite = sound._sprite || '__default'; } - // If we have no sprite and the sound hasn't loaded, we must wait - // for the sound to load to get our audio's duration. - if (self._state !== 'loaded' && !self._sprite[sprite]) { + // If the sound hasn't loaded, we must wait to get the audio's duration. + // We also need to wait to make sure we don't run into race conditions with + // the order of function calls. + if (self._state !== 'loaded') { + // Set the sprite value on this sound. + sound._sprite = sprite; + + // Makr this sounded as not ended in case another sound is played before this one loads. + sound._ended = false; + + // Add the sound to the queue to be played on load. + var soundId = sound._id; self._queue.push({ event: 'play', action: function() { - self.play(self._soundById(sound._id) ? sound._id : undefined); + self.play(soundId); } }); - return sound._id; + return soundId; } // Don't play the sound if an id was passed and it is already playing. @@ -40832,7 +43336,8 @@ module.exports = ret; playWebAudio(); } else { // Wait for the audio to load and then begin playback. - self.once(isRunning ? 'load' : 'resume', playWebAudio, isRunning ? sound._id : null); + var event = !isRunning && self._state === 'loaded' ? 'resume' : 'load'; + self.once(event, playWebAudio, isRunning ? sound._id : null); // Cancel the end timer. self._clearTimer(sound._id); @@ -40844,19 +43349,16 @@ module.exports = ret; node.muted = sound._muted || self._muted || Howler._muted || node.muted; node.volume = sound._volume * Howler.volume(); node.playbackRate = sound._rate; + node.play(); - setTimeout(function() { - node.play(); - - // Setup the new end timer. - if (timeout !== Infinity) { - self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout); - } + // Setup the new end timer. + if (timeout !== Infinity) { + self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout); + } - if (!internal) { - self._emit('play', sound._id); - } - }, 0); + if (!internal) { + self._emit('play', sound._id); + } }; // Play immediately if ready, or wait for the 'canplaythrough'e vent. @@ -40922,9 +43424,9 @@ module.exports = ret; if (sound._node) { if (self._webAudio) { - // make sure the sound has been created + // Make sure the sound has been created. if (!sound._node.bufferSource) { - return self; + continue; } if (typeof sound._node.bufferSource.stop === 'undefined') { @@ -40993,32 +43495,26 @@ module.exports = ret; if (sound._node) { if (self._webAudio) { - // make sure the sound has been created - if (!sound._node.bufferSource) { - if (!internal) { - self._emit('stop', sound._id); + // Make sure the sound's AudioBufferSourceNode has been created. + if (sound._node.bufferSource) { + if (typeof sound._node.bufferSource.stop === 'undefined') { + sound._node.bufferSource.noteOff(0); + } else { + sound._node.bufferSource.stop(0); } - return self; - } - - if (typeof sound._node.bufferSource.stop === 'undefined') { - sound._node.bufferSource.noteOff(0); - } else { - sound._node.bufferSource.stop(0); + // Clean up the buffer source. + self._cleanBuffer(sound._node); } - - // Clean up the buffer source. - self._cleanBuffer(sound._node); } else if (!isNaN(sound._node.duration) || sound._node.duration === Infinity) { sound._node.currentTime = sound._start || 0; sound._node.pause(); } } - } - if (sound && !internal) { - self._emit('stop', sound._id); + if (!internal) { + self._emit('stop', sound._id); + } } } @@ -41244,10 +43740,10 @@ module.exports = ret; } // When the fade is complete, stop it and fire event. - if (vol === to) { + if ((to < from && vol <= to) || (to > from && vol >= to)) { clearInterval(sound._interval); sound._interval = null; - self.volume(vol, soundId); + self.volume(to, soundId); self._emit('fade', soundId); } }.bind(self, ids[i], sound), stepLen); @@ -41577,13 +44073,15 @@ module.exports = ret; // Stop the sound if it is currently playing. if (!sounds[i]._paused) { self.stop(sounds[i]._id); - self._emit('end', sounds[i]._id); } // Remove the source or disconnect. if (!self._webAudio) { - // Set the source to 0-second silence to stop any downloading. - sounds[i]._node.src = 'data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA='; + // Set the source to 0-second silence to stop any downloading (except in IE). + var checkIE = /MSIE |Trident\//.test(Howler._navigator && Howler._navigator.userAgent); + if (!checkIE) { + sounds[i]._node.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA'; + } // Remove any event listeners. sounds[i]._node.removeEventListener('error', sounds[i]._errorFn, false); @@ -41658,10 +44156,17 @@ module.exports = ret; var events = self['_on' + event]; var i = 0; - if (fn) { + // Allow passing just an event and ID. + if (typeof fn === 'number') { + id = fn; + fn = null; + } + + if (fn || id) { // Loop through event store and remove the passed function. for (i=0; i Logs 'done saving!' after the two async saves have completed. */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } +function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - return result; + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; } -module.exports = nativeKeysIn; +module.exports = after; /***/ }), -/* 378 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(184); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; +var assignValue = __webpack_require__(63), + copyObject = __webpack_require__(18), + createAssigner = __webpack_require__(43), + isArrayLike = __webpack_require__(16), + isPrototype = __webpack_require__(73), + keys = __webpack_require__(10); -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; +/** Used for built-in method references. */ +var objectProto = Object.prototype; -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); -module.exports = nodeUtil; +module.exports = assign; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module))) /***/ }), -/* 379 */ -/***/ (function(module, exports) { +/* 397 */ +/***/ (function(module, exports, __webpack_require__) { -/** Used for built-in method references. */ -var objectProto = Object.prototype; +var copyObject = __webpack_require__(18), + createAssigner = __webpack_require__(43), + keys = __webpack_require__(10); /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ -var nativeObjectToString = objectProto.toString; +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); +}); + +module.exports = assignWith; + + +/***/ }), +/* 398 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAt = __webpack_require__(298), + flatRest = __webpack_require__(32); /** - * Converts `value` to a string using `Object.prototype.toString`. + * Creates an array of values corresponding to `paths` of `object`. * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] */ -function objectToString(value) { - return nativeObjectToString.call(value); -} +var at = flatRest(baseAt); -module.exports = objectToString; +module.exports = at; /***/ }), -/* 380 */ -/***/ (function(module, exports) { +/* 399 */ +/***/ (function(module, exports, __webpack_require__) { -/** Used to lookup unminified function names. */ -var realNames = {}; +var apply = __webpack_require__(11), + baseRest = __webpack_require__(5), + isError = __webpack_require__(451); -module.exports = realNames; +/** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ +var attempt = baseRest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } +}); + +module.exports = attempt; /***/ }), -/* 381 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { -var copyArray = __webpack_require__(28), - isIndex = __webpack_require__(44); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +var arrayEach = __webpack_require__(39), + baseAssignValue = __webpack_require__(22), + bind = __webpack_require__(207), + flatRest = __webpack_require__(32), + toKey = __webpack_require__(19); /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. + * Binds methods of an object to the object itself, overwriting the existing + * method. * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'click': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); + * // => Logs 'clicked docs' when clicked. */ -function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; -} +var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; +}); -module.exports = reorder; +module.exports = bindAll; /***/ }), -/* 382 */ -/***/ (function(module, exports) { +/* 401 */ +/***/ (function(module, exports, __webpack_require__) { -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +var baseRest = __webpack_require__(5), + createWrap = __webpack_require__(23), + getHolder = __webpack_require__(44), + replaceHolders = __webpack_require__(35); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_PARTIAL_FLAG = 32; /** - * Adds `value` to the array cache. + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} +var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); +}); -module.exports = setCacheAdd; +// Assign default placeholders. +bindKey.placeholder = {}; + +module.exports = bindKey; /***/ }), -/* 383 */ -/***/ (function(module, exports) { +/* 402 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseClamp = __webpack_require__(95), + toNumber = __webpack_require__(52); /** - * Checks if `value` is in the array cache. + * Clamps `number` within the inclusive `lower` and `upper` bounds. * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 */ -function setCacheHas(value) { - return this.__data__.has(value); +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); } -module.exports = setCacheHas; +module.exports = clamp; /***/ }), -/* 384 */ -/***/ (function(module, exports) { +/* 403 */ +/***/ (function(module, exports, __webpack_require__) { + +var apply = __webpack_require__(11), + arrayMap = __webpack_require__(12), + baseIteratee = __webpack_require__(4), + baseRest = __webpack_require__(5); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /** - * Converts `set` to its value-value pairs. + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' */ -function setToPairs(set) { - var index = -1, - result = Array(set.size); +function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = baseIteratee; - set.forEach(function(value) { - result[++index] = [value, value]; + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return baseRest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } }); - return result; } -module.exports = setToPairs; +module.exports = cond; /***/ }), -/* 385 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { -var ListCache = __webpack_require__(61); +var baseClone = __webpack_require__(50), + baseConforms = __webpack_require__(299); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; /** - * Removes all key-value entries from the stack. + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. * - * @private - * @name clear - * @memberOf Stack + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } + * ]; + * + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; +function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } -module.exports = stackClear; +module.exports = conforms; /***/ }), -/* 386 */ -/***/ (function(module, exports) { +/* 405 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(22), + createAggregator = __webpack_require__(68); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Removes `key` and its value from the stack. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; -} +var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } +}); -module.exports = stackDelete; +module.exports = countBy; /***/ }), -/* 387 */ -/***/ (function(module, exports) { +/* 406 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssign = __webpack_require__(147), + baseCreate = __webpack_require__(40); /** - * Gets the stack value for `key`. + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true */ -function stackGet(key) { - return this.__data__.get(key); +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); } -module.exports = stackGet; +module.exports = create; /***/ }), -/* 388 */ -/***/ (function(module, exports) { +/* 407 */ +/***/ (function(module, exports, __webpack_require__) { + +var createWrap = __webpack_require__(23); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8; /** - * Checks if a stack value for `key` exists. + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] */ -function stackHas(key) { - return this.__data__.has(key); +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; } -module.exports = stackHas; +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; /***/ }), -/* 389 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { -var ListCache = __webpack_require__(61), - Map = __webpack_require__(91), - MapCache = __webpack_require__(92); +var createWrap = __webpack_require__(23); -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_RIGHT_FLAG = 16; /** - * Sets the stack `key` to `value`. + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; } -module.exports = stackSet; +// Assign default placeholders. +curryRight.placeholder = {}; + +module.exports = curryRight; /***/ }), -/* 390 */ +/* 409 */ /***/ (function(module, exports) { /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 */ -function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; +function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; } -module.exports = strictIndexOf; +module.exports = defaultTo; /***/ }), -/* 391 */ +/* 410 */ /***/ (function(module, exports, __webpack_require__) { -var asciiSize = __webpack_require__(295), - hasUnicode = __webpack_require__(352), - unicodeSize = __webpack_require__(392); +var apply = __webpack_require__(11), + assignInWith = __webpack_require__(111), + baseRest = __webpack_require__(5), + customDefaultsAssignIn = __webpack_require__(343); /** - * Gets the number of symbols in `string`. + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ -function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); -} +var defaults = baseRest(function(args) { + args.push(undefined, customDefaultsAssignIn); + return apply(assignInWith, undefined, args); +}); -module.exports = stringSize; +module.exports = defaults; /***/ }), -/* 392 */ -/***/ (function(module, exports) { +/* 411 */ +/***/ (function(module, exports, __webpack_require__) { -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsVarRange = '\\ufe0e\\ufe0f'; +var apply = __webpack_require__(11), + baseRest = __webpack_require__(5), + customDefaultsMerge = __webpack_require__(344), + mergeWith = __webpack_require__(215); -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ +var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); +}); -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; +module.exports = defaultsDeep; -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/***/ }), +/* 412 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseDelay = __webpack_require__(148), + baseRest = __webpack_require__(5); /** - * Gets the size of a Unicode `string`. + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. */ -function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; -} +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); -module.exports = unicodeSize; +module.exports = defer; /***/ }), -/* 393 */ +/* 413 */ /***/ (function(module, exports, __webpack_require__) { -var arrayEach = __webpack_require__(38), - arrayIncludes = __webpack_require__(291); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - -/** Used to associate wrap methods with their bit flags. */ -var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] -]; +var baseDelay = __webpack_require__(148), + baseRest = __webpack_require__(5), + toNumber = __webpack_require__(52); /** - * Updates wrapper `details` based on `bitmask` flags. + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. - */ -function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); -} + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ +var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); +}); -module.exports = updateWrapDetails; +module.exports = delay; /***/ }), -/* 394 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { -var LazyWrapper = __webpack_require__(89), - LodashWrapper = __webpack_require__(90), - copyArray = __webpack_require__(28); +module.exports = __webpack_require__(210); -/** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ -function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; -} -module.exports = wrapperClone; +/***/ }), +/* 415 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(211); /***/ }), -/* 395 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { -var toInteger = __webpack_require__(14); +module.exports = __webpack_require__(221); -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; + +/***/ }), +/* 417 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(222); + + +/***/ }), +/* 418 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayEvery = __webpack_require__(143), + baseEvery = __webpack_require__(301), + baseIteratee = __webpack_require__(4), + isArray = __webpack_require__(2), + isIterateeCall = __webpack_require__(34); /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. * @example * - * var saves = ['profile', 'settings']; + * _.every([true, 1, null, 'yes'], Boolean); + * // => false * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => Logs 'done saving!' after the two async saves have completed. + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false */ -function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; + return func(collection, baseIteratee(predicate, 3)); } -module.exports = after; +module.exports = every; /***/ }), -/* 396 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { -var assignValue = __webpack_require__(64), - copyObject = __webpack_require__(19), - createAssigner = __webpack_require__(42), - isArrayLike = __webpack_require__(16), - isPrototype = __webpack_require__(74), - keys = __webpack_require__(9); +module.exports = __webpack_require__(205); -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }), +/* 420 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(111); + + +/***/ }), +/* 421 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(62), + baseFilter = __webpack_require__(150), + baseIteratee = __webpack_require__(4), + isArray = __webpack_require__(2); /** - * Assigns own enumerable string keyed properties of source objects to the - * destination object. Source objects are applied from left to right. - * Subsequent sources overwrite property assignments of previous sources. + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). + * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ - * @since 0.10.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @see _.assignIn + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject * @example * - * function Foo() { - * this.a = 1; - * } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; * - * function Bar() { - * this.c = 3; - * } + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] * - * Foo.prototype.b = 2; - * Bar.prototype.d = 4; + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] * - * _.assign({ 'a': 0 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3 } + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] */ -var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } -}); +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} -module.exports = assign; +module.exports = filter; /***/ }), -/* 397 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { -var copyObject = __webpack_require__(19), - createAssigner = __webpack_require__(42), - keys = __webpack_require__(9); +var createFind = __webpack_require__(176), + findIndex = __webpack_require__(423); /** - * This method is like `_.assign` except that it accepts `customizer` - * which is invoked to produce the assigned values. If `customizer` returns - * `undefined`, assignment is handled by the method instead. The `customizer` - * is invoked with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @see _.assignInWith + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. * @example * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; * - * var defaults = _.partialRight(_.assignWith, customizer); + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' */ -var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); -}); +var find = createFind(findIndex); -module.exports = assignWith; +module.exports = find; /***/ }), -/* 398 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { -var baseAt = __webpack_require__(298), - flatRest = __webpack_require__(32); +var baseFindIndex = __webpack_require__(96), + baseIteratee = __webpack_require__(4), + toInteger = __webpack_require__(14); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; /** - * Creates an array of values corresponding to `paths` of `object`. + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ - * @since 1.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Array} Returns the picked values. + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. * @example * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 */ -var at = flatRest(baseAt); +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} -module.exports = at; +module.exports = findIndex; /***/ }), -/* 399 */ +/* 424 */ /***/ (function(module, exports, __webpack_require__) { -var apply = __webpack_require__(11), - baseRest = __webpack_require__(4), - isError = __webpack_require__(451); +var baseFindKey = __webpack_require__(151), + baseForOwn = __webpack_require__(31), + baseIteratee = __webpack_require__(4); /** - * Attempts to invoke `func`, returning either the result or the caught error - * object. Any additional arguments are provided to `func` when it's invoked. + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ - * @since 3.0.0 - * @category Util - * @param {Function} func The function to attempt. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {*} Returns the `func` result or error object. + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * - * // Avoid throwing errors for invalid selectors. - * var elements = _.attempt(function(selector) { - * return document.querySelectorAll(selector); - * }, '>_>'); + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; * - * if (_.isError(elements)) { - * elements = []; - * } + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' */ -var attempt = baseRest(function(func, args) { - try { - return apply(func, undefined, args); - } catch (e) { - return isError(e) ? e : new Error(e); - } -}); +function findKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); +} -module.exports = attempt; +module.exports = findKey; /***/ }), -/* 400 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { -var arrayEach = __webpack_require__(38), - baseAssignValue = __webpack_require__(22), - bind = __webpack_require__(206), - flatRest = __webpack_require__(32), - toKey = __webpack_require__(20); +var createFind = __webpack_require__(176), + findLastIndex = __webpack_require__(426); /** - * Binds methods of an object to the object itself, overwriting the existing - * method. - * - * **Note:** This method doesn't set the "length" property of bound functions. + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. * * @static - * @since 0.1.0 * @memberOf _ - * @category Util - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} methodNames The object method names to bind. - * @returns {Object} Returns `object`. + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. * @example * - * var view = { - * 'label': 'docs', - * 'click': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view, ['click']); - * jQuery(element).on('click', view.click); - * // => Logs 'clicked docs' when clicked. + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 */ -var bindAll = flatRest(function(object, methodNames) { - arrayEach(methodNames, function(key) { - key = toKey(key); - baseAssignValue(object, key, bind(object[key], object)); - }); - return object; -}); +var findLast = createFind(findLastIndex); -module.exports = bindAll; +module.exports = findLast; /***/ }), -/* 401 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { -var baseRest = __webpack_require__(4), - createWrap = __webpack_require__(23), - getHolder = __webpack_require__(43), - replaceHolders = __webpack_require__(35); +var baseFindIndex = __webpack_require__(96), + baseIteratee = __webpack_require__(4), + toInteger = __webpack_require__(14); -/** Used to compose bitmasks for function metadata. */ -var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_PARTIAL_FLAG = 32; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; /** - * Creates a function that invokes the method at `object[key]` with `partials` - * prepended to the arguments it receives. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. See - * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. * * @static * @memberOf _ - * @since 0.10.0 - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. * @example * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 * - * bound('!'); - * // => 'hiya fred!' + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 */ -var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; +function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - return createWrap(key, bitmask, object, partials, holders); -}); - -// Assign default placeholders. -bindKey.placeholder = {}; + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); +} -module.exports = bindKey; +module.exports = findLastIndex; /***/ }), -/* 402 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { -var baseClamp = __webpack_require__(95), - toNumber = __webpack_require__(50); +var baseFindKey = __webpack_require__(151), + baseForOwnRight = __webpack_require__(98), + baseIteratee = __webpack_require__(4); /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. * * @static * @memberOf _ - * @since 4.0.0 - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * - * _.clamp(-10, -5, 5); - * // => -5 + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; * - * _.clamp(10, -5, 5); - * // => 5 + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' */ -function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); +function findLastKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); } -module.exports = clamp; +module.exports = findLastKey; /***/ }), -/* 403 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { -var apply = __webpack_require__(11), - arrayMap = __webpack_require__(12), - baseIteratee = __webpack_require__(3), - baseRest = __webpack_require__(4); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +var baseFlatten = __webpack_require__(41), + map = __webpack_require__(78); /** - * Creates a function that iterates over `pairs` and invokes the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 - * @category Util - * @param {Array} pairs The predicate-function pairs. - * @returns {Function} Returns the new composite function. + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. * @example * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.stubTrue, _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' + * function duplicate(n) { + * return [n, n]; + * } * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] */ -function cond(pairs) { - var length = pairs == null ? 0 : pairs.length, - toIteratee = baseIteratee; - - pairs = !length ? [] : arrayMap(pairs, function(pair) { - if (typeof pair[1] != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return [toIteratee(pair[0]), pair[1]]; - }); - - return baseRest(function(args) { - var index = -1; - while (++index < length) { - var pair = pairs[index]; - if (apply(pair[0], this, args)) { - return apply(pair[1], this, args); - } - } - }); +function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); } -module.exports = cond; +module.exports = flatMap; /***/ }), -/* 404 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { -var baseClone = __webpack_require__(48), - baseConforms = __webpack_require__(299); +var baseFlatten = __webpack_require__(41), + map = __webpack_require__(78); -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; /** - * Creates a function that invokes the predicate properties of `source` with - * the corresponding property values of a given object, returning `true` if - * all predicates return truthy, else `false`. - * - * **Note:** The created function is equivalent to `_.conformsTo` with - * `source` partially applied. + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. * * @static * @memberOf _ - * @since 4.0.0 - * @category Util - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. * @example * - * var objects = [ - * { 'a': 2, 'b': 1 }, - * { 'a': 1, 'b': 2 } - * ]; + * function duplicate(n) { + * return [[[n, n]]]; + * } * - * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); - * // => [{ 'a': 1, 'b': 2 }] + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] */ -function conforms(source) { - return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); } -module.exports = conforms; +module.exports = flatMapDeep; /***/ }), -/* 405 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssignValue = __webpack_require__(22), - createAggregator = __webpack_require__(69); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var baseFlatten = __webpack_require__(41), + map = __webpack_require__(78), + toInteger = __webpack_require__(14); /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the number of times the key was returned by `iteratee`. The - * iteratee is invoked with one argument: (value). + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. * * @static * @memberOf _ - * @since 0.5.0 + * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. * @example * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } + * function duplicate(n) { + * return [[[n, n]]]; + * } * - * // The `_.property` iteratee shorthand. - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] */ -var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } -}); +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} -module.exports = countBy; +module.exports = flatMapDepth; /***/ }), -/* 406 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssign = __webpack_require__(146), - baseCreate = __webpack_require__(39); +var baseFlatten = __webpack_require__(41); /** - * Creates an object that inherits from the `prototype` object. If a - * `properties` object is given, its own enumerable string keyed properties - * are assigned to the created object. + * Flattens `array` a single level deep. * * @static * @memberOf _ - * @since 2.3.0 - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. * @example * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ -function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; } -module.exports = create; +module.exports = flatten; /***/ }), -/* 407 */ +/* 432 */ /***/ (function(module, exports, __webpack_require__) { var createWrap = __webpack_require__(23); /** Used to compose bitmasks for function metadata. */ -var WRAP_CURRY_FLAG = 8; +var WRAP_FLIP_FLAG = 512; /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. + * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ - * @since 2.0.0 + * @since 4.0.0 * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. * @example * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] */ -function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; +function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); } -// Assign default placeholders. -curry.placeholder = {}; - -module.exports = curry; +module.exports = flip; /***/ }), -/* 408 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { -var createWrap = __webpack_require__(23); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_CURRY_RIGHT_FLAG = 16; +var createFlow = __webpack_require__(177); /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example * - * **Note:** This method doesn't set the "length" property of curried functions. + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ +var flow = createFlow(); + +module.exports = flow; + + +/***/ }), +/* 434 */ +/***/ (function(module, exports, __webpack_require__) { + +var createFlow = __webpack_require__(177); + +/** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. * * @static - * @memberOf _ * @since 3.0.0 - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Function} Returns the new curried function. + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flow * @example * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; + * function square(n) { + * return n * n; + * } * - * var curried = _.curryRight(abc); + * var addSquare = _.flowRight([square, _.add]); + * addSquare(1, 2); + * // => 9 + */ +var flowRight = createFlow(true); + +module.exports = flowRight; + + +/***/ }), +/* 435 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseFor = __webpack_require__(97), + castFunction = __webpack_require__(17), + keysIn = __webpack_require__(13); + +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. * - * curried(3)(2)(1); - * // => [1, 2, 3] + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example * - * curried(2, 3)(1); - * // => [1, 2, 3] + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * curried(1, 2, 3); - * // => [1, 2, 3] + * Foo.prototype.c = 3; * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ -function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; +function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, castFunction(iteratee), keysIn); } -// Assign default placeholders. -curryRight.placeholder = {}; - -module.exports = curryRight; +module.exports = forIn; /***/ }), -/* 409 */ -/***/ (function(module, exports) { +/* 436 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseForRight = __webpack_require__(152), + castFunction = __webpack_require__(17), + keysIn = __webpack_require__(13); /** - * Checks `value` to determine whether a default value should be returned in - * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, - * or `undefined`. + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. * * @static * @memberOf _ - * @since 4.14.0 - * @category Util - * @param {*} value The value to check. - * @param {*} defaultValue The default value. - * @returns {*} Returns the resolved value. + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn * @example * - * _.defaultTo(1, 10); - * // => 1 + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.defaultTo(undefined, 10); - * // => 10 + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ -function defaultTo(value, defaultValue) { - return (value == null || value !== value) ? defaultValue : value; +function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, castFunction(iteratee), keysIn); } -module.exports = defaultTo; +module.exports = forInRight; /***/ }), -/* 410 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { -var apply = __webpack_require__(11), - assignInWith = __webpack_require__(111), - baseRest = __webpack_require__(4), - customDefaultsAssignIn = __webpack_require__(343); +var baseForOwn = __webpack_require__(31), + castFunction = __webpack_require__(17); /** - * Assigns own and inherited enumerable string keyed properties of source - * objects to the destination object for all destination properties that - * resolve to `undefined`. Source objects are applied from left to right. - * Once a property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. * * @static - * @since 0.1.0 * @memberOf _ + * @since 0.3.0 * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. - * @see _.defaultsDeep + * @see _.forOwnRight * @example * - * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ -var defaults = baseRest(function(args) { - args.push(undefined, customDefaultsAssignIn); - return apply(assignInWith, undefined, args); -}); +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} -module.exports = defaults; +module.exports = forOwn; /***/ }), -/* 411 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { -var apply = __webpack_require__(11), - baseRest = __webpack_require__(4), - customDefaultsMerge = __webpack_require__(344), - mergeWith = __webpack_require__(214); +var baseForOwnRight = __webpack_require__(98), + castFunction = __webpack_require__(17); /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. * * @static * @memberOf _ - * @since 3.10.0 + * @since 2.0.0 * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. - * @see _.defaults + * @see _.forOwn * @example * - * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); - * // => { 'a': { 'b': 2, 'c': 3 } } + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ -var defaultsDeep = baseRest(function(args) { - args.push(undefined, customDefaultsMerge); - return apply(mergeWith, undefined, args); -}); +function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, castFunction(iteratee)); +} -module.exports = defaultsDeep; +module.exports = forOwnRight; /***/ }), -/* 412 */ +/* 439 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + 'after': __webpack_require__(395), + 'ary': __webpack_require__(204), + 'before': __webpack_require__(206), + 'bind': __webpack_require__(207), + 'bindKey': __webpack_require__(401), + 'curry': __webpack_require__(407), + 'curryRight': __webpack_require__(408), + 'debounce': __webpack_require__(209), + 'defer': __webpack_require__(412), + 'delay': __webpack_require__(413), + 'flip': __webpack_require__(432), + 'memoize': __webpack_require__(214), + 'negate': __webpack_require__(117), + 'once': __webpack_require__(467), + 'overArgs': __webpack_require__(470), + 'partial': __webpack_require__(217), + 'partialRight': __webpack_require__(473), + 'rearg': __webpack_require__(480), + 'rest': __webpack_require__(484), + 'spread': __webpack_require__(494), + 'throttle': __webpack_require__(498), + 'unary': __webpack_require__(503), + 'wrap': __webpack_require__(509) +}; + + +/***/ }), +/* 440 */ /***/ (function(module, exports, __webpack_require__) { -var baseDelay = __webpack_require__(147), - baseRest = __webpack_require__(4); +var baseFunctions = __webpack_require__(99), + keys = __webpack_require__(10); /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. + * Creates an array of function property names from own enumerable properties + * of `object`. * * @static - * @memberOf _ * @since 0.1.0 - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn * @example * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => Logs 'deferred' after one millisecond. + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] */ -var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); -}); +function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); +} -module.exports = defer; +module.exports = functions; /***/ }), -/* 413 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { -var baseDelay = __webpack_require__(147), - baseRest = __webpack_require__(4), - toNumber = __webpack_require__(50); +var baseFunctions = __webpack_require__(99), + keysIn = __webpack_require__(13); /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions * @example * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => Logs 'later' after one second. + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] */ -var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); -}); - -module.exports = delay; - - -/***/ }), -/* 414 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(209); - - -/***/ }), -/* 415 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(210); - - -/***/ }), -/* 416 */ -/***/ (function(module, exports, __webpack_require__) { +function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); +} -module.exports = __webpack_require__(220); +module.exports = functionsIn; /***/ }), -/* 417 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(221); - +var baseAssignValue = __webpack_require__(22), + createAggregator = __webpack_require__(68); -/***/ }), -/* 418 */ -/***/ (function(module, exports, __webpack_require__) { +/** Used for built-in method references. */ +var objectProto = Object.prototype; -var arrayEvery = __webpack_require__(142), - baseEvery = __webpack_require__(301), - baseIteratee = __webpack_require__(3), - isArray = __webpack_require__(1), - isIterateeCall = __webpack_require__(34); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * **Note:** This method returns `true` for - * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because - * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of - * elements of empty collections. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. * @example * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } */ -function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); } - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = every; - - -/***/ }), -/* 419 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(204); - - -/***/ }), -/* 420 */ -/***/ (function(module, exports, __webpack_require__) { +}); -module.exports = __webpack_require__(111); +module.exports = groupBy; /***/ }), -/* 421 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { -var arrayFilter = __webpack_require__(63), - baseFilter = __webpack_require__(149), - baseIteratee = __webpack_require__(3), - isArray = __webpack_require__(1); +var baseHas = __webpack_require__(302), + hasPath = __webpack_require__(189); /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). - * - * **Note:** Unlike `_.remove`, this method returns a new array. + * Checks if `path` is a direct property of `object`. * * @static - * @memberOf _ * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.reject + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] + * _.has(object, 'a'); + * // => true * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] + * _.has(object, 'a.b'); + * // => true * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] + * _.has(object, ['a', 'b']); + * // => true * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] + * _.has(other, 'a'); + * // => false */ -function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); +function has(object, path) { + return object != null && hasPath(object, path, baseHas); } -module.exports = filter; +module.exports = has; /***/ }), -/* 422 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { -var createFind = __webpack_require__(175), - findIndex = __webpack_require__(423); +var baseInRange = __webpack_require__(304), + toFinite = __webpack_require__(79), + toNumber = __webpack_require__(52); /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three - * arguments: (value, index|key, collection). + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; + * _.inRange(3, 2, 4); + * // => true * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' + * _.inRange(4, 8); + * // => true * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' + * _.inRange(4, 2); + * // => false * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' + * _.inRange(2, 2); + * // => false * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true */ -var find = createFind(findIndex); +function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); +} -module.exports = find; +module.exports = inRange; /***/ }), -/* 423 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { -var baseFindIndex = __webpack_require__(96), - baseIteratee = __webpack_require__(3), - toInteger = __webpack_require__(14); +var baseIndexOf = __webpack_require__(154), + isArrayLike = __webpack_require__(16), + isString = __webpack_require__(212), + toInteger = __webpack_require__(14), + values = __webpack_require__(53); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. * * @static * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 + * _.includes([1, 2, 3], 1); + * // => true * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 + * _.includes([1, 2, 3], 1, 2); + * // => false * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 + * _.includes('abcd', 'bc'); + * // => true */ -function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); } - return baseFindIndex(array, baseIteratee(predicate, 3), index); + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } -module.exports = findIndex; +module.exports = includes; /***/ }), -/* 424 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { -var baseFindKey = __webpack_require__(150), - baseForOwn = __webpack_require__(31), - baseIteratee = __webpack_require__(3); +var constant = __webpack_require__(112), + createInverter = __webpack_require__(179), + identity = __webpack_require__(28); /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. * * @static * @memberOf _ - * @since 1.1.0 + * @since 0.7.0 * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. * @example * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; + * var object = { 'a': 1, 'b': 2, 'c': 1 }; * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ +var invert = createInverter(function(result, value, key) { + result[value] = key; +}, constant(identity)); + +module.exports = invert; + + +/***/ }), +/* 447 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIteratee = __webpack_require__(4), + createInverter = __webpack_require__(179); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' + * var object = { 'a': 1, 'b': 2, 'c': 1 }; * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ -function findKey(object, predicate) { - return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); -} +var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } +}, baseIteratee); -module.exports = findKey; +module.exports = invertBy; /***/ }), -/* 425 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { -var createFind = __webpack_require__(175), - findLastIndex = __webpack_require__(426); +var baseInvoke = __webpack_require__(65), + baseRest = __webpack_require__(5); /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. + * Invokes the method at `path` of `object`. * * @static * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=collection.length-1] The index to search from. - * @returns {*} Returns the matched element, else `undefined`. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. * @example * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] */ -var findLast = createFind(findLastIndex); +var invoke = baseRest(baseInvoke); -module.exports = findLast; +module.exports = invoke; /***/ }), -/* 426 */ +/* 449 */ /***/ (function(module, exports, __webpack_require__) { -var baseFindIndex = __webpack_require__(96), - baseIteratee = __webpack_require__(3), - toInteger = __webpack_require__(14); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; +var apply = __webpack_require__(11), + baseEach = __webpack_require__(24), + baseInvoke = __webpack_require__(65), + baseRest = __webpack_require__(5), + isArrayLike = __webpack_require__(16); /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. * @example * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] */ -function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, baseIteratee(predicate, 3), index, true); -} +var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; -module.exports = findLastIndex; + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; +}); + +module.exports = invokeMap; /***/ }), -/* 427 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { -var baseFindKey = __webpack_require__(150), - baseForOwnRight = __webpack_require__(98), - baseIteratee = __webpack_require__(3); +var isArrayLike = __webpack_require__(16), + isObjectLike = __webpack_require__(20); /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. * * @static * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, - * else `undefined`. + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. * @example * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * _.isArrayLikeObject([1, 2, 3]); + * // => true * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' + * _.isArrayLikeObject(document.body.children); + * // => true * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' + * _.isArrayLikeObject('abc'); + * // => false * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' + * _.isArrayLikeObject(_.noop); + * // => false */ -function findLastKey(object, predicate) { - return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); } -module.exports = findLastKey; +module.exports = isArrayLikeObject; /***/ }), -/* 428 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { -var baseFlatten = __webpack_require__(40), - map = __webpack_require__(79); +var baseGetTag = __webpack_require__(25), + isObjectLike = __webpack_require__(20), + isPlainObject = __webpack_require__(116); + +/** `Object#toString` result references. */ +var domExcTag = '[object DOMException]', + errorTag = '[object Error]'; /** - * Creates a flattened array of values by running each element in `collection` - * thru `iteratee` and flattening the mapped results. The iteratee is invoked - * with three arguments: (value, index|key, collection). + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * - * function duplicate(n) { - * return [n, n]; - * } + * _.isError(new Error); + * // => true * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] + * _.isError(Error); + * // => false */ -function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } -module.exports = flatMap; +module.exports = isError; /***/ }), -/* 429 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { -var baseFlatten = __webpack_require__(40), - map = __webpack_require__(79); +var baseClone = __webpack_require__(50), + baseIteratee = __webpack_require__(4); -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results. + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. * * @static + * @since 4.0.0 * @memberOf _ - * @since 4.7.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. * @example * - * function duplicate(n) { - * return [[[n, n]]]; - * } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; * - * _.flatMapDeep([1, 2], duplicate); - * // => [1, 1, 2, 2] + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] */ -function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); } -module.exports = flatMapDeep; +module.exports = iteratee; /***/ }), -/* 430 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { -var baseFlatten = __webpack_require__(40), - map = __webpack_require__(79), - toInteger = __webpack_require__(14); +var baseAssignValue = __webpack_require__(22), + createAggregator = __webpack_require__(68); /** - * This method is like `_.flatMap` except that it recursively flattens the - * mapped results up to `depth` times. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). * * @static * @memberOf _ - * @since 4.7.0 + * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. * @example * - * function duplicate(n) { - * return [[[n, n]]]; - * } + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; * - * _.flatMapDepth([1, 2], duplicate, 2); - * // => [[1, 1], [2, 2]] + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ -function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); -} +var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); +}); -module.exports = flatMapDepth; +module.exports = keyBy; /***/ }), -/* 431 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { -var baseFlatten = __webpack_require__(40); +var baseAssignValue = __webpack_require__(22), + baseForOwn = __webpack_require__(31), + baseIteratee = __webpack_require__(4); /** - * Flattens `array` a single level deep. + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues * @example * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } */ -function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; +function mapKeys(object, iteratee) { + var result = {}; + iteratee = baseIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; } -module.exports = flatten; +module.exports = mapKeys; /***/ }), -/* 432 */ +/* 455 */ /***/ (function(module, exports, __webpack_require__) { -var createWrap = __webpack_require__(23); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_FLIP_FLAG = 512; +var baseAssignValue = __webpack_require__(22), + baseForOwn = __webpack_require__(31), + baseIteratee = __webpack_require__(4); /** - * Creates a function that invokes `func` with arguments reversed. + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). * * @static * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new flipped function. + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys * @example * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ -function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); +function mapValues(object, iteratee) { + var result = {}; + iteratee = baseIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; } -module.exports = flip; +module.exports = mapValues; /***/ }), -/* 433 */ +/* 456 */ /***/ (function(module, exports, __webpack_require__) { -var createFlow = __webpack_require__(176); +var baseClone = __webpack_require__(50), + baseMatches = __webpack_require__(158); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; /** - * Creates a function that returns the result of invoking the given functions - * with the `this` binding of the created function, where each successive - * invocation is supplied the return value of the previous. + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Util - * @param {...(Function|Function[])} [funcs] The functions to invoke. - * @returns {Function} Returns the new composite function. - * @see _.flowRight + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. * @example * - * function square(n) { - * return n * n; - * } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; * - * var addSquare = _.flow([_.add, square]); - * addSquare(1, 2); - * // => 9 + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] */ -var flow = createFlow(); +function matches(source) { + return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); +} -module.exports = flow; +module.exports = matches; /***/ }), -/* 434 */ +/* 457 */ /***/ (function(module, exports, __webpack_require__) { -var createFlow = __webpack_require__(176); +var baseClone = __webpack_require__(50), + baseMatchesProperty = __webpack_require__(159); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; /** - * This method is like `_.flow` except that it creates a function that - * invokes the given functions from right to left. + * Creates a function that performs a partial deep comparison between the + * value at `path` of a given object to `srcValue`, returning `true` if the + * object value is equivalent, else `false`. + * + * **Note:** Partial comparisons will match empty array and empty object + * `srcValue` values against any array or object value, respectively. See + * `_.isEqual` for a list of supported value comparisons. * * @static - * @since 3.0.0 * @memberOf _ + * @since 3.2.0 * @category Util - * @param {...(Function|Function[])} [funcs] The functions to invoke. - * @returns {Function} Returns the new composite function. - * @see _.flow + * @param {Array|string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. * @example * - * function square(n) { - * return n * n; - * } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; * - * var addSquare = _.flowRight([square, _.add]); - * addSquare(1, 2); - * // => 9 + * _.find(objects, _.matchesProperty('a', 4)); + * // => { 'a': 4, 'b': 5, 'c': 6 } */ -var flowRight = createFlow(true); +function matchesProperty(path, srcValue) { + return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); +} -module.exports = flowRight; +module.exports = matchesProperty; /***/ }), -/* 435 */ +/* 458 */ /***/ (function(module, exports, __webpack_require__) { -var baseFor = __webpack_require__(97), - castFunction = __webpack_require__(18), - keysIn = __webpack_require__(13); +var baseMerge = __webpack_require__(101), + createAssigner = __webpack_require__(43); /** - * Iterates over own and inherited enumerable string keyed properties of an - * object and invokes `iteratee` for each property. The iteratee is invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 0.3.0 + * @since 0.5.0 * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. - * @see _.forInRight * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; * - * Foo.prototype.c = 3; + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ -function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, castFunction(iteratee), keysIn); -} +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); -module.exports = forIn; +module.exports = merge; /***/ }), -/* 436 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { -var baseForRight = __webpack_require__(151), - castFunction = __webpack_require__(18), - keysIn = __webpack_require__(13); +var baseInvoke = __webpack_require__(65), + baseRest = __webpack_require__(5); /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. + * Creates a function that invokes the method at `path` of a given object. + * Any additional arguments are provided to the invoked method. * * @static * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forIn + * @since 3.7.0 + * @category Util + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Function} Returns the new invoker function. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * var objects = [ + * { 'a': { 'b': _.constant(2) } }, + * { 'a': { 'b': _.constant(1) } } + * ]; * - * Foo.prototype.c = 3; + * _.map(objects, _.method('a.b')); + * // => [2, 1] * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + * _.map(objects, _.method(['a', 'b'])); + * // => [2, 1] */ -function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, castFunction(iteratee), keysIn); -} +var method = baseRest(function(path, args) { + return function(object) { + return baseInvoke(object, path, args); + }; +}); -module.exports = forInRight; +module.exports = method; /***/ }), -/* 437 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { -var baseForOwn = __webpack_require__(31), - castFunction = __webpack_require__(18); +var baseInvoke = __webpack_require__(65), + baseRest = __webpack_require__(5); /** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. + * The opposite of `_.method`; this method creates a function that invokes + * the method at a given path of `object`. Any additional arguments are + * provided to the invoked method. * * @static * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight + * @since 3.7.0 + * @category Util + * @param {Object} object The object to query. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {Function} Returns the new invoker function. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * var array = _.times(3, _.constant), + * object = { 'a': array, 'b': array, 'c': array }; * - * Foo.prototype.c = 3; + * _.map(['a[2]', 'c[0]'], _.methodOf(object)); + * // => [2, 0] * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). + * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); + * // => [2, 0] */ -function forOwn(object, iteratee) { - return object && baseForOwn(object, castFunction(iteratee)); -} +var methodOf = baseRest(function(object, args) { + return function(path) { + return baseInvoke(object, path, args); + }; +}); -module.exports = forOwn; +module.exports = methodOf; /***/ }), -/* 438 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { -var baseForOwnRight = __webpack_require__(98), - castFunction = __webpack_require__(18); +var arrayEach = __webpack_require__(39), + arrayPush = __webpack_require__(49), + baseFunctions = __webpack_require__(99), + copyArray = __webpack_require__(27), + isFunction = __webpack_require__(36), + isObject = __webpack_require__(7), + keys = __webpack_require__(10); /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. * * @static + * @since 0.1.0 * @memberOf _ - * @since 2.0.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwn + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. * @example * - * function Foo() { - * this.a = 1; - * this.b = 2; + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); * } * - * Foo.prototype.c = 3; + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] */ -function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, castFunction(iteratee)); -} +function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); -module.exports = forOwnRight; + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + arrayEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); -/***/ }), -/* 439 */ -/***/ (function(module, exports, __webpack_require__) { + return object; +} -module.exports = { - 'after': __webpack_require__(395), - 'ary': __webpack_require__(203), - 'before': __webpack_require__(205), - 'bind': __webpack_require__(206), - 'bindKey': __webpack_require__(401), - 'curry': __webpack_require__(407), - 'curryRight': __webpack_require__(408), - 'debounce': __webpack_require__(208), - 'defer': __webpack_require__(412), - 'delay': __webpack_require__(413), - 'flip': __webpack_require__(432), - 'memoize': __webpack_require__(213), - 'negate': __webpack_require__(117), - 'once': __webpack_require__(467), - 'overArgs': __webpack_require__(470), - 'partial': __webpack_require__(216), - 'partialRight': __webpack_require__(473), - 'rearg': __webpack_require__(480), - 'rest': __webpack_require__(484), - 'spread': __webpack_require__(494), - 'throttle': __webpack_require__(498), - 'unary': __webpack_require__(503), - 'wrap': __webpack_require__(509) -}; +module.exports = mixin; /***/ }), -/* 440 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { -var baseFunctions = __webpack_require__(99), - keys = __webpack_require__(9); +var root = __webpack_require__(9); /** - * Creates an array of function property names from own enumerable properties - * of `object`. + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functionsIn + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. * @example * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. */ -function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); -} +var now = function() { + return root.Date.now(); +}; -module.exports = functions; +module.exports = now; /***/ }), -/* 441 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { -var baseFunctions = __webpack_require__(99), - keysIn = __webpack_require__(13); +var baseNth = __webpack_require__(314), + baseRest = __webpack_require__(5), + toInteger = __webpack_require__(14); /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. + * Creates a function that gets the argument at index `n`. If `n` is negative, + * the nth argument from the end is returned. * * @static * @memberOf _ * @since 4.0.0 - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the function names. - * @see _.functions + * @category Util + * @param {number} [n=0] The index of the argument to return. + * @returns {Function} Returns the new pass-thru function. * @example * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); + * var func = _.nthArg(1); + * func('a', 'b', 'c', 'd'); + * // => 'b' * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] + * var func = _.nthArg(-2); + * func('a', 'b', 'c', 'd'); + * // => 'c' */ -function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); +function nthArg(n) { + n = toInteger(n); + return baseRest(function(args) { + return baseNth(args, n); + }); } -module.exports = functionsIn; +module.exports = nthArg; /***/ }), -/* 442 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssignValue = __webpack_require__(22), - createAggregator = __webpack_require__(69); +module.exports = { + 'clamp': __webpack_require__(402), + 'inRange': __webpack_require__(444), + 'random': __webpack_require__(477) +}; -/** Used for built-in method references. */ -var objectProto = Object.prototype; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/***/ }), +/* 465 */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayMap = __webpack_require__(12), + baseClone = __webpack_require__(50), + baseUnset = __webpack_require__(167), + castPath = __webpack_require__(26), + copyObject = __webpack_require__(18), + customOmitClone = __webpack_require__(345), + flatRest = __webpack_require__(32), + getAllKeysIn = __webpack_require__(105); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The order of grouped values - * is determined by the order they occur in `collection`. The corresponding - * value of each key is an array of elements responsible for generating the - * key. The iteratee is invoked with one argument: (value). + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. * * @static - * @memberOf _ * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. * @example * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); +var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); } + return result; }); -module.exports = groupBy; +module.exports = omit; /***/ }), -/* 443 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { -var baseHas = __webpack_require__(302), - hasPath = __webpack_require__(188); +var baseIteratee = __webpack_require__(4), + negate = __webpack_require__(117), + pickBy = __webpack_require__(218); /** - * Checks if `path` is a direct property of `object`. + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). * * @static - * @since 0.1.0 * @memberOf _ + * @since 4.0.0 * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. * @example * - * var object = { 'a': { 'b': 2 } }; - * var other = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b'); - * // => true - * - * _.has(object, ['a', 'b']); - * // => true + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * _.has(other, 'a'); - * // => false + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } */ -function has(object, path) { - return object != null && hasPath(object, path, baseHas); +function omitBy(object, predicate) { + return pickBy(object, negate(baseIteratee(predicate))); } -module.exports = has; +module.exports = omitBy; /***/ }), -/* 444 */ +/* 467 */ /***/ (function(module, exports, __webpack_require__) { -var baseInRange = __webpack_require__(304), - toFinite = __webpack_require__(80), - toNumber = __webpack_require__(50); +var before = __webpack_require__(206); /** - * Checks if `n` is between `start` and up to, but not including, `end`. If - * `end` is not specified, it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ - * @since 3.3.0 - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @see _.range, _.rangeRight + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. * @example * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ +function once(func) { + return before(2, func); +} + +module.exports = once; + + +/***/ }), +/* 468 */ +/***/ (function(module, exports, __webpack_require__) { + +var baseOrderBy = __webpack_require__(160), + isArray = __webpack_require__(2); + +/** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. * - * _.inRange(1.2, 2); - * // => true + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example * - * _.inRange(5.2, 4); - * // => false + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; * - * _.inRange(-3, -2, -6); - * // => true + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ -function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); +function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; } - number = toNumber(number); - return baseInRange(number, start, end); + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); } -module.exports = inRange; +module.exports = orderBy; /***/ }), -/* 445 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { -var baseIndexOf = __webpack_require__(153), - isArrayLike = __webpack_require__(16), - isString = __webpack_require__(211), - toInteger = __webpack_require__(14), - values = __webpack_require__(51); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; +var arrayMap = __webpack_require__(12), + createOver = __webpack_require__(104); /** - * Checks if `value` is in `collection`. If `collection` is a string, it's - * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. + * Creates a function that invokes `iteratees` with the arguments it receives + * and returns their results. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @since 4.0.0 + * @category Util + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to invoke. + * @returns {Function} Returns the new function. * @example * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'a': 1, 'b': 2 }, 1); - * // => true + * var func = _.over([Math.max, Math.min]); * - * _.includes('abcd', 'bc'); - * // => true + * func(1, 2, 3, 4); + * // => [4, 1] */ -function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); -} +var over = createOver(arrayMap); -module.exports = includes; +module.exports = over; /***/ }), -/* 446 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { -var constant = __webpack_require__(112), - createInverter = __webpack_require__(178), - identity = __webpack_require__(29); +var apply = __webpack_require__(11), + arrayMap = __webpack_require__(12), + baseFlatten = __webpack_require__(41), + baseIteratee = __webpack_require__(4), + baseRest = __webpack_require__(5), + baseUnary = __webpack_require__(67), + castRest = __webpack_require__(327), + isArray = __webpack_require__(2); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite - * property assignments of previous values. + * Creates a function that invokes `func` with its arguments transformed. * * @static + * @since 4.0.0 * @memberOf _ - * @since 0.7.0 - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. * @example * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * function doubled(n) { + * return n * 2; + * } * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] */ -var invert = createInverter(function(result, value, key) { - result[value] = key; -}, constant(identity)); +var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(baseIteratee)) + : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee)); -module.exports = invert; + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); +}); -/***/ }), -/* 447 */ -/***/ (function(module, exports, __webpack_require__) { +module.exports = overArgs; -var baseIteratee = __webpack_require__(3), - createInverter = __webpack_require__(178); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/***/ }), +/* 471 */ +/***/ (function(module, exports, __webpack_require__) { -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +var arrayEvery = __webpack_require__(143), + createOver = __webpack_require__(104); /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` thru `iteratee`. The - * corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). + * Creates a function that checks if **all** of the `predicates` return + * truthy when invoked with the arguments it receives. * * @static * @memberOf _ - * @since 4.1.0 - * @category Object - * @param {Object} object The object to invert. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. + * @since 4.0.0 + * @category Util + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. + * @returns {Function} Returns the new function. * @example * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * var func = _.overEvery([Boolean, isFinite]); * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } + * func('1'); + * // => true * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + * func(null); + * // => false + * + * func(NaN); + * // => false */ -var invertBy = createInverter(function(result, value, key) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } -}, baseIteratee); +var overEvery = createOver(arrayEvery); -module.exports = invertBy; +module.exports = overEvery; /***/ }), -/* 448 */ +/* 472 */ /***/ (function(module, exports, __webpack_require__) { -var baseInvoke = __webpack_require__(66), - baseRest = __webpack_require__(4); +var arraySome = __webpack_require__(94), + createOver = __webpack_require__(104); /** - * Invokes the method at `path` of `object`. + * Creates a function that checks if **any** of the `predicates` return + * truthy when invoked with the arguments it receives. * * @static * @memberOf _ * @since 4.0.0 - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. + * @category Util + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. + * @returns {Function} Returns the new function. * @example * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * var func = _.overSome([Boolean, isFinite]); * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] + * func('1'); + * // => true + * + * func(null); + * // => true + * + * func(NaN); + * // => false */ -var invoke = baseRest(baseInvoke); +var overSome = createOver(arraySome); -module.exports = invoke; +module.exports = overSome; /***/ }), -/* 449 */ +/* 473 */ /***/ (function(module, exports, __webpack_require__) { -var apply = __webpack_require__(11), - baseEach = __webpack_require__(25), - baseInvoke = __webpack_require__(66), - baseRest = __webpack_require__(4), - isArrayLike = __webpack_require__(16); +var baseRest = __webpack_require__(5), + createWrap = __webpack_require__(23), + getHolder = __webpack_require__(44), + replaceHolders = __webpack_require__(35); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_PARTIAL_RIGHT_FLAG = 64; /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `path` is a function, it's invoked - * for, and `this` bound to, each element in `collection`. + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. * * @static * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. * @example * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' */ -var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; +var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); -module.exports = invokeMap; +// Assign default placeholders. +partialRight.placeholder = {}; + +module.exports = partialRight; /***/ }), -/* 450 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { -var isArrayLike = __webpack_require__(16), - isObjectLike = __webpack_require__(21); +var createAggregator = __webpack_require__(68); /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). * * @static * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. * @example * - * _.isArrayLikeObject([1, 2, 3]); - * // => true + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; * - * _.isArrayLikeObject(document.body.children); - * // => true + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] * - * _.isArrayLikeObject('abc'); - * // => false + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] * - * _.isArrayLikeObject(_.noop); - * // => false + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} +var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); +}, function() { return [[], []]; }); -module.exports = isArrayLikeObject; +module.exports = partition; /***/ }), -/* 451 */ +/* 475 */ /***/ (function(module, exports, __webpack_require__) { -var baseGetTag = __webpack_require__(26), - isObjectLike = __webpack_require__(21), - isPlainObject = __webpack_require__(116); - -/** `Object#toString` result references. */ -var domExcTag = '[object DOMException]', - errorTag = '[object Error]'; +var basePick = __webpack_require__(315), + flatRest = __webpack_require__(32); /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. + * Creates an object composed of the picked `object` properties. * * @static + * @since 0.1.0 * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. * @example * - * _.isError(new Error); - * // => true + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * _.isError(Error); - * // => false + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } */ -function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); -} +var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); +}); -module.exports = isError; +module.exports = pick; /***/ }), -/* 452 */ +/* 476 */ /***/ (function(module, exports, __webpack_require__) { -var baseClone = __webpack_require__(48), - baseIteratee = __webpack_require__(3); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; +var baseGet = __webpack_require__(42); /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name, the created function returns the - * property value for a given element. If `func` is an array or object, the - * created function returns `true` for elements that contain the equivalent - * source properties, otherwise it returns `false`. + * The opposite of `_.property`; this method creates a function that returns + * the value at a given path of `object`. * * @static - * @since 4.0.0 * @memberOf _ + * @since 3.0.0 * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); - * // => [{ 'user': 'barney', 'age': 36, 'active': true }] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, _.iteratee(['user', 'fred'])); - * // => [{ 'user': 'fred', 'age': 40 }] - * - * // The `_.property` iteratee shorthand. - * _.map(users, _.iteratee('user')); - * // => ['barney', 'fred'] + * var array = [0, 1, 2], + * object = { 'a': array, 'b': array, 'c': array }; * - * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { - * return !_.isRegExp(func) ? iteratee(func) : function(string) { - * return func.test(string); - * }; - * }); + * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); + * // => [2, 0] * - * _.filter(['abc', 'def'], /ef/); - * // => ['def'] + * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); + * // => [2, 0] */ -function iteratee(func) { - return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); +function propertyOf(object) { + return function(path) { + return object == null ? undefined : baseGet(object, path); + }; } -module.exports = iteratee; +module.exports = propertyOf; /***/ }), -/* 453 */ +/* 477 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssignValue = __webpack_require__(22), - createAggregator = __webpack_require__(69); +var baseRandom = __webpack_require__(102), + isIterateeCall = __webpack_require__(34), + toFinite = __webpack_require__(79); + +/** Built-in method references without a dependency on `root`. */ +var freeParseFloat = parseFloat; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min, + nativeRandom = Math.random; /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` thru `iteratee`. The corresponding value of - * each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. * * @static * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. * @example * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; + * _.random(0, 5); + * // => an integer between 0 and 5 * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * _.random(5); + * // => also an integer between 0 and 5 * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 */ -var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); -}); +function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); +} -module.exports = keyBy; +module.exports = random; /***/ }), -/* 454 */ +/* 478 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssignValue = __webpack_require__(22), - baseForOwn = __webpack_require__(31), - baseIteratee = __webpack_require__(3); +var createRange = __webpack_require__(180); /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * string keyed property of `object` thru `iteratee`. The iteratee is invoked - * with three arguments: (value, key, object). + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to, but not including, `end`. A step of `-1` is used if a negative + * `start` is specified without an `end` or `step`. If `end` is not specified, + * it's set to `start` with `start` then set to `0`. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. * * @static + * @since 0.1.0 * @memberOf _ - * @since 3.8.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapValues + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the range of numbers. + * @see _.inRange, _.rangeRight * @example * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(-4); + * // => [0, -1, -2, -3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] */ -function mapKeys(object, iteratee) { - var result = {}; - iteratee = baseIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; -} +var range = createRange(); -module.exports = mapKeys; +module.exports = range; /***/ }), -/* 455 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { -var baseAssignValue = __webpack_require__(22), - baseForOwn = __webpack_require__(31), - baseIteratee = __webpack_require__(3); +var createRange = __webpack_require__(180); /** - * Creates an object with the same keys as `object` and values generated - * by running each own enumerable string keyed property of `object` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, key, object). + * This method is like `_.range` except that it populates values in + * descending order. * * @static * @memberOf _ - * @since 2.4.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @see _.mapKeys + * @since 4.0.0 + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the range of numbers. + * @see _.inRange, _.range * @example * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; + * _.rangeRight(4); + * // => [3, 2, 1, 0] * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * _.rangeRight(-4); + * // => [-3, -2, -1, 0] * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * _.rangeRight(1, 5); + * // => [4, 3, 2, 1] + * + * _.rangeRight(0, 20, 5); + * // => [15, 10, 5, 0] + * + * _.rangeRight(0, -4, -1); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 4, 0); + * // => [1, 1, 1] + * + * _.rangeRight(0); + * // => [] */ -function mapValues(object, iteratee) { - var result = {}; - iteratee = baseIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; -} +var rangeRight = createRange(true); -module.exports = mapValues; +module.exports = rangeRight; /***/ }), -/* 456 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { -var baseClone = __webpack_require__(48), - baseMatches = __webpack_require__(157); +var createWrap = __webpack_require__(23), + flatRest = __webpack_require__(32); -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; +/** Used to compose bitmasks for function metadata. */ +var WRAP_REARG_FLAG = 256; /** - * Creates a function that performs a partial deep comparison between a given - * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. - * - * **Note:** The created function is equivalent to `_.isMatch` with `source` - * partially applied. - * - * Partial comparisons will match empty array and empty object `source` - * values against any array or object value, respectively. See `_.isEqual` - * for a list of supported value comparisons. + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 - * @category Util - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. * @example * - * var objects = [ - * { 'a': 1, 'b': 2, 'c': 3 }, - * { 'a': 4, 'b': 5, 'c': 6 } - * ]; + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); * - * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); - * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] */ -function matches(source) { - return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); -} +var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); +}); -module.exports = matches; +module.exports = rearg; /***/ }), -/* 457 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { -var baseClone = __webpack_require__(48), - baseMatchesProperty = __webpack_require__(158); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; +var arrayReduce = __webpack_require__(93), + baseEach = __webpack_require__(24), + baseIteratee = __webpack_require__(4), + baseReduce = __webpack_require__(163), + isArray = __webpack_require__(2); /** - * Creates a function that performs a partial deep comparison between the - * value at `path` of a given object to `srcValue`, returning `true` if the - * object value is equivalent, else `false`. + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). * - * **Note:** Partial comparisons will match empty array and empty object - * `srcValue` values against any array or object value, respectively. See - * `_.isEqual` for a list of supported value comparisons. + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` * * @static * @memberOf _ - * @since 3.2.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight * @example * - * var objects = [ - * { 'a': 1, 'b': 2, 'c': 3 }, - * { 'a': 4, 'b': 5, 'c': 6 } - * ]; + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 * - * _.find(objects, _.matchesProperty('a', 4)); - * // => { 'a': 4, 'b': 5, 'c': 6 } + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ -function matchesProperty(path, srcValue) { - return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); +function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); } -module.exports = matchesProperty; +module.exports = reduce; /***/ }), -/* 458 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { -var baseMerge = __webpack_require__(101), - createAssigner = __webpack_require__(42); +var arrayReduceRight = __webpack_require__(292), + baseEachRight = __webpack_require__(149), + baseIteratee = __webpack_require__(4), + baseReduce = __webpack_require__(163), + isArray = __webpack_require__(2); /** - * This method is like `_.assign` except that it recursively merges own and - * inherited enumerable string keyed properties of source objects into the - * destination object. Source properties that resolve to `undefined` are - * skipped if a destination value exists. Array and plain object properties - * are merged recursively. Other objects and value types are overridden by - * assignment. Source objects are applied from left to right. Subsequent - * sources overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object`. + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. * * @static * @memberOf _ - * @since 0.5.0 - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce * @example * - * var object = { - * 'a': [{ 'b': 2 }, { 'd': 4 }] - * }; - * - * var other = { - * 'a': [{ 'c': 3 }, { 'e': 5 }] - * }; + * var array = [[0, 1], [2, 3], [4, 5]]; * - * _.merge(object, other); - * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] */ -var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); -}); +function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; -module.exports = merge; + return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); +} + +module.exports = reduceRight; /***/ }), -/* 459 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { -var baseInvoke = __webpack_require__(66), - baseRest = __webpack_require__(4); +var arrayFilter = __webpack_require__(62), + baseFilter = __webpack_require__(150), + baseIteratee = __webpack_require__(4), + isArray = __webpack_require__(2), + negate = __webpack_require__(117); /** - * Creates a function that invokes the method at `path` of a given object. - * Any additional arguments are provided to the invoked method. + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. * * @static * @memberOf _ - * @since 3.7.0 - * @category Util - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Function} Returns the new invoker function. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter * @example * - * var objects = [ - * { 'a': { 'b': _.constant(2) } }, - * { 'a': { 'b': _.constant(1) } } + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } * ]; * - * _.map(objects, _.method('a.b')); - * // => [2, 1] + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] * - * _.map(objects, _.method(['a', 'b'])); - * // => [2, 1] + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] */ -var method = baseRest(function(path, args) { - return function(object) { - return baseInvoke(object, path, args); - }; -}); +function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(baseIteratee(predicate, 3))); +} -module.exports = method; +module.exports = reject; /***/ }), -/* 460 */ +/* 484 */ /***/ (function(module, exports, __webpack_require__) { -var baseInvoke = __webpack_require__(66), - baseRest = __webpack_require__(4); +var baseRest = __webpack_require__(5), + toInteger = __webpack_require__(14); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /** - * The opposite of `_.method`; this method creates a function that invokes - * the method at a given path of `object`. Any additional arguments are - * provided to the invoked method. + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ - * @since 3.7.0 - * @category Util - * @param {Object} object The object to query. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Function} Returns the new invoker function. + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. * @example * - * var array = _.times(3, _.constant), - * object = { 'a': array, 'b': array, 'c': array }; - * - * _.map(['a[2]', 'c[0]'], _.methodOf(object)); - * // => [2, 0] + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); * - * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); - * // => [2, 0] + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' */ -var methodOf = baseRest(function(object, args) { - return function(path) { - return baseInvoke(object, path, args); - }; -}); +function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); +} -module.exports = methodOf; +module.exports = rest; /***/ }), -/* 461 */ +/* 485 */ /***/ (function(module, exports, __webpack_require__) { -var arrayEach = __webpack_require__(38), - arrayPush = __webpack_require__(47), - baseFunctions = __webpack_require__(99), - copyArray = __webpack_require__(28), +var castPath = __webpack_require__(26), isFunction = __webpack_require__(36), - isObject = __webpack_require__(6), - keys = __webpack_require__(9); + toKey = __webpack_require__(19); /** - * Adds all own enumerable string keyed function properties of a source - * object to the destination object. If `object` is a function, then methods - * are added to its prototype as well. - * - * **Note:** Use `_.runInContext` to create a pristine `lodash` function to - * avoid conflicts caused by modifying the original. + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. * * @static * @since 0.1.0 * @memberOf _ - * @category Util - * @param {Function|Object} [object=lodash] The destination object. - * @param {Object} source The object of functions to add. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.chain=true] Specify whether mixins are chainable. - * @returns {Function|Object} Returns `object`. + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. * @example * - * function vowels(string) { - * return _.filter(string, function(v) { - * return /[aeiou]/i.test(v); - * }); - * } + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * - * _.mixin({ 'vowels': vowels }); - * _.vowels('fred'); - * // => ['e'] + * _.result(object, 'a[0].b.c1'); + * // => 3 * - * _('fred').vowels().value(); - * // => ['e'] + * _.result(object, 'a[0].b.c2'); + * // => 4 * - * _.mixin({ 'vowels': vowels }, { 'chain': false }); - * _('fred').vowels(); - * // => ['e'] + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' */ -function mixin(object, source, options) { - var props = keys(source), - methodNames = baseFunctions(source, props); - - var chain = !(isObject(options) && 'chain' in options) || !!options.chain, - isFunc = isFunction(object); +function result(object, path, defaultValue) { + path = castPath(path, object); - arrayEach(methodNames, function(methodName) { - var func = source[methodName]; - object[methodName] = func; - if (isFunc) { - object.prototype[methodName] = function() { - var chainAll = this.__chain__; - if (chain || chainAll) { - var result = object(this.__wrapped__), - actions = result.__actions__ = copyArray(this.__actions__); + var index = -1, + length = path.length; - actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); - result.__chain__ = chainAll; - return result; - } - return func.apply(object, arrayPush([this.value()], arguments)); - }; + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; } - }); - + object = isFunction(value) ? value.call(object) : value; + } return object; } -module.exports = mixin; +module.exports = result; /***/ }), -/* 462 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { -var root = __webpack_require__(8); +var arraySample = __webpack_require__(145), + baseSample = __webpack_require__(318), + isArray = __webpack_require__(2); /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). + * Gets a random element from `collection`. * * @static * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. * @example * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. + * _.sample([1, 2, 3, 4]); + * // => 2 */ -var now = function() { - return root.Date.now(); -}; +function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); +} -module.exports = now; +module.exports = sample; /***/ }), -/* 463 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { -var baseNth = __webpack_require__(314), - baseRest = __webpack_require__(4), +var arraySampleSize = __webpack_require__(293), + baseSampleSize = __webpack_require__(319), + isArray = __webpack_require__(2), + isIterateeCall = __webpack_require__(34), toInteger = __webpack_require__(14); /** - * Creates a function that gets the argument at index `n`. If `n` is negative, - * the nth argument from the end is returned. + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 - * @category Util - * @param {number} [n=0] The index of the argument to return. - * @returns {Function} Returns the new pass-thru function. + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. * @example * - * var func = _.nthArg(1); - * func('a', 'b', 'c', 'd'); - * // => 'b' + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] * - * var func = _.nthArg(-2); - * func('a', 'b', 'c', 'd'); - * // => 'c' + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] */ -function nthArg(n) { - n = toInteger(n); - return baseRest(function(args) { - return baseNth(args, n); - }); +function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); } -module.exports = nthArg; +module.exports = sampleSize; /***/ }), -/* 464 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { - 'clamp': __webpack_require__(402), - 'inRange': __webpack_require__(444), - 'random': __webpack_require__(477) -}; +var baseSet = __webpack_require__(66); + +/** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ +function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); +} + +module.exports = set; /***/ }), -/* 465 */ +/* 489 */ /***/ (function(module, exports, __webpack_require__) { -var arrayMap = __webpack_require__(12), - baseClone = __webpack_require__(48), - baseUnset = __webpack_require__(166), - castPath = __webpack_require__(27), - copyObject = __webpack_require__(19), - customOmitClone = __webpack_require__(345), - flatRest = __webpack_require__(32), - getAllKeysIn = __webpack_require__(105); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; +var baseSet = __webpack_require__(66); /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable property paths of `object` that are not omitted. + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). * - * **Note:** This method is considerably slower than `_.pick`. + * **Note:** This method mutates `object`. * * @static - * @since 0.1.0 * @memberOf _ + * @since 4.0.0 * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to omit. - * @returns {Object} Returns the new object. + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * var object = {}; * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } */ -var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; -}); +function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); +} -module.exports = omit; +module.exports = setWith; /***/ }), -/* 466 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { -var baseIteratee = __webpack_require__(3), - negate = __webpack_require__(117), - pickBy = __webpack_require__(217); +var arrayShuffle = __webpack_require__(294), + baseShuffle = __webpack_require__(321), + isArray = __webpack_require__(2); /** - * The opposite of `_.pickBy`; this method creates an object composed of - * the own and inherited enumerable string keyed properties of `object` that - * `predicate` doesn't return truthy for. The predicate is invoked with two - * arguments: (value, key). + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The source object. - * @param {Function} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] */ -function omitBy(object, predicate) { - return pickBy(object, negate(baseIteratee(predicate))); +function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); } -module.exports = omitBy; +module.exports = shuffle; /***/ }), -/* 467 */ +/* 491 */ /***/ (function(module, exports, __webpack_require__) { -var before = __webpack_require__(205); +var baseKeys = __webpack_require__(156), + getTag = __webpack_require__(72), + isArrayLike = __webpack_require__(16), + isString = __webpack_require__(212), + stringSize = __webpack_require__(391); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. * @example * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // => `createApplication` is invoked once + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 */ -function once(func) { - return before(2, func); +function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; } -module.exports = once; +module.exports = size; /***/ }), -/* 468 */ +/* 492 */ /***/ (function(module, exports, __webpack_require__) { -var baseOrderBy = __webpack_require__(159), - isArray = __webpack_require__(1); +var arraySome = __webpack_require__(94), + baseIteratee = __webpack_require__(4), + baseSome = __webpack_require__(322), + isArray = __webpack_require__(2), + isIterateeCall = __webpack_require__(34); /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ - * @since 4.0.0 + * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] - * The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. - * @returns {Array} Returns the new sorted array. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. * @example * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 36 } + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } * ]; * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true */ -function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; +function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; } - return baseOrderBy(collection, iteratees, orders); + return func(collection, baseIteratee(predicate, 3)); } -module.exports = orderBy; +module.exports = some; /***/ }), -/* 469 */ +/* 493 */ /***/ (function(module, exports, __webpack_require__) { -var arrayMap = __webpack_require__(12), - createOver = __webpack_require__(104); +var baseFlatten = __webpack_require__(41), + baseOrderBy = __webpack_require__(160), + baseRest = __webpack_require__(5), + isIterateeCall = __webpack_require__(34); /** - * Creates a function that invokes `iteratees` with the arguments it receives - * and returns their results. + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ - * @since 4.0.0 - * @category Util + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to invoke. - * @returns {Function} Returns the new function. + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. * @example * - * var func = _.over([Math.max, Math.min]); + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; * - * func(1, 2, 3, 4); - * // => [4, 1] + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ -var over = createOver(arrayMap); +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); -module.exports = over; +module.exports = sortBy; /***/ }), -/* 470 */ +/* 494 */ /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__(11), - arrayMap = __webpack_require__(12), - baseFlatten = __webpack_require__(40), - baseIteratee = __webpack_require__(3), - baseRest = __webpack_require__(4), - baseUnary = __webpack_require__(68), - castRest = __webpack_require__(327), - isArray = __webpack_require__(1); + arrayPush = __webpack_require__(49), + baseRest = __webpack_require__(5), + castSlice = __webpack_require__(328), + toInteger = __webpack_require__(14); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +var nativeMax = Math.max; /** - * Creates a function that invokes `func` with its arguments transformed. + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). * * @static - * @since 4.0.0 * @memberOf _ + * @since 3.2.0 * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms=[_.identity]] - * The argument transforms. + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, [square, doubled]); + * say(['fred', 'hello']); + * // => 'fred says hello' * - * func(9, 3); - * // => [81, 6] + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); * - * func(10, 5); - * // => [100, 10] + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 */ -var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(baseIteratee)) - : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee)); - - var funcsLength = transforms.length; +function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); + var array = args[start], + otherArgs = castSlice(args, 0, start); - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); + if (array) { + arrayPush(otherArgs, array); } - return apply(func, this, args); + return apply(func, this, otherArgs); }); -}); +} -module.exports = overArgs; +module.exports = spread; /***/ }), -/* 471 */ -/***/ (function(module, exports, __webpack_require__) { - -var arrayEvery = __webpack_require__(142), - createOver = __webpack_require__(104); +/* 495 */ +/***/ (function(module, exports) { /** - * Creates a function that checks if **all** of the `predicates` return - * truthy when invoked with the arguments it receives. + * This method returns a new empty object. * * @static * @memberOf _ - * @since 4.0.0 + * @since 4.13.0 * @category Util - * @param {...(Function|Function[])} [predicates=[_.identity]] - * The predicates to check. - * @returns {Function} Returns the new function. + * @returns {Object} Returns the new empty object. * @example * - * var func = _.overEvery([Boolean, isFinite]); - * - * func('1'); - * // => true + * var objects = _.times(2, _.stubObject); * - * func(null); - * // => false + * console.log(objects); + * // => [{}, {}] * - * func(NaN); + * console.log(objects[0] === objects[1]); * // => false */ -var overEvery = createOver(arrayEvery); +function stubObject() { + return {}; +} -module.exports = overEvery; +module.exports = stubObject; /***/ }), -/* 472 */ -/***/ (function(module, exports, __webpack_require__) { - -var arraySome = __webpack_require__(94), - createOver = __webpack_require__(104); +/* 496 */ +/***/ (function(module, exports) { /** - * Creates a function that checks if **any** of the `predicates` return - * truthy when invoked with the arguments it receives. + * This method returns an empty string. * * @static * @memberOf _ - * @since 4.0.0 + * @since 4.13.0 * @category Util - * @param {...(Function|Function[])} [predicates=[_.identity]] - * The predicates to check. - * @returns {Function} Returns the new function. + * @returns {string} Returns the empty string. * @example * - * var func = _.overSome([Boolean, isFinite]); - * - * func('1'); - * // => true + * _.times(2, _.stubString); + * // => ['', ''] + */ +function stubString() { + return ''; +} + +module.exports = stubString; + + +/***/ }), +/* 497 */ +/***/ (function(module, exports) { + +/** + * This method returns `true`. * - * func(null); - * // => true + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `true`. + * @example * - * func(NaN); - * // => false + * _.times(2, _.stubTrue); + * // => [true, true] */ -var overSome = createOver(arraySome); +function stubTrue() { + return true; +} -module.exports = overSome; +module.exports = stubTrue; /***/ }), -/* 473 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { -var baseRest = __webpack_require__(4), - createWrap = __webpack_require__(23), - getHolder = __webpack_require__(43), - replaceHolders = __webpack_require__(35); +var debounce = __webpack_require__(209), + isObject = __webpack_require__(7); -/** Used to compose bitmasks for function metadata. */ -var WRAP_PARTIAL_RIGHT_FLAG = 64; +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /** - * This method is like `_.partial` except that partially applied arguments - * are appended to the arguments it receives. + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ - * @since 1.0.0 + * @since 0.1.0 * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. * @example * - * function greet(greeting, name) { - * return greeting + ' ' + name; - * } + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); */ -var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); -}); +function throttle(func, wait, options) { + var leading = true, + trailing = true; -// Assign default placeholders. -partialRight.placeholder = {}; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); +} -module.exports = partialRight; +module.exports = throttle; /***/ }), -/* 474 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { -var createAggregator = __webpack_require__(69); +var baseTimes = __webpack_require__(166), + castFunction = __webpack_require__(17), + toInteger = __webpack_require__(14); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). + * Invokes the iteratee `n` times, returning an array of the results of + * each invocation. The iteratee is invoked with one argument; (index). * * @static + * @since 0.1.0 * @memberOf _ - * @since 3.0.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. + * @category Util + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of results. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] + * _.times(3, String); + * // => ['0', '1', '2'] * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] + * _.times(4, _.constant(0)); + * // => [0, 0, 0, 0] */ -var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); -}, function() { return [[], []]; }); +function times(n, iteratee) { + n = toInteger(n); + if (n < 1 || n > MAX_SAFE_INTEGER) { + return []; + } + var index = MAX_ARRAY_LENGTH, + length = nativeMin(n, MAX_ARRAY_LENGTH); -module.exports = partition; + iteratee = castFunction(iteratee); + n -= MAX_ARRAY_LENGTH; + + var result = baseTimes(length, iteratee); + while (++index < n) { + iteratee(index); + } + return result; +} + +module.exports = times; /***/ }), -/* 475 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { -var basePick = __webpack_require__(315), - flatRest = __webpack_require__(32); +var arrayMap = __webpack_require__(12), + copyArray = __webpack_require__(27), + isArray = __webpack_require__(2), + isSymbol = __webpack_require__(47), + stringToPath = __webpack_require__(202), + toKey = __webpack_require__(19), + toString = __webpack_require__(120); /** - * Creates an object composed of the picked `object` properties. + * Converts `value` to a property path array. * * @static - * @since 0.1.0 * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [paths] The property paths to pick. - * @returns {Object} Returns the new object. + * @since 4.0.0 + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. * @example * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] */ -var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); -}); +function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); +} -module.exports = pick; +module.exports = toPath; /***/ }), -/* 476 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { -var baseGet = __webpack_require__(41); +var copyObject = __webpack_require__(18), + keysIn = __webpack_require__(13); /** - * The opposite of `_.property`; this method creates a function that returns - * the value at a given path of `object`. + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 - * @category Util - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. * @example * - * var array = [0, 1, 2], - * object = { 'a': array, 'b': array, 'c': array }; + * function Foo() { + * this.b = 2; + * } * - * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); - * // => [2, 0] + * Foo.prototype.c = 3; * - * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); - * // => [2, 0] + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } */ -function propertyOf(object) { - return function(path) { - return object == null ? undefined : baseGet(object, path); - }; +function toPlainObject(value) { + return copyObject(value, keysIn(value)); } -module.exports = propertyOf; +module.exports = toPlainObject; /***/ }), -/* 477 */ +/* 502 */ /***/ (function(module, exports, __webpack_require__) { -var baseRandom = __webpack_require__(102), - isIterateeCall = __webpack_require__(34), - toFinite = __webpack_require__(80); - -/** Built-in method references without a dependency on `root`. */ -var freeParseFloat = parseFloat; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min, - nativeRandom = Math.random; +var arrayEach = __webpack_require__(39), + baseCreate = __webpack_require__(40), + baseForOwn = __webpack_require__(31), + baseIteratee = __webpack_require__(4), + getPrototype = __webpack_require__(71), + isArray = __webpack_require__(2), + isBuffer = __webpack_require__(51), + isFunction = __webpack_require__(36), + isObject = __webpack_require__(7), + isTypedArray = __webpack_require__(77); /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are - * floats, a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ - * @since 0.7.0 - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. * @example * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } */ -function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; +function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = baseIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); + else { + accumulator = {}; } } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; } -module.exports = random; +module.exports = transform; /***/ }), -/* 478 */ +/* 503 */ /***/ (function(module, exports, __webpack_require__) { -var createRange = __webpack_require__(179); +var ary = __webpack_require__(204); /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to, but not including, `end`. A step of `-1` is used if a negative - * `start` is specified without an `end` or `step`. If `end` is not specified, - * it's set to `start` with `start` then set to `0`. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. * * @static - * @since 0.1.0 * @memberOf _ - * @category Util - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the range of numbers. - * @see _.inRange, _.rangeRight + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. * @example * - * _.range(4); - * // => [0, 1, 2, 3] - * - * _.range(-4); - * // => [0, -1, -2, -3] - * - * _.range(1, 5); - * // => [1, 2, 3, 4] - * - * _.range(0, 20, 5); - * // => [0, 5, 10, 15] - * - * _.range(0, -4, -1); - * // => [0, -1, -2, -3] - * - * _.range(1, 4, 0); - * // => [1, 1, 1] - * - * _.range(0); - * // => [] + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] */ -var range = createRange(); +function unary(func) { + return ary(func, 1); +} -module.exports = range; +module.exports = unary; /***/ }), -/* 479 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { -var createRange = __webpack_require__(179); +var toString = __webpack_require__(120); + +/** Used to generate unique IDs. */ +var idCounter = 0; /** - * This method is like `_.range` except that it populates values in - * descending order. + * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static + * @since 0.1.0 * @memberOf _ - * @since 4.0.0 * @category Util - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the range of numbers. - * @see _.inRange, _.range + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. * @example * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] + * _.uniqueId('contact_'); + * // => 'contact_104' * - * _.rangeRight(0); - * // => [] + * _.uniqueId(); + * // => '105' */ -var rangeRight = createRange(true); +function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; +} -module.exports = rangeRight; +module.exports = uniqueId; /***/ }), -/* 480 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { -var createWrap = __webpack_require__(23), - flatRest = __webpack_require__(32); - -/** Used to compose bitmasks for function metadata. */ -var WRAP_REARG_FLAG = 256; +var baseUnset = __webpack_require__(167); /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified `indexes` where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, [2, 0, 1]); + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; */ -var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); -}); +function unset(object, path) { + return object == null ? true : baseUnset(object, path); +} -module.exports = rearg; +module.exports = unset; /***/ }), -/* 481 */ +/* 506 */ /***/ (function(module, exports, __webpack_require__) { -var arrayReduce = __webpack_require__(93), - baseEach = __webpack_require__(25), - baseIteratee = __webpack_require__(3), - baseReduce = __webpack_require__(162), - isArray = __webpack_require__(1); +var baseUpdate = __webpack_require__(168), + castFunction = __webpack_require__(17); /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` thru `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not given, the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduceRight + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. * @example * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 */ -function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach); +function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); } -module.exports = reduce; +module.exports = update; /***/ }), -/* 482 */ +/* 507 */ /***/ (function(module, exports, __webpack_require__) { -var arrayReduceRight = __webpack_require__(292), - baseEachRight = __webpack_require__(148), - baseIteratee = __webpack_require__(3), - baseReduce = __webpack_require__(162), - isArray = __webpack_require__(1); +var baseUpdate = __webpack_require__(168), + castFunction = __webpack_require__(17); /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @see _.reduce + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. * @example * - * var array = [[0, 1], [2, 3], [4, 5]]; + * var object = {}; * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } */ -function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); +function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } -module.exports = reduceRight; +module.exports = updateWith; /***/ }), -/* 483 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { -var arrayFilter = __webpack_require__(63), - baseFilter = __webpack_require__(149), - baseIteratee = __webpack_require__(3), - isArray = __webpack_require__(1), - negate = __webpack_require__(117); +var baseValues = __webpack_require__(169), + keysIn = __webpack_require__(13); /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @see _.filter + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] + * Foo.prototype.c = 3; * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) */ -function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(baseIteratee(predicate, 3))); +function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); } -module.exports = reject; +module.exports = valuesIn; /***/ }), -/* 484 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { -var baseRest = __webpack_require__(4), - toInteger = __webpack_require__(14); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +var castFunction = __webpack_require__(17), + partial = __webpack_require__(217); /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. * * @static * @memberOf _ - * @since 4.0.0 + * @since 0.1.0 * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; * }); * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' */ -function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? start : toInteger(start); - return baseRest(func, start); +function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); } -module.exports = rest; +module.exports = wrap; /***/ }), -/* 485 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { -var castPath = __webpack_require__(27), - isFunction = __webpack_require__(36), - toKey = __webpack_require__(20); +var LazyWrapper = __webpack_require__(89), + LodashWrapper = __webpack_require__(90), + baseLodash = __webpack_require__(100), + isArray = __webpack_require__(2), + isObjectLike = __webpack_require__(20), + wrapperClone = __webpack_require__(394); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * This method is like `_.get` except that if the resolved value is a - * function it's invoked with the `this` binding of its parent object and - * its result is returned. + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned for `undefined` resolved values. - * @returns {*} Returns the resolved value. + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. * @example * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * function square(n) { + * return n * n; + * } * - * _.result(object, 'a[0].b.c1'); - * // => 3 + * var wrapped = _([1, 2, 3]); * - * _.result(object, 'a[0].b.c2'); - * // => 4 + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' + * // Returns a wrapped value. + * var squares = wrapped.map(square); * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true */ -function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined; - } - while (++index < length) { - var value = object == null ? undefined : object[toKey(path[index])]; - if (value === undefined) { - index = length; - value = defaultValue; +function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); } - object = isFunction(value) ? value.call(object) : value; } - return object; + return new LodashWrapper(value); } -module.exports = result; +// Ensure wrappers are instances of `baseLodash`. +lodash.prototype = baseLodash.prototype; +lodash.prototype.constructor = lodash; + +module.exports = lodash; /***/ }), -/* 486 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { -var arraySample = __webpack_require__(144), - baseSample = __webpack_require__(318), - isArray = __webpack_require__(1); +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), +/* 512 */ +/***/ (function(module, exports) { + +var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0); + +/** + * Helper class to create a webGL buffer + * + * @class + * @memberof PIXI.glCore + * @param gl {WebGLRenderingContext} The current WebGL rendering context + * @param type {gl.ARRAY_BUFFER | gl.ELEMENT_ARRAY_BUFFER} @mat + * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data + * @param drawType {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW} + */ +var Buffer = function(gl, type, data, drawType) +{ + + /** + * The current WebGL rendering context + * + * @member {WebGLRenderingContext} + */ + this.gl = gl; + + /** + * The WebGL buffer, created upon instantiation + * + * @member {WebGLBuffer} + */ + this.buffer = gl.createBuffer(); + + /** + * The type of the buffer + * + * @member {gl.ARRAY_BUFFER|gl.ELEMENT_ARRAY_BUFFER} + */ + this.type = type || gl.ARRAY_BUFFER; + + /** + * The draw type of the buffer + * + * @member {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW} + */ + this.drawType = drawType || gl.STATIC_DRAW; + + /** + * The data in the buffer, as a typed array + * + * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} + */ + this.data = EMPTY_ARRAY_BUFFER; + + if(data) + { + this.upload(data); + } + + this._updateID = 0; +}; + +/** + * Uploads the buffer to the GPU + * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data to upload + * @param offset {Number} if only a subset of the data should be uploaded, this is the amount of data to subtract + * @param dontBind {Boolean} whether to bind the buffer before uploading it + */ +Buffer.prototype.upload = function(data, offset, dontBind) +{ + // todo - needed? + if(!dontBind) this.bind(); + + var gl = this.gl; + + data = data || this.data; + offset = offset || 0; + + if(this.data.byteLength >= data.byteLength) + { + gl.bufferSubData(this.type, offset, data); + } + else + { + gl.bufferData(this.type, data, this.drawType); + } + this.data = data; +}; /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @since 2.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example + * Binds the buffer * - * _.sample([1, 2, 3, 4]); - * // => 2 */ -function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); -} - -module.exports = sample; +Buffer.prototype.bind = function() +{ + var gl = this.gl; + gl.bindBuffer(this.type, this.buffer); +}; +Buffer.createVertexBuffer = function(gl, data, drawType) +{ + return new Buffer(gl, gl.ARRAY_BUFFER, data, drawType); +}; -/***/ }), -/* 487 */ -/***/ (function(module, exports, __webpack_require__) { +Buffer.createIndexBuffer = function(gl, data, drawType) +{ + return new Buffer(gl, gl.ELEMENT_ARRAY_BUFFER, data, drawType); +}; -var arraySampleSize = __webpack_require__(293), - baseSampleSize = __webpack_require__(319), - isArray = __webpack_require__(1), - isIterateeCall = __webpack_require__(34), - toInteger = __webpack_require__(14); +Buffer.create = function(gl, type, data, drawType) +{ + return new Buffer(gl, type, data, drawType); +}; /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=1] The number of elements to sample. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] + * Destroys the buffer * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] */ -function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); -} +Buffer.prototype.destroy = function(){ + this.gl.deleteBuffer(this.buffer); +}; -module.exports = sampleSize; +module.exports = Buffer; /***/ }), -/* 488 */ +/* 513 */ /***/ (function(module, exports, __webpack_require__) { -var baseSet = __webpack_require__(67); + +var Texture = __webpack_require__(225); /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 3.7.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 + * Helper class to create a webGL Framebuffer * - * _.set(object, ['x', '0', 'y', 'z'], 5); - * console.log(object.x[0].y.z); - * // => 5 + * @class + * @memberof PIXI.glCore + * @param gl {WebGLRenderingContext} The current WebGL rendering context + * @param width {Number} the width of the drawing area of the frame buffer + * @param height {Number} the height of the drawing area of the frame buffer */ -function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); -} +var Framebuffer = function(gl, width, height) +{ + /** + * The current WebGL rendering context + * + * @member {WebGLRenderingContext} + */ + this.gl = gl; -module.exports = set; + /** + * The frame buffer + * + * @member {WebGLFramebuffer} + */ + this.framebuffer = gl.createFramebuffer(); + /** + * The stencil buffer + * + * @member {WebGLRenderbuffer} + */ + this.stencil = null; -/***/ }), -/* 489 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * The stencil buffer + * + * @member {PIXI.glCore.GLTexture} + */ + this.texture = null; -var baseSet = __webpack_require__(67); + /** + * The width of the drawing area of the buffer + * + * @member {Number} + */ + this.width = width || 100; + /** + * The height of the drawing area of the buffer + * + * @member {Number} + */ + this.height = height || 100; +}; /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.setWith(object, '[0][1]', 'a', Object); - * // => { '0': { '1': 'a' } } + * Adds a texture to the frame buffer + * @param texture {PIXI.glCore.GLTexture} */ -function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); -} +Framebuffer.prototype.enableTexture = function(texture) +{ + var gl = this.gl; -module.exports = setWith; + this.texture = texture || new Texture(gl); + this.texture.bind(); -/***/ }), -/* 490 */ -/***/ (function(module, exports, __webpack_require__) { + //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); -var arrayShuffle = __webpack_require__(294), - baseShuffle = __webpack_require__(321), - isArray = __webpack_require__(1); + this.bind(); + + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0); +}; /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] + * Initialises the stencil buffer */ -function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); -} +Framebuffer.prototype.enableStencil = function() +{ + if(this.stencil)return; -module.exports = shuffle; + var gl = this.gl; + + this.stencil = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil); -/***/ }), -/* 491 */ -/***/ (function(module, exports, __webpack_require__) { + // TODO.. this is depth AND stencil? + gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencil); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, this.width , this.height ); -var baseKeys = __webpack_require__(155), - getTag = __webpack_require__(73), - isArrayLike = __webpack_require__(16), - isString = __webpack_require__(211), - stringSize = __webpack_require__(391); -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - setTag = '[object Set]'; +}; /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable string keyed properties for objects. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 + * Erases the drawing area and fills it with a colour + * @param r {Number} the red value of the clearing colour + * @param g {Number} the green value of the clearing colour + * @param b {Number} the blue value of the clearing colour + * @param a {Number} the alpha value of the clearing colour */ -function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; -} +Framebuffer.prototype.clear = function( r, g, b, a ) +{ + this.bind(); -module.exports = size; + var gl = this.gl; + gl.clearColor(r, g, b, a); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); +}; -/***/ }), -/* 492 */ -/***/ (function(module, exports, __webpack_require__) { +/** + * Binds the frame buffer to the WebGL context + */ +Framebuffer.prototype.bind = function() +{ + var gl = this.gl; + gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer ); +}; -var arraySome = __webpack_require__(94), - baseIteratee = __webpack_require__(3), - baseSome = __webpack_require__(322), - isArray = __webpack_require__(1), - isIterateeCall = __webpack_require__(34); +/** + * Unbinds the frame buffer to the WebGL context + */ +Framebuffer.prototype.unbind = function() +{ + var gl = this.gl; + gl.bindFramebuffer(gl.FRAMEBUFFER, null ); +}; +/** + * Resizes the drawing area of the buffer to the given width and height + * @param width {Number} the new width + * @param height {Number} the new height + */ +Framebuffer.prototype.resize = function(width, height) +{ + var gl = this.gl; + + this.width = width; + this.height = height; + + if ( this.texture ) + { + this.texture.uploadData(null, width, height); + } + + if ( this.stencil ) + { + // update the stencil buffer width and height + gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil); + gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); + } +}; /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true + * Destroys this buffer */ -function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, baseIteratee(predicate, 3)); -} +Framebuffer.prototype.destroy = function() +{ + var gl = this.gl; -module.exports = some; + //TODO + if(this.texture) + { + this.texture.destroy(); + } + gl.deleteFramebuffer(this.framebuffer); -/***/ }), -/* 493 */ -/***/ (function(module, exports, __webpack_require__) { + this.gl = null; -var baseFlatten = __webpack_require__(40), - baseOrderBy = __webpack_require__(159), - baseRest = __webpack_require__(4), - isIterateeCall = __webpack_require__(34); + this.stencil = null; + this.texture = null; +}; /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection thru each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * + * Creates a frame buffer with a texture containing the given data * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[])} [iteratees=[_.identity]] - * The iteratees to sort by. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, [function(o) { return o.user; }]); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * @param gl {WebGLRenderingContext} The current WebGL rendering context + * @param width {Number} the width of the drawing area of the frame buffer + * @param height {Number} the height of the drawing area of the frame buffer + * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data */ -var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); -}); - -module.exports = sortBy; - +Framebuffer.createRGBA = function(gl, width, height, data) +{ + var texture = Texture.fromData(gl, null, width, height); + texture.enableNearestScaling(); + texture.enableWrapClamp(); -/***/ }), -/* 494 */ -/***/ (function(module, exports, __webpack_require__) { + //now create the framebuffer object and attach the texture to it. + var fbo = new Framebuffer(gl, width, height); + fbo.enableTexture(texture); -var apply = __webpack_require__(11), - arrayPush = __webpack_require__(47), - baseRest = __webpack_require__(4), - castSlice = __webpack_require__(328), - toInteger = __webpack_require__(14); + //fbo.enableStencil(); // get this back on soon! -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; + fbo.unbind(); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; + return fbo; +}; /** - * Creates a function that invokes `func` with the `this` binding of the - * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). - * - * **Note:** This method is based on the - * [spread operator](https://mdn.io/spread_operator). - * + * Creates a frame buffer with a texture containing the given data * @static - * @memberOf _ - * @since 3.2.0 - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 + * @param gl {WebGLRenderingContext} The current WebGL rendering context + * @param width {Number} the width of the drawing area of the frame buffer + * @param height {Number} the height of the drawing area of the frame buffer + * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data */ -function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); +Framebuffer.createFloat32 = function(gl, width, height, data) +{ + // create a new texture.. + var texture = new Texture.fromData(gl, data, width, height); + texture.enableNearestScaling(); + texture.enableWrapClamp(); + + //now create the framebuffer object and attach the texture to it. + var fbo = new Framebuffer(gl, width, height); + fbo.enableTexture(texture); + + fbo.unbind(); - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); -} + return fbo; +}; -module.exports = spread; +module.exports = Framebuffer; /***/ }), -/* 495 */ -/***/ (function(module, exports) { +/* 514 */ +/***/ (function(module, exports, __webpack_require__) { + + +var compileProgram = __webpack_require__(227), + extractAttributes = __webpack_require__(229), + extractUniforms = __webpack_require__(230), + setPrecision = __webpack_require__(233), + generateUniformAccessObject = __webpack_require__(231); /** - * This method returns a new empty object. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Object} Returns the new empty object. - * @example - * - * var objects = _.times(2, _.stubObject); - * - * console.log(objects); - * // => [{}, {}] + * Helper class to create a webGL Shader * - * console.log(objects[0] === objects[1]); - * // => false + * @class + * @memberof PIXI.glCore + * @param gl {WebGLRenderingContext} + * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. + * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. + * @param precision {precision]} The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'. + * @param attributeLocations {object} A key value pair showing which location eact attribute should sit eg {position:0, uvs:1} */ -function stubObject() { - return {}; -} - -module.exports = stubObject; +var Shader = function(gl, vertexSrc, fragmentSrc, precision, attributeLocations) +{ + /** + * The current WebGL rendering context + * + * @member {WebGLRenderingContext} + */ + this.gl = gl; + if(precision) + { + vertexSrc = setPrecision(vertexSrc, precision); + fragmentSrc = setPrecision(fragmentSrc, precision); + } -/***/ }), -/* 496 */ -/***/ (function(module, exports) { + /** + * The shader program + * + * @member {WebGLProgram} + */ + // First compile the program.. + this.program = compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations); -/** - * This method returns an empty string. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {string} Returns the empty string. - * @example - * - * _.times(2, _.stubString); - * // => ['', ''] - */ -function stubString() { - return ''; -} + /** + * The attributes of the shader as an object containing the following properties + * { + * type, + * size, + * location, + * pointer + * } + * @member {Object} + */ + // next extract the attributes + this.attributes = extractAttributes(gl, this.program); -module.exports = stubString; + this.uniformData = extractUniforms(gl, this.program); + /** + * The uniforms of the shader as an object containing the following properties + * { + * gl, + * data + * } + * @member {Object} + */ + this.uniforms = generateUniformAccessObject( gl, this.uniformData ); -/***/ }), -/* 497 */ -/***/ (function(module, exports) { +}; +/** + * Uses this shader + */ +Shader.prototype.bind = function() +{ + this.gl.useProgram(this.program); +}; /** - * This method returns `true`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `true`. - * @example - * - * _.times(2, _.stubTrue); - * // => [true, true] + * Destroys this shader + * TODO */ -function stubTrue() { - return true; -} +Shader.prototype.destroy = function() +{ + this.attributes = null; + this.uniformData = null; + this.uniforms = null; + + var gl = this.gl; + gl.deleteProgram(this.program); +}; -module.exports = stubTrue; + +module.exports = Shader; /***/ }), -/* 498 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { -var debounce = __webpack_require__(208), - isObject = __webpack_require__(6); -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +// state object// +var setVertexAttribArrays = __webpack_require__( 226 ); /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); + * Helper class to work with WebGL VertexArrayObjects (vaos) + * Only works if WebGL extensions are enabled (they usually are) * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); + * @class + * @memberof PIXI.glCore + * @param gl {WebGLRenderingContext} The current WebGL rendering context */ -function throttle(func, wait, options) { - var leading = true, - trailing = true; +function VertexArrayObject(gl, state) +{ + this.nativeVaoExtension = null; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); -} + if(!VertexArrayObject.FORCE_NATIVE) + { + this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || + gl.getExtension('MOZ_OES_vertex_array_object') || + gl.getExtension('WEBKIT_OES_vertex_array_object'); + } -module.exports = throttle; + this.nativeState = state; + if(this.nativeVaoExtension) + { + this.nativeVao = this.nativeVaoExtension.createVertexArrayOES(); -/***/ }), -/* 499 */ -/***/ (function(module, exports, __webpack_require__) { + var maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); -var baseTimes = __webpack_require__(165), - castFunction = __webpack_require__(18), - toInteger = __webpack_require__(14); + // VAO - overwrite the state.. + this.nativeState = { + tempAttribState: new Array(maxAttribs), + attribState: new Array(maxAttribs) + }; + } -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; + /** + * The current WebGL rendering context + * + * @member {WebGLRenderingContext} + */ + this.gl = gl; -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295; + /** + * An array of attributes + * + * @member {Array} + */ + this.attributes = []; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; + /** + * @member {PIXI.glCore.GLBuffer} + */ + this.indexBuffer = null; + + /** + * A boolean flag + * + * @member {Boolean} + */ + this.dirty = false; +} + +VertexArrayObject.prototype.constructor = VertexArrayObject; +module.exports = VertexArrayObject; /** - * Invokes the iteratee `n` times, returning an array of the results of - * each invocation. The iteratee is invoked with one argument; (index). - * +* Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!) +* If you find on older devices that things have gone a bit weird then set this to true. +*/ +/** + * Lets the VAO know if you should use the WebGL extension or the native methods. + * Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!) + * If you find on older devices that things have gone a bit weird then set this to true. * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of results. - * @example - * - * _.times(3, String); - * // => ['0', '1', '2'] - * - * _.times(4, _.constant(0)); - * // => [0, 0, 0, 0] + * @property {Boolean} FORCE_NATIVE */ -function times(n, iteratee) { - n = toInteger(n); - if (n < 1 || n > MAX_SAFE_INTEGER) { - return []; - } - var index = MAX_ARRAY_LENGTH, - length = nativeMin(n, MAX_ARRAY_LENGTH); +VertexArrayObject.FORCE_NATIVE = false; - iteratee = castFunction(iteratee); - n -= MAX_ARRAY_LENGTH; +/** + * Binds the buffer + */ +VertexArrayObject.prototype.bind = function() +{ + if(this.nativeVao) + { + this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao); - var result = baseTimes(length, iteratee); - while (++index < n) { - iteratee(index); - } - return result; -} + if(this.dirty) + { + this.dirty = false; + this.activate(); + } + } + else + { -module.exports = times; + this.activate(); + } + return this; +}; -/***/ }), -/* 500 */ -/***/ (function(module, exports, __webpack_require__) { +/** + * Unbinds the buffer + */ +VertexArrayObject.prototype.unbind = function() +{ + if(this.nativeVao) + { + this.nativeVaoExtension.bindVertexArrayOES(null); + } -var arrayMap = __webpack_require__(12), - copyArray = __webpack_require__(28), - isArray = __webpack_require__(1), - isSymbol = __webpack_require__(46), - stringToPath = __webpack_require__(201), - toKey = __webpack_require__(20), - toString = __webpack_require__(120); + return this; +}; /** - * Converts `value` to a property path array. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Util - * @param {*} value The value to convert. - * @returns {Array} Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] + * Uses this vao */ -function toPath(value) { - if (isArray(value)) { - return arrayMap(value, toKey); - } - return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); -} +VertexArrayObject.prototype.activate = function() +{ -module.exports = toPath; + var gl = this.gl; + var lastBuffer = null; + for (var i = 0; i < this.attributes.length; i++) + { + var attrib = this.attributes[i]; -/***/ }), -/* 501 */ -/***/ (function(module, exports, __webpack_require__) { + if(lastBuffer !== attrib.buffer) + { + attrib.buffer.bind(); + lastBuffer = attrib.buffer; + } -var copyObject = __webpack_require__(19), - keysIn = __webpack_require__(13); + gl.vertexAttribPointer(attrib.attribute.location, + attrib.attribute.size, + attrib.type || gl.FLOAT, + attrib.normalized || false, + attrib.stride || 0, + attrib.start || 0); + } + + setVertexAttribArrays(gl, this.attributes, this.nativeState); + + if(this.indexBuffer) + { + this.indexBuffer.bind(); + } + + return this; +}; /** - * Converts `value` to a plain object flattening inherited enumerable string - * keyed properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } + * @param buffer {PIXI.gl.GLBuffer} + * @param attribute {*} + * @param type {String} + * @param normalized {Boolean} + * @param stride {Number} + * @param start {Number} + */ +VertexArrayObject.prototype.addAttribute = function(buffer, attribute, type, normalized, stride, start) +{ + this.attributes.push({ + buffer: buffer, + attribute: attribute, + + location: attribute.location, + type: type || this.gl.FLOAT, + normalized: normalized || false, + stride: stride || 0, + start: start || 0 + }); + + this.dirty = true; + + return this; +}; + +/** * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } + * @param buffer {PIXI.gl.GLBuffer} */ -function toPlainObject(value) { - return copyObject(value, keysIn(value)); -} +VertexArrayObject.prototype.addIndex = function(buffer/*, options*/) +{ + this.indexBuffer = buffer; -module.exports = toPlainObject; + this.dirty = true; + return this; +}; -/***/ }), -/* 502 */ -/***/ (function(module, exports, __webpack_require__) { +/** + * Unbinds this vao and disables it + */ +VertexArrayObject.prototype.clear = function() +{ + // var gl = this.gl; -var arrayEach = __webpack_require__(38), - baseCreate = __webpack_require__(39), - baseForOwn = __webpack_require__(31), - baseIteratee = __webpack_require__(3), - getPrototype = __webpack_require__(72), - isArray = __webpack_require__(1), - isBuffer = __webpack_require__(49), - isFunction = __webpack_require__(36), - isObject = __webpack_require__(6), - isTypedArray = __webpack_require__(78); + // TODO - should this function unbind after clear? + // for now, no but lets see what happens in the real world! + if(this.nativeVao) + { + this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao); + } + + this.attributes.length = 0; + this.indexBuffer = null; + + return this; +}; /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own - * enumerable string keyed properties thru `iteratee`, with each invocation - * potentially mutating the `accumulator` object. If `accumulator` is not - * provided, a new object with the same `[[Prototype]]` will be used. The - * iteratee is invoked with four arguments: (accumulator, value, key, object). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 1.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } + * @param type {Number} + * @param size {Number} + * @param start {Number} */ -function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); +VertexArrayObject.prototype.draw = function(type, size, start) +{ + var gl = this.gl; - iteratee = baseIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; + if(this.indexBuffer) + { + gl.drawElements(type, size || this.indexBuffer.data.length, gl.UNSIGNED_SHORT, (start || 0) * 2 ); } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + else + { + // TODO need a better way to calculate size.. + gl.drawArrays(type, start, size || this.getSize()); } - else { - accumulator = {}; + + return this; +}; + +/** + * Destroy this vao + */ +VertexArrayObject.prototype.destroy = function() +{ + // lose references + this.gl = null; + this.indexBuffer = null; + this.attributes = null; + this.nativeState = null; + + if(this.nativeVao) + { + this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao); } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; -} -module.exports = transform; + this.nativeVaoExtension = null; + this.nativeVao = null; +}; + +VertexArrayObject.prototype.getSize = function() +{ + var attrib = this.attributes[0]; + return attrib.buffer.data.length / (( attrib.stride/4 ) || attrib.attribute.size); +}; /***/ }), -/* 503 */ -/***/ (function(module, exports, __webpack_require__) { +/* 516 */ +/***/ (function(module, exports) { -var ary = __webpack_require__(203); /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - * @example + * Helper class to create a webGL Context * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] + * @class + * @memberof PIXI.glCore + * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from + * @param options {Object} An options object that gets passed in to the canvas element containing the context attributes, + * see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext for the options available + * @return {WebGLRenderingContext} the WebGL context */ -function unary(func) { - return ary(func, 1); -} - -module.exports = unary; - +var createContext = function(canvas, options) +{ + var gl = canvas.getContext('webgl', options) || + canvas.getContext('experimental-webgl', options); -/***/ }), -/* 504 */ -/***/ (function(module, exports, __webpack_require__) { + if (!gl) + { + // fail, not able to get a context + throw new Error('This browser does not support webGL. Try using the canvas renderer'); + } -var toString = __webpack_require__(120); + return gl; +}; -/** Used to generate unique IDs. */ -var idCounter = 0; +module.exports = createContext; -/** - * Generates a unique ID. If `prefix` is given, the ID is appended to it. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {string} [prefix=''] The value to prefix the ID with. - * @returns {string} Returns the unique ID. - * @example - * - * _.uniqueId('contact_'); - * // => 'contact_104' - * - * _.uniqueId(); - * // => '105' - */ -function uniqueId(prefix) { - var id = ++idCounter; - return toString(prefix) + id; -} -module.exports = uniqueId; +/***/ }), +/* 517 */ +/***/ (function(module, exports, __webpack_require__) { +module.exports = { + compileProgram: __webpack_require__(227), + defaultValue: __webpack_require__(228), + extractAttributes: __webpack_require__(229), + extractUniforms: __webpack_require__(230), + generateUniformAccessObject: __webpack_require__(231), + setPrecision: __webpack_require__(233), + mapSize: __webpack_require__(232), + mapType: __webpack_require__(122) +}; /***/ }), -/* 505 */ +/* 518 */ /***/ (function(module, exports, __webpack_require__) { -var baseUnset = __webpack_require__(166); +"use strict"; -/** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, ['a', '0', 'b', 'c']); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ -function unset(object, path) { - return object == null ? true : baseUnset(object, path); -} -module.exports = unset; +exports.__esModule = true; +var _core = __webpack_require__(1); -/***/ }), -/* 506 */ -/***/ (function(module, exports, __webpack_require__) { +var core = _interopRequireWildcard(_core); -var baseUpdate = __webpack_require__(167), - castFunction = __webpack_require__(18); +var _ismobilejs = __webpack_require__(88); -/** - * This method is like `_.set` except that accepts `updater` to produce the - * value to set. Use `_.updateWith` to customize `path` creation. The `updater` - * is invoked with one argument: (value). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.update(object, 'a[0].b.c', function(n) { return n * n; }); - * console.log(object.a[0].b.c); - * // => 9 - * - * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); - * console.log(object.x[0].y.z); - * // => 0 - */ -function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); -} +var _ismobilejs2 = _interopRequireDefault(_ismobilejs); -module.exports = update; +var _accessibleTarget = __webpack_require__(234); +var _accessibleTarget2 = _interopRequireDefault(_accessibleTarget); -/***/ }), -/* 507 */ -/***/ (function(module, exports, __webpack_require__) { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var baseUpdate = __webpack_require__(167), - castFunction = __webpack_require__(18); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -/** - * This method is like `_.update` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @since 4.6.0 - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * var object = {}; - * - * _.updateWith(object, '[0][1]', _.constant('a'), Object); - * // => { '0': { '1': 'a' } } - */ -function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); -} +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -module.exports = updateWith; +// add some extra variables to the container.. +core.utils.mixins.delayMixin(core.DisplayObject.prototype, _accessibleTarget2.default); +var KEY_CODE_TAB = 9; -/***/ }), -/* 508 */ -/***/ (function(module, exports, __webpack_require__) { +var DIV_TOUCH_SIZE = 100; +var DIV_TOUCH_POS_X = 0; +var DIV_TOUCH_POS_Y = 0; +var DIV_TOUCH_ZINDEX = 2; -var baseValues = __webpack_require__(168), - keysIn = __webpack_require__(13); +var DIV_HOOK_SIZE = 1; +var DIV_HOOK_POS_X = -1000; +var DIV_HOOK_POS_Y = -1000; +var DIV_HOOK_ZINDEX = 2; /** - * Creates an array of the own and inherited enumerable string keyed property - * values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example + * The Accessibility manager recreates the ability to tab and have content read by screen + * readers. This is very important as it can possibly help people with disabilities access pixi + * content. * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } + * Much like interaction any DisplayObject can be made accessible. This manager will map the + * events as if the mouse was being used, minimizing the effort required to implement. * - * Foo.prototype.c = 3; + * An instance of this class is automatically created by default, and can be found at renderer.plugins.accessibility * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) + * @class + * @memberof PIXI.accessibility */ -function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); -} -module.exports = valuesIn; +var AccessibilityManager = function () { + /** + * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer + */ + function AccessibilityManager(renderer) { + _classCallCheck(this, AccessibilityManager); + if ((_ismobilejs2.default.tablet || _ismobilejs2.default.phone) && !navigator.isCocoonJS) { + this.createTouchHook(); + } -/***/ }), -/* 509 */ -/***/ (function(module, exports, __webpack_require__) { + // first we create a div that will sit over the PixiJS element. This is where the div overlays will go. + var div = document.createElement('div'); -var castFunction = __webpack_require__(18), - partial = __webpack_require__(216); + div.style.width = DIV_TOUCH_SIZE + 'px'; + div.style.height = DIV_TOUCH_SIZE + 'px'; + div.style.position = 'absolute'; + div.style.top = DIV_TOUCH_POS_X + 'px'; + div.style.left = DIV_TOUCH_POS_Y + 'px'; + div.style.zIndex = DIV_TOUCH_ZINDEX; -/** - * Creates a function that provides `value` to `wrapper` as its first - * argument. Any additional arguments provided to the function are appended - * to those provided to the `wrapper`. The wrapper is invoked with the `this` - * binding of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {*} value The value to wrap. - * @param {Function} [wrapper=identity] The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ -function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); -} + /** + * This is the dom element that will sit over the PixiJS element. This is where the div overlays will go. + * + * @type {HTMLElement} + * @private + */ + this.div = div; -module.exports = wrap; + /** + * A simple pool for storing divs. + * + * @type {*} + * @private + */ + this.pool = []; + /** + * This is a tick used to check if an object is no longer being rendered. + * + * @type {Number} + * @private + */ + this.renderId = 0; -/***/ }), -/* 510 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Setting this to true will visually show the divs. + * + * @type {boolean} + */ + this.debug = false; -var LazyWrapper = __webpack_require__(89), - LodashWrapper = __webpack_require__(90), - baseLodash = __webpack_require__(100), - isArray = __webpack_require__(1), - isObjectLike = __webpack_require__(21), - wrapperClone = __webpack_require__(394); + /** + * The renderer this accessibility manager works for. + * + * @member {PIXI.SystemRenderer} + */ + this.renderer = renderer; -/** Used for built-in method references. */ -var objectProto = Object.prototype; + /** + * The array of currently active accessible items. + * + * @member {Array<*>} + * @private + */ + this.children = []; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + /** + * pre-bind the functions + * + * @private + */ + this._onKeyDown = this._onKeyDown.bind(this); + this._onMouseMove = this._onMouseMove.bind(this); -/** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ -function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); + /** + * stores the state of the manager. If there are no accessible objects or the mouse is moving, this will be false. + * + * @member {Array<*>} + * @private + */ + this.isActive = false; + this.isMobileAccessabillity = false; + + // let listen for tab.. once pressed we can fire up and show the accessibility layer + window.addEventListener('keydown', this._onKeyDown, false); } - } - return new LodashWrapper(value); -} -// Ensure wrappers are instances of `baseLodash`. -lodash.prototype = baseLodash.prototype; -lodash.prototype.constructor = lodash; + /** + * Creates the touch hooks. + * + */ -module.exports = lodash; + AccessibilityManager.prototype.createTouchHook = function createTouchHook() { + var _this = this; -/***/ }), -/* 511 */ -/***/ (function(module, exports, __webpack_require__) { + var hookDiv = document.createElement('button'); -var apply = Function.prototype.apply; + hookDiv.style.width = DIV_HOOK_SIZE + 'px'; + hookDiv.style.height = DIV_HOOK_SIZE + 'px'; + hookDiv.style.position = 'absolute'; + hookDiv.style.top = DIV_HOOK_POS_X + 'px'; + hookDiv.style.left = DIV_HOOK_POS_Y + 'px'; + hookDiv.style.zIndex = DIV_HOOK_ZINDEX; + hookDiv.style.backgroundColor = '#FF0000'; + hookDiv.title = 'HOOK DIV'; -// DOM APIs, for completeness + hookDiv.addEventListener('focus', function () { + _this.isMobileAccessabillity = true; + _this.activate(); + document.body.removeChild(hookDiv); + }); -exports.setTimeout = function() { - return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); -}; -exports.setInterval = function() { - return new Timeout(apply.call(setInterval, window, arguments), clearInterval); -}; -exports.clearTimeout = -exports.clearInterval = function(timeout) { - if (timeout) { - timeout.close(); - } -}; + document.body.appendChild(hookDiv); + }; -function Timeout(id, clearFn) { - this._id = id; - this._clearFn = clearFn; -} -Timeout.prototype.unref = Timeout.prototype.ref = function() {}; -Timeout.prototype.close = function() { - this._clearFn.call(window, this._id); -}; + /** + * Activating will cause the Accessibility layer to be shown. This is called when a user + * preses the tab key. + * + * @private + */ -// Does not start the time, just sets up the members needed. -exports.enroll = function(item, msecs) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = msecs; -}; -exports.unenroll = function(item) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = -1; -}; + AccessibilityManager.prototype.activate = function activate() { + if (this.isActive) { + return; + } -exports._unrefActive = exports.active = function(item) { - clearTimeout(item._idleTimeoutId); + this.isActive = true; - var msecs = item._idleTimeout; - if (msecs >= 0) { - item._idleTimeoutId = setTimeout(function onTimeout() { - if (item._onTimeout) - item._onTimeout(); - }, msecs); - } -}; + window.document.addEventListener('mousemove', this._onMouseMove, true); + window.removeEventListener('keydown', this._onKeyDown, false); -// setimmediate attaches itself to the global object -__webpack_require__(601); -exports.setImmediate = setImmediate; -exports.clearImmediate = clearImmediate; + this.renderer.on('postrender', this.update, this); + if (this.renderer.view.parentNode) { + this.renderer.view.parentNode.appendChild(this.div); + } + }; -/***/ }), -/* 512 */ -/***/ (function(module, exports, __webpack_require__) { + /** + * Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves + * the mouse. + * + * @private + */ -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ + AccessibilityManager.prototype.deactivate = function deactivate() { + if (!this.isActive || this.isMobileAccessabillity) { + return; + } -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; + this.isActive = false; -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } + window.document.removeEventListener('mousemove', this._onMouseMove); + window.addEventListener('keydown', this._onKeyDown, false); - return Object(val); -} + this.renderer.off('postrender', this.update); -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } + if (this.div.parentNode) { + this.div.parentNode.removeChild(this.div); + } + }; - // Detect buggy property enumeration order in older V8 versions. + /** + * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer. + * + * @private + * @param {PIXI.Container} displayObject - The DisplayObject to check. + */ - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } + AccessibilityManager.prototype.updateAccessibleObjects = function updateAccessibleObjects(displayObject) { + if (!displayObject.visible) { + return; + } - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } + if (displayObject.accessible && displayObject.interactive) { + if (!displayObject._accessibleActive) { + this.addChild(displayObject); + } - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} + displayObject.renderId = this.renderId; + } -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; + var children = displayObject.children; - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); + for (var i = children.length - 1; i >= 0; i--) { + this.updateAccessibleObjects(children[i]); + } + }; - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } + /** + * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects. + * + * @private + */ - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - return to; -}; + AccessibilityManager.prototype.update = function update() { + if (!this.renderer.renderingToScreen) { + return; + } + // update children... + this.updateAccessibleObjects(this.renderer._lastObjectRendered); -/***/ }), -/* 513 */ -/***/ (function(module, exports) { + var rect = this.renderer.view.getBoundingClientRect(); + var sx = rect.width / this.renderer.width; + var sy = rect.height / this.renderer.height; -var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0); + var div = this.div; -/** - * Helper class to create a webGL buffer - * - * @class - * @memberof PIXI.glCore - * @param gl {WebGLRenderingContext} The current WebGL rendering context - * @param type {gl.ARRAY_BUFFER | gl.ELEMENT_ARRAY_BUFFER} @mat - * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data - * @param drawType {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW} - */ -var Buffer = function(gl, type, data, drawType) -{ + div.style.left = rect.left + 'px'; + div.style.top = rect.top + 'px'; + div.style.width = this.renderer.width + 'px'; + div.style.height = this.renderer.height + 'px'; - /** - * The current WebGL rendering context - * - * @member {WebGLRenderingContext} - */ - this.gl = gl; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; - /** - * The WebGL buffer, created upon instantiation - * - * @member {WebGLBuffer} - */ - this.buffer = gl.createBuffer(); + if (child.renderId !== this.renderId) { + child._accessibleActive = false; - /** - * The type of the buffer - * - * @member {gl.ARRAY_BUFFER|gl.ELEMENT_ARRAY_BUFFER} - */ - this.type = type || gl.ARRAY_BUFFER; + core.utils.removeItems(this.children, i, 1); + this.div.removeChild(child._accessibleDiv); + this.pool.push(child._accessibleDiv); + child._accessibleDiv = null; - /** - * The draw type of the buffer - * - * @member {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW} - */ - this.drawType = drawType || gl.STATIC_DRAW; + i--; - /** - * The data in the buffer, as a typed array + if (this.children.length === 0) { + this.deactivate(); + } + } else { + // map div to display.. + div = child._accessibleDiv; + var hitArea = child.hitArea; + var wt = child.worldTransform; + + if (child.hitArea) { + div.style.left = (wt.tx + hitArea.x * wt.a) * sx + 'px'; + div.style.top = (wt.ty + hitArea.y * wt.d) * sy + 'px'; + + div.style.width = hitArea.width * wt.a * sx + 'px'; + div.style.height = hitArea.height * wt.d * sy + 'px'; + } else { + hitArea = child.getBounds(); + + this.capHitArea(hitArea); + + div.style.left = hitArea.x * sx + 'px'; + div.style.top = hitArea.y * sy + 'px'; + + div.style.width = hitArea.width * sx + 'px'; + div.style.height = hitArea.height * sy + 'px'; + } + } + } + + // increment the render id.. + this.renderId++; + }; + + /** + * TODO: docs. * - * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} + * @param {Rectangle} hitArea - TODO docs */ - this.data = EMPTY_ARRAY_BUFFER; - if(data) - { - this.upload(data); - } - this._updateID = 0; -}; + AccessibilityManager.prototype.capHitArea = function capHitArea(hitArea) { + if (hitArea.x < 0) { + hitArea.width += hitArea.x; + hitArea.x = 0; + } -/** - * Uploads the buffer to the GPU - * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data to upload - * @param offset {Number} if only a subset of the data should be uploaded, this is the amount of data to subtract - * @param dontBind {Boolean} whether to bind the buffer before uploading it - */ -Buffer.prototype.upload = function(data, offset, dontBind) -{ - // todo - needed? - if(!dontBind) this.bind(); + if (hitArea.y < 0) { + hitArea.height += hitArea.y; + hitArea.y = 0; + } - var gl = this.gl; + if (hitArea.x + hitArea.width > this.renderer.width) { + hitArea.width = this.renderer.width - hitArea.x; + } - data = data || this.data; - offset = offset || 0; + if (hitArea.y + hitArea.height > this.renderer.height) { + hitArea.height = this.renderer.height - hitArea.y; + } + }; - if(this.data.byteLength >= data.byteLength) - { - gl.bufferSubData(this.type, offset, data); - } - else - { - gl.bufferData(this.type, data, this.drawType); - } + /** + * Adds a DisplayObject to the accessibility manager + * + * @private + * @param {DisplayObject} displayObject - The child to make accessible. + */ - this.data = data; -}; -/** - * Binds the buffer - * - */ -Buffer.prototype.bind = function() -{ - var gl = this.gl; - gl.bindBuffer(this.type, this.buffer); -}; -Buffer.createVertexBuffer = function(gl, data, drawType) -{ - return new Buffer(gl, gl.ARRAY_BUFFER, data, drawType); -}; + AccessibilityManager.prototype.addChild = function addChild(displayObject) { + // this.activate(); -Buffer.createIndexBuffer = function(gl, data, drawType) -{ - return new Buffer(gl, gl.ELEMENT_ARRAY_BUFFER, data, drawType); -}; + var div = this.pool.pop(); -Buffer.create = function(gl, type, data, drawType) -{ - return new Buffer(gl, type, data, drawType); -}; + if (!div) { + div = document.createElement('button'); -/** - * Destroys the buffer - * - */ -Buffer.prototype.destroy = function(){ - this.gl.deleteBuffer(this.buffer); -}; + div.style.width = DIV_TOUCH_SIZE + 'px'; + div.style.height = DIV_TOUCH_SIZE + 'px'; + div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent'; + div.style.position = 'absolute'; + div.style.zIndex = DIV_TOUCH_ZINDEX; + div.style.borderStyle = 'none'; -module.exports = Buffer; + div.addEventListener('click', this._onClick.bind(this)); + div.addEventListener('focus', this._onFocus.bind(this)); + div.addEventListener('focusout', this._onFocusOut.bind(this)); + } + if (displayObject.accessibleTitle) { + div.title = displayObject.accessibleTitle; + } else if (!displayObject.accessibleTitle && !displayObject.accessibleHint) { + div.title = 'displayObject ' + this.tabIndex; + } -/***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { + if (displayObject.accessibleHint) { + div.setAttribute('aria-label', displayObject.accessibleHint); + } + // -var Texture = __webpack_require__(224); + displayObject._accessibleActive = true; + displayObject._accessibleDiv = div; + div.displayObject = displayObject; + + this.children.push(displayObject); + this.div.appendChild(displayObject._accessibleDiv); + displayObject._accessibleDiv.tabIndex = displayObject.tabIndex; + }; -/** - * Helper class to create a webGL Framebuffer - * - * @class - * @memberof PIXI.glCore - * @param gl {WebGLRenderingContext} The current WebGL rendering context - * @param width {Number} the width of the drawing area of the frame buffer - * @param height {Number} the height of the drawing area of the frame buffer - */ -var Framebuffer = function(gl, width, height) -{ /** - * The current WebGL rendering context + * Maps the div button press to pixi's InteractionManager (click) * - * @member {WebGLRenderingContext} + * @private + * @param {MouseEvent} e - The click event. */ - this.gl = gl; + + + AccessibilityManager.prototype._onClick = function _onClick(e) { + var interactionManager = this.renderer.plugins.interaction; + + interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData); + }; /** - * The frame buffer + * Maps the div focus events to pixi's InteractionManager (mouseover) * - * @member {WebGLFramebuffer} + * @private + * @param {FocusEvent} e - The focus event. */ - this.framebuffer = gl.createFramebuffer(); + + + AccessibilityManager.prototype._onFocus = function _onFocus(e) { + var interactionManager = this.renderer.plugins.interaction; + + interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData); + }; /** - * The stencil buffer + * Maps the div focus events to pixi's InteractionManager (mouseout) * - * @member {WebGLRenderbuffer} + * @private + * @param {FocusEvent} e - The focusout event. */ - this.stencil = null; + + + AccessibilityManager.prototype._onFocusOut = function _onFocusOut(e) { + var interactionManager = this.renderer.plugins.interaction; + + interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData); + }; /** - * The stencil buffer + * Is called when a key is pressed * - * @member {PIXI.glCore.GLTexture} + * @private + * @param {KeyboardEvent} e - The keydown event. */ - this.texture = null; + + + AccessibilityManager.prototype._onKeyDown = function _onKeyDown(e) { + if (e.keyCode !== KEY_CODE_TAB) { + return; + } + + this.activate(); + }; /** - * The width of the drawing area of the buffer + * Is called when the mouse moves across the renderer element * - * @member {Number} + * @private */ - this.width = width || 100; + + + AccessibilityManager.prototype._onMouseMove = function _onMouseMove() { + this.deactivate(); + }; + /** - * The height of the drawing area of the buffer + * Destroys the accessibility manager * - * @member {Number} */ - this.height = height || 100; -}; - -/** - * Adds a texture to the frame buffer - * @param texture {PIXI.glCore.GLTexture} - */ -Framebuffer.prototype.enableTexture = function(texture) -{ - var gl = this.gl; - this.texture = texture || new Texture(gl); - this.texture.bind(); + AccessibilityManager.prototype.destroy = function destroy() { + this.div = null; - //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + for (var i = 0; i < this.children.length; i++) { + this.children[i].div = null; + } - this.bind(); + window.document.removeEventListener('mousemove', this._onMouseMove); + window.removeEventListener('keydown', this._onKeyDown); - gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0); -}; + this.pool = null; + this.children = null; + this.renderer = null; + }; -/** - * Initialises the stencil buffer - */ -Framebuffer.prototype.enableStencil = function() -{ - if(this.stencil)return; + return AccessibilityManager; +}(); - var gl = this.gl; +exports.default = AccessibilityManager; - this.stencil = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil); +core.WebGLRenderer.registerPlugin('accessibility', AccessibilityManager); +core.CanvasRenderer.registerPlugin('accessibility', AccessibilityManager); +//# sourceMappingURL=AccessibilityManager.js.map - // TODO.. this is depth AND stencil? - gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencil); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, this.width , this.height ); +/***/ }), +/* 519 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -}; -/** - * Erases the drawing area and fills it with a colour - * @param r {Number} the red value of the clearing colour - * @param g {Number} the green value of the clearing colour - * @param b {Number} the blue value of the clearing colour - * @param a {Number} the alpha value of the clearing colour - */ -Framebuffer.prototype.clear = function( r, g, b, a ) -{ - this.bind(); +exports.__esModule = true; - var gl = this.gl; +var _accessibleTarget = __webpack_require__(234); - gl.clearColor(r, g, b, a); - gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); -}; +Object.defineProperty(exports, 'accessibleTarget', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_accessibleTarget).default; + } +}); -/** - * Binds the frame buffer to the WebGL context - */ -Framebuffer.prototype.bind = function() -{ - var gl = this.gl; - gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer ); -}; +var _AccessibilityManager = __webpack_require__(518); -/** - * Unbinds the frame buffer to the WebGL context - */ -Framebuffer.prototype.unbind = function() -{ - var gl = this.gl; - gl.bindFramebuffer(gl.FRAMEBUFFER, null ); -}; -/** - * Resizes the drawing area of the buffer to the given width and height - * @param width {Number} the new width - * @param height {Number} the new height - */ -Framebuffer.prototype.resize = function(width, height) -{ - var gl = this.gl; +Object.defineProperty(exports, 'AccessibilityManager', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_AccessibilityManager).default; + } +}); - this.width = width; - this.height = height; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map - if ( this.texture ) - { - this.texture.uploadData(null, width, height); - } +/***/ }), +/* 520 */ +/***/ (function(module, exports, __webpack_require__) { - if ( this.stencil ) - { - // update the stencil buffer width and height - gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil); - gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); - } -}; +"use strict"; -/** - * Destroys this buffer - */ -Framebuffer.prototype.destroy = function() -{ - var gl = this.gl; - //TODO - if(this.texture) - { - this.texture.destroy(); - } +exports.__esModule = true; - gl.deleteFramebuffer(this.framebuffer); +var _Container2 = __webpack_require__(55); - this.gl = null; +var _Container3 = _interopRequireDefault(_Container2); - this.stencil = null; - this.texture = null; -}; +var _RenderTexture = __webpack_require__(130); -/** - * Creates a frame buffer with a texture containing the given data - * @static - * @param gl {WebGLRenderingContext} The current WebGL rendering context - * @param width {Number} the width of the drawing area of the frame buffer - * @param height {Number} the height of the drawing area of the frame buffer - * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data - */ -Framebuffer.createRGBA = function(gl, width, height, data) -{ - var texture = Texture.fromData(gl, null, width, height); - texture.enableNearestScaling(); - texture.enableWrapClamp(); +var _RenderTexture2 = _interopRequireDefault(_RenderTexture); - //now create the framebuffer object and attach the texture to it. - var fbo = new Framebuffer(gl, width, height); - fbo.enableTexture(texture); +var _Texture = __webpack_require__(37); - //fbo.enableStencil(); // get this back on soon! +var _Texture2 = _interopRequireDefault(_Texture); - fbo.unbind(); +var _GraphicsData = __webpack_require__(240); - return fbo; -}; +var _GraphicsData2 = _interopRequireDefault(_GraphicsData); -/** - * Creates a frame buffer with a texture containing the given data - * @static - * @param gl {WebGLRenderingContext} The current WebGL rendering context - * @param width {Number} the width of the drawing area of the frame buffer - * @param height {Number} the height of the drawing area of the frame buffer - * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data - */ -Framebuffer.createFloat32 = function(gl, width, height, data) -{ - // create a new texture.. - var texture = new Texture.fromData(gl, data, width, height); - texture.enableNearestScaling(); - texture.enableWrapClamp(); +var _Sprite = __webpack_require__(128); - //now create the framebuffer object and attach the texture to it. - var fbo = new Framebuffer(gl, width, height); - fbo.enableTexture(texture); +var _Sprite2 = _interopRequireDefault(_Sprite); - fbo.unbind(); +var _math = __webpack_require__(8); - return fbo; -}; +var _utils = __webpack_require__(3); -module.exports = Framebuffer; +var _const = __webpack_require__(0); +var _Bounds = __webpack_require__(123); -/***/ }), -/* 515 */ -/***/ (function(module, exports, __webpack_require__) { +var _Bounds2 = _interopRequireDefault(_Bounds); +var _bezierCurveTo2 = __webpack_require__(522); -var compileProgram = __webpack_require__(226), - extractAttributes = __webpack_require__(228), - extractUniforms = __webpack_require__(229), - setPrecision = __webpack_require__(232), - generateUniformAccessObject = __webpack_require__(230); +var _bezierCurveTo3 = _interopRequireDefault(_bezierCurveTo2); -/** - * Helper class to create a webGL Shader - * - * @class - * @memberof PIXI.glCore - * @param gl {WebGLRenderingContext} - * @param vertexSrc {string|string[]} The vertex shader source as an array of strings. - * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings. - * @param precision {precision]} The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'. - * @param attributeLocations {object} A key value pair showing which location eact attribute should sit eg {position:0, uvs:1} - */ -var Shader = function(gl, vertexSrc, fragmentSrc, precision, attributeLocations) -{ - /** - * The current WebGL rendering context - * - * @member {WebGLRenderingContext} - */ - this.gl = gl; +var _CanvasRenderer = __webpack_require__(56); - if(precision) - { - vertexSrc = setPrecision(vertexSrc, precision); - fragmentSrc = setPrecision(fragmentSrc, precision); - } +var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); - /** - * The shader program - * - * @member {WebGLProgram} - */ - // First compile the program.. - this.program = compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * The attributes of the shader as an object containing the following properties - * { - * type, - * size, - * location, - * pointer - * } - * @member {Object} - */ - // next extract the attributes - this.attributes = extractAttributes(gl, this.program); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - this.uniformData = extractUniforms(gl, this.program); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - /** - * The uniforms of the shader as an object containing the following properties - * { - * gl, - * data - * } - * @member {Object} - */ - this.uniforms = generateUniformAccessObject( gl, this.uniformData ); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -}; -/** - * Uses this shader - */ -Shader.prototype.bind = function() -{ - this.gl.useProgram(this.program); -}; +var canvasRenderer = void 0; +var tempMatrix = new _math.Matrix(); +var tempPoint = new _math.Point(); +var tempColor1 = new Float32Array(4); +var tempColor2 = new Float32Array(4); /** - * Destroys this shader - * TODO + * The Graphics class contains methods used to draw primitive shapes such as lines, circles and + * rectangles to the display, and to color and fill them. + * + * @class + * @extends PIXI.Container + * @memberof PIXI */ -Shader.prototype.destroy = function() -{ - this.attributes = null; - this.uniformData = null; - this.uniforms = null; - - var gl = this.gl; - gl.deleteProgram(this.program); -}; - -module.exports = Shader; +var Graphics = function (_Container) { + _inherits(Graphics, _Container); + /** + * + * @param {boolean} [nativeLines=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP + */ + function Graphics() { + var nativeLines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; -/***/ }), -/* 516 */ -/***/ (function(module, exports, __webpack_require__) { + _classCallCheck(this, Graphics); + /** + * The alpha value used when filling the Graphics object. + * + * @member {number} + * @default 1 + */ + var _this = _possibleConstructorReturn(this, _Container.call(this)); -// state object// -var setVertexAttribArrays = __webpack_require__( 225 ); + _this.fillAlpha = 1; -/** - * Helper class to work with WebGL VertexArrayObjects (vaos) - * Only works if WebGL extensions are enabled (they usually are) - * - * @class - * @memberof PIXI.glCore - * @param gl {WebGLRenderingContext} The current WebGL rendering context - */ -function VertexArrayObject(gl, state) -{ - this.nativeVaoExtension = null; + /** + * The width (thickness) of any lines drawn. + * + * @member {number} + * @default 0 + */ + _this.lineWidth = 0; - if(!VertexArrayObject.FORCE_NATIVE) - { - this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || - gl.getExtension('MOZ_OES_vertex_array_object') || - gl.getExtension('WEBKIT_OES_vertex_array_object'); - } + /** + * If true the lines will be draw using LINES instead of TRIANGLE_STRIP + * + * @member {boolean} + */ + _this.nativeLines = nativeLines; - this.nativeState = state; + /** + * The color of any lines drawn. + * + * @member {string} + * @default 0 + */ + _this.lineColor = 0; - if(this.nativeVaoExtension) - { - this.nativeVao = this.nativeVaoExtension.createVertexArrayOES(); + /** + * Graphics data + * + * @member {PIXI.GraphicsData[]} + * @private + */ + _this.graphicsData = []; - var maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); + /** + * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to + * reset the tint. + * + * @member {number} + * @default 0xFFFFFF + */ + _this.tint = 0xFFFFFF; - // VAO - overwrite the state.. - this.nativeState = { - tempAttribState: new Array(maxAttribs), - attribState: new Array(maxAttribs) - }; - } + /** + * The previous tint applied to the graphic shape. Used to compare to the current tint and + * check if theres change. + * + * @member {number} + * @private + * @default 0xFFFFFF + */ + _this._prevTint = 0xFFFFFF; - /** - * The current WebGL rendering context - * - * @member {WebGLRenderingContext} - */ - this.gl = gl; + /** + * The blend mode to be applied to the graphic shape. Apply a value of + * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL; + * @see PIXI.BLEND_MODES + */ + _this.blendMode = _const.BLEND_MODES.NORMAL; - /** - * An array of attributes - * - * @member {Array} - */ - this.attributes = []; + /** + * Current path + * + * @member {PIXI.GraphicsData} + * @private + */ + _this.currentPath = null; - /** - * @member {PIXI.glCore.GLBuffer} - */ - this.indexBuffer = null; + /** + * Array containing some WebGL-related properties used by the WebGL renderer. + * + * @member {object} + * @private + */ + // TODO - _webgl should use a prototype object, not a random undocumented object... + _this._webGL = {}; - /** - * A boolean flag - * - * @member {Boolean} - */ - this.dirty = false; -} + /** + * Whether this shape is being used as a mask. + * + * @member {boolean} + */ + _this.isMask = false; -VertexArrayObject.prototype.constructor = VertexArrayObject; -module.exports = VertexArrayObject; + /** + * The bounds' padding used for bounds calculation. + * + * @member {number} + */ + _this.boundsPadding = 0; -/** -* Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!) -* If you find on older devices that things have gone a bit weird then set this to true. -*/ -/** - * Lets the VAO know if you should use the WebGL extension or the native methods. - * Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!) - * If you find on older devices that things have gone a bit weird then set this to true. - * @static - * @property {Boolean} FORCE_NATIVE - */ -VertexArrayObject.FORCE_NATIVE = false; + /** + * A cache of the local bounds to prevent recalculation. + * + * @member {PIXI.Rectangle} + * @private + */ + _this._localBounds = new _Bounds2.default(); -/** - * Binds the buffer - */ -VertexArrayObject.prototype.bind = function() -{ - if(this.nativeVao) - { - this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao); + /** + * Used to detect if the graphics object has changed. If this is set to true then the graphics + * object will be recalculated. + * + * @member {boolean} + * @private + */ + _this.dirty = 0; - if(this.dirty) - { - this.dirty = false; - this.activate(); - } - } - else - { + /** + * Used to detect if we need to do a fast rect check using the id compare method + * @type {Number} + */ + _this.fastRectDirty = -1; - this.activate(); - } + /** + * Used to detect if we clear the graphics webGL data + * @type {Number} + */ + _this.clearDirty = 0; - return this; -}; + /** + * Used to detect if we we need to recalculate local bounds + * @type {Number} + */ + _this.boundsDirty = -1; -/** - * Unbinds the buffer - */ -VertexArrayObject.prototype.unbind = function() -{ - if(this.nativeVao) - { - this.nativeVaoExtension.bindVertexArrayOES(null); - } + /** + * Used to detect if the cached sprite object needs to be updated. + * + * @member {boolean} + * @private + */ + _this.cachedSpriteDirty = false; - return this; -}; + _this._spriteRect = null; + _this._fastRect = false; -/** - * Uses this vao - */ -VertexArrayObject.prototype.activate = function() -{ + /** + * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. + * This is useful if your graphics element does not change often, as it will speed up the rendering + * of the object in exchange for taking up texture memory. It is also useful if you need the graphics + * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if + * you are constantly redrawing the graphics element. + * + * @name cacheAsBitmap + * @member {boolean} + * @memberof PIXI.Graphics# + * @default false + */ + return _this; + } - var gl = this.gl; - var lastBuffer = null; + /** + * Creates a new Graphics object with the same values as this one. + * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) + * + * @return {PIXI.Graphics} A clone of the graphics object + */ - for (var i = 0; i < this.attributes.length; i++) - { - var attrib = this.attributes[i]; - if(lastBuffer !== attrib.buffer) - { - attrib.buffer.bind(); - lastBuffer = attrib.buffer; - } + Graphics.prototype.clone = function clone() { + var clone = new Graphics(); - gl.vertexAttribPointer(attrib.attribute.location, - attrib.attribute.size, - attrib.type || gl.FLOAT, - attrib.normalized || false, - attrib.stride || 0, - attrib.start || 0); - } + clone.renderable = this.renderable; + clone.fillAlpha = this.fillAlpha; + clone.lineWidth = this.lineWidth; + clone.lineColor = this.lineColor; + clone.tint = this.tint; + clone.blendMode = this.blendMode; + clone.isMask = this.isMask; + clone.boundsPadding = this.boundsPadding; + clone.dirty = 0; + clone.cachedSpriteDirty = this.cachedSpriteDirty; - setVertexAttribArrays(gl, this.attributes, this.nativeState); + // copy graphics data + for (var i = 0; i < this.graphicsData.length; ++i) { + clone.graphicsData.push(this.graphicsData[i].clone()); + } - if(this.indexBuffer) - { - this.indexBuffer.bind(); - } + clone.currentPath = clone.graphicsData[clone.graphicsData.length - 1]; - return this; -}; + clone.updateLocalBounds(); -/** - * - * @param buffer {PIXI.gl.GLBuffer} - * @param attribute {*} - * @param type {String} - * @param normalized {Boolean} - * @param stride {Number} - * @param start {Number} - */ -VertexArrayObject.prototype.addAttribute = function(buffer, attribute, type, normalized, stride, start) -{ - this.attributes.push({ - buffer: buffer, - attribute: attribute, + return clone; + }; - location: attribute.location, - type: type || this.gl.FLOAT, - normalized: normalized || false, - stride: stride || 0, - start: start || 0 - }); + /** + * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() + * method or the drawCircle() method. + * + * @param {number} [lineWidth=0] - width of the line to draw, will update the objects stored style + * @param {number} [color=0] - color of the line to draw, will update the objects stored style + * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - this.dirty = true; - return this; -}; + Graphics.prototype.lineStyle = function lineStyle() { + var lineWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; -/** - * - * @param buffer {PIXI.gl.GLBuffer} - */ -VertexArrayObject.prototype.addIndex = function(buffer/*, options*/) -{ - this.indexBuffer = buffer; + this.lineWidth = lineWidth; + this.lineColor = color; + this.lineAlpha = alpha; - this.dirty = true; + if (this.currentPath) { + if (this.currentPath.shape.points.length) { + // halfway through a line? start a new one! + var shape = new _math.Polygon(this.currentPath.shape.points.slice(-2)); - return this; -}; + shape.closed = false; -/** - * Unbinds this vao and disables it - */ -VertexArrayObject.prototype.clear = function() -{ - // var gl = this.gl; + this.drawShape(shape); + } else { + // otherwise its empty so lets just set the line properties + this.currentPath.lineWidth = this.lineWidth; + this.currentPath.lineColor = this.lineColor; + this.currentPath.lineAlpha = this.lineAlpha; + } + } - // TODO - should this function unbind after clear? - // for now, no but lets see what happens in the real world! - if(this.nativeVao) - { - this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao); - } + return this; + }; - this.attributes.length = 0; - this.indexBuffer = null; + /** + * Moves the current drawing position to x, y. + * + * @param {number} x - the X coordinate to move to + * @param {number} y - the Y coordinate to move to + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - return this; -}; -/** - * @param type {Number} - * @param size {Number} - * @param start {Number} - */ -VertexArrayObject.prototype.draw = function(type, size, start) -{ - var gl = this.gl; + Graphics.prototype.moveTo = function moveTo(x, y) { + var shape = new _math.Polygon([x, y]); - if(this.indexBuffer) - { - gl.drawElements(type, size || this.indexBuffer.data.length, gl.UNSIGNED_SHORT, (start || 0) * 2 ); - } - else - { - // TODO need a better way to calculate size.. - gl.drawArrays(type, start, size || this.getSize()); - } + shape.closed = false; + this.drawShape(shape); - return this; -}; + return this; + }; -/** - * Destroy this vao - */ -VertexArrayObject.prototype.destroy = function() -{ - // lose references - this.gl = null; - this.indexBuffer = null; - this.attributes = null; - this.nativeState = null; + /** + * Draws a line using the current line style from the current drawing position to (x, y); + * The current drawing position is then set to (x, y). + * + * @param {number} x - the X coordinate to draw to + * @param {number} y - the Y coordinate to draw to + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - if(this.nativeVao) - { - this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao); - } - this.nativeVaoExtension = null; - this.nativeVao = null; -}; + Graphics.prototype.lineTo = function lineTo(x, y) { + this.currentPath.shape.points.push(x, y); + this.dirty++; -VertexArrayObject.prototype.getSize = function() -{ - var attrib = this.attributes[0]; - return attrib.buffer.data.length / (( attrib.stride/4 ) || attrib.attribute.size); -}; + return this; + }; + /** + * Calculate the points for a quadratic bezier curve and then draws it. + * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c + * + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ -/***/ }), -/* 517 */ -/***/ (function(module, exports) { + Graphics.prototype.quadraticCurveTo = function quadraticCurveTo(cpX, cpY, toX, toY) { + if (this.currentPath) { + if (this.currentPath.shape.points.length === 0) { + this.currentPath.shape.points = [0, 0]; + } + } else { + this.moveTo(0, 0); + } -/** - * Helper class to create a webGL Context - * - * @class - * @memberof PIXI.glCore - * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from - * @param options {Object} An options object that gets passed in to the canvas element containing the context attributes, - * see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext for the options available - * @return {WebGLRenderingContext} the WebGL context - */ -var createContext = function(canvas, options) -{ - var gl = canvas.getContext('webgl', options) || - canvas.getContext('experimental-webgl', options); + var n = 20; + var points = this.currentPath.shape.points; + var xa = 0; + var ya = 0; - if (!gl) - { - // fail, not able to get a context - throw new Error('This browser does not support webGL. Try using the canvas renderer'); - } + if (points.length === 0) { + this.moveTo(0, 0); + } - return gl; -}; + var fromX = points[points.length - 2]; + var fromY = points[points.length - 1]; -module.exports = createContext; + for (var i = 1; i <= n; ++i) { + var j = i / n; + xa = fromX + (cpX - fromX) * j; + ya = fromY + (cpY - fromY) * j; -/***/ }), -/* 518 */ -/***/ (function(module, exports, __webpack_require__) { + points.push(xa + (cpX + (toX - cpX) * j - xa) * j, ya + (cpY + (toY - cpY) * j - ya) * j); + } -module.exports = { - compileProgram: __webpack_require__(226), - defaultValue: __webpack_require__(227), - extractAttributes: __webpack_require__(228), - extractUniforms: __webpack_require__(229), - generateUniformAccessObject: __webpack_require__(230), - setPrecision: __webpack_require__(232), - mapSize: __webpack_require__(231), - mapType: __webpack_require__(122) -}; + this.dirty++; -/***/ }), -/* 519 */ -/***/ (function(module, exports, __webpack_require__) { + return this; + }; -"use strict"; + /** + * Calculate the points for a bezier curve and then draws it. + * + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} cpX2 - Second Control point x + * @param {number} cpY2 - Second Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ -exports.__esModule = true; + Graphics.prototype.bezierCurveTo = function bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) { + if (this.currentPath) { + if (this.currentPath.shape.points.length === 0) { + this.currentPath.shape.points = [0, 0]; + } + } else { + this.moveTo(0, 0); + } -var _core = __webpack_require__(0); + var points = this.currentPath.shape.points; -var core = _interopRequireWildcard(_core); + var fromX = points[points.length - 2]; + var fromY = points[points.length - 1]; -var _ismobilejs = __webpack_require__(60); + points.length -= 2; -var _ismobilejs2 = _interopRequireDefault(_ismobilejs); + (0, _bezierCurveTo3.default)(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, points); -var _accessibleTarget = __webpack_require__(233); + this.dirty++; -var _accessibleTarget2 = _interopRequireDefault(_accessibleTarget); + return this; + }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * The arcTo() method creates an arc/curve between two tangents on the canvas. + * + * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! + * + * @param {number} x1 - The x-coordinate of the beginning of the arc + * @param {number} y1 - The y-coordinate of the beginning of the arc + * @param {number} x2 - The x-coordinate of the end of the arc + * @param {number} y2 - The y-coordinate of the end of the arc + * @param {number} radius - The radius of the arc + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + Graphics.prototype.arcTo = function arcTo(x1, y1, x2, y2, radius) { + if (this.currentPath) { + if (this.currentPath.shape.points.length === 0) { + this.currentPath.shape.points.push(x1, y1); + } + } else { + this.moveTo(x1, y1); + } -// add some extra variables to the container.. -Object.assign(core.DisplayObject.prototype, _accessibleTarget2.default); + var points = this.currentPath.shape.points; + var fromX = points[points.length - 2]; + var fromY = points[points.length - 1]; + var a1 = fromY - y1; + var b1 = fromX - x1; + var a2 = y2 - y1; + var b2 = x2 - x1; + var mm = Math.abs(a1 * b2 - b1 * a2); -var KEY_CODE_TAB = 9; + if (mm < 1.0e-8 || radius === 0) { + if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) { + points.push(x1, y1); + } + } else { + var dd = a1 * a1 + b1 * b1; + var cc = a2 * a2 + b2 * b2; + var tt = a1 * a2 + b1 * b2; + var k1 = radius * Math.sqrt(dd) / mm; + var k2 = radius * Math.sqrt(cc) / mm; + var j1 = k1 * tt / dd; + var j2 = k2 * tt / cc; + var cx = k1 * b2 + k2 * b1; + var cy = k1 * a2 + k2 * a1; + var px = b1 * (k2 + j1); + var py = a1 * (k2 + j1); + var qx = b2 * (k1 + j2); + var qy = a2 * (k1 + j2); + var startAngle = Math.atan2(py - cy, px - cx); + var endAngle = Math.atan2(qy - cy, qx - cx); -var DIV_TOUCH_SIZE = 100; -var DIV_TOUCH_POS_X = 0; -var DIV_TOUCH_POS_Y = 0; -var DIV_TOUCH_ZINDEX = 2; + this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); + } -var DIV_HOOK_SIZE = 1; -var DIV_HOOK_POS_X = -1000; -var DIV_HOOK_POS_Y = -1000; -var DIV_HOOK_ZINDEX = 2; + this.dirty++; -/** - * The Accessibility manager reacreates the ability to tab and and have content read by screen - * readers. This is very important as it can possibly help people with disabilities access pixi - * content. - * - * Much like interaction any DisplayObject can be made accessible. This manager will map the - * events as if the mouse was being used, minimizing the efferot required to implement. - * - * An instance of this class is automatically created by default, and can be found at renderer.plugins.accessibility - * - * @class - * @memberof PIXI.accessibility - */ + return this; + }; -var AccessibilityManager = function () { /** - * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer + * The arc method creates an arc/curve (used to create circles, or parts of circles). + * + * @param {number} cx - The x-coordinate of the center of the circle + * @param {number} cy - The y-coordinate of the center of the circle + * @param {number} radius - The radius of the circle + * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position + * of the arc's circle) + * @param {number} endAngle - The ending angle, in radians + * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be + * counter-clockwise or clockwise. False is default, and indicates clockwise, while true + * indicates counter-clockwise. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - function AccessibilityManager(renderer) { - _classCallCheck(this, AccessibilityManager); - if ((_ismobilejs2.default.tablet || _ismobilejs2.default.phone) && !navigator.isCocoonJS) { - this.createTouchHook(); - } - // first we create a div that will sit over the pixi element. This is where the div overlays will go. - var div = document.createElement('div'); + Graphics.prototype.arc = function arc(cx, cy, radius, startAngle, endAngle) { + var anticlockwise = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; - div.style.width = DIV_TOUCH_SIZE + 'px'; - div.style.height = DIV_TOUCH_SIZE + 'px'; - div.style.position = 'absolute'; - div.style.top = DIV_TOUCH_POS_X + 'px'; - div.style.left = DIV_TOUCH_POS_Y + 'px'; - div.style.zIndex = DIV_TOUCH_ZINDEX; + if (startAngle === endAngle) { + return this; + } - /** - * This is the dom element that will sit over the pixi element. This is where the div overlays will go. - * - * @type {HTMLElement} - * @private - */ - this.div = div; + if (!anticlockwise && endAngle <= startAngle) { + endAngle += Math.PI * 2; + } else if (anticlockwise && startAngle <= endAngle) { + startAngle += Math.PI * 2; + } - /** - * A simple pool for storing divs. - * - * @type {*} - * @private - */ - this.pool = []; + var sweep = endAngle - startAngle; + var segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * 40; - /** - * This is a tick used to check if an object is no longer being rendered. - * - * @type {Number} - * @private - */ - this.renderId = 0; + if (sweep === 0) { + return this; + } - /** - * Setting this to true will visually show the divs - * - * @type {boolean} - */ - this.debug = false; + var startX = cx + Math.cos(startAngle) * radius; + var startY = cy + Math.sin(startAngle) * radius; - /** - * The renderer this accessibility manager works for. - * - * @member {PIXI.SystemRenderer} - */ - this.renderer = renderer; + // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path. + var points = this.currentPath ? this.currentPath.shape.points : null; - /** - * The array of currently active accessible items. - * - * @member {Array<*>} - * @private - */ - this.children = []; + if (points) { + if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) { + points.push(startX, startY); + } + } else { + this.moveTo(startX, startY); + points = this.currentPath.shape.points; + } - /** - * pre-bind the functions - * - * @private - */ - this._onKeyDown = this._onKeyDown.bind(this); - this._onMouseMove = this._onMouseMove.bind(this); + var theta = sweep / (segs * 2); + var theta2 = theta * 2; - /** - * stores the state of the manager. If there are no accessible objects or the mouse is moving the will be false. - * - * @member {Array<*>} - * @private - */ - this.isActive = false; - this.isMobileAccessabillity = false; + var cTheta = Math.cos(theta); + var sTheta = Math.sin(theta); - // let listen for tab.. once pressed we can fire up and show the accessibility layer - window.addEventListener('keydown', this._onKeyDown, false); - } + var segMinus = segs - 1; - /** - * Creates the touch hooks. - * - */ + var remainder = segMinus % 1 / segMinus; + for (var i = 0; i <= segMinus; ++i) { + var real = i + remainder * i; - AccessibilityManager.prototype.createTouchHook = function createTouchHook() { - var _this = this; + var angle = theta + startAngle + theta2 * real; - var hookDiv = document.createElement('button'); + var c = Math.cos(angle); + var s = -Math.sin(angle); - hookDiv.style.width = DIV_HOOK_SIZE + 'px'; - hookDiv.style.height = DIV_HOOK_SIZE + 'px'; - hookDiv.style.position = 'absolute'; - hookDiv.style.top = DIV_HOOK_POS_X + 'px'; - hookDiv.style.left = DIV_HOOK_POS_Y + 'px'; - hookDiv.style.zIndex = DIV_HOOK_ZINDEX; - hookDiv.style.backgroundColor = '#FF0000'; - hookDiv.title = 'HOOK DIV'; + points.push((cTheta * c + sTheta * s) * radius + cx, (cTheta * -s + sTheta * c) * radius + cy); + } - hookDiv.addEventListener('focus', function () { - _this.isMobileAccessabillity = true; - _this.activate(); - document.body.removeChild(hookDiv); - }); + this.dirty++; - document.body.appendChild(hookDiv); + return this; }; /** - * Activating will cause the Accessibility layer to be shown. This is called when a user - * preses the tab key + * Specifies a simple one-color fill that subsequent calls to other Graphics methods + * (such as lineTo() or drawCircle()) use when drawing. * - * @private + * @param {number} [color=0] - the color of the fill + * @param {number} [alpha=1] - the alpha of the fill + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - AccessibilityManager.prototype.activate = function activate() { - if (this.isActive) { - return; - } - - this.isActive = true; - - window.document.addEventListener('mousemove', this._onMouseMove, true); - window.removeEventListener('keydown', this._onKeyDown, false); + Graphics.prototype.beginFill = function beginFill() { + var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; - this.renderer.on('postrender', this.update, this); + this.filling = true; + this.fillColor = color; + this.fillAlpha = alpha; - if (this.renderer.view.parentNode) { - this.renderer.view.parentNode.appendChild(this.div); + if (this.currentPath) { + if (this.currentPath.shape.points.length <= 2) { + this.currentPath.fill = this.filling; + this.currentPath.fillColor = this.fillColor; + this.currentPath.fillAlpha = this.fillAlpha; + } } + + return this; }; /** - * Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves - * the mouse + * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. * - * @private + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - AccessibilityManager.prototype.deactivate = function deactivate() { - if (!this.isActive || this.isMobileAccessabillity) { - return; - } + Graphics.prototype.endFill = function endFill() { + this.filling = false; + this.fillColor = null; + this.fillAlpha = 1; - this.isActive = false; + return this; + }; - window.document.removeEventListener('mousemove', this._onMouseMove); - window.addEventListener('keydown', this._onKeyDown, false); + /** + * + * @param {number} x - The X coord of the top-left of the rectangle + * @param {number} y - The Y coord of the top-left of the rectangle + * @param {number} width - The width of the rectangle + * @param {number} height - The height of the rectangle + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - this.renderer.off('postrender', this.update); - if (this.div.parentNode) { - this.div.parentNode.removeChild(this.div); - } + Graphics.prototype.drawRect = function drawRect(x, y, width, height) { + this.drawShape(new _math.Rectangle(x, y, width, height)); + + return this; }; /** - * This recursive function will run throught he scene graph and add any new accessible objects to the DOM layer. * - * @private - * @param {PIXI.Container} displayObject - The DisplayObject to check. + * @param {number} x - The X coord of the top-left of the rectangle + * @param {number} y - The Y coord of the top-left of the rectangle + * @param {number} width - The width of the rectangle + * @param {number} height - The height of the rectangle + * @param {number} radius - Radius of the rectangle corners + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - AccessibilityManager.prototype.updateAccessibleObjects = function updateAccessibleObjects(displayObject) { - if (!displayObject.visible) { - return; - } + Graphics.prototype.drawRoundedRect = function drawRoundedRect(x, y, width, height, radius) { + this.drawShape(new _math.RoundedRectangle(x, y, width, height, radius)); - if (displayObject.accessible && displayObject.interactive) { - if (!displayObject._accessibleActive) { - this.addChild(displayObject); - } + return this; + }; - displayObject.renderId = this.renderId; - } + /** + * Draws a circle. + * + * @param {number} x - The X coordinate of the center of the circle + * @param {number} y - The Y coordinate of the center of the circle + * @param {number} radius - The radius of the circle + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - var children = displayObject.children; - for (var i = children.length - 1; i >= 0; i--) { - this.updateAccessibleObjects(children[i]); - } + Graphics.prototype.drawCircle = function drawCircle(x, y, radius) { + this.drawShape(new _math.Circle(x, y, radius)); + + return this; }; /** - * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects. + * Draws an ellipse. * - * @private + * @param {number} x - The X coordinate of the center of the ellipse + * @param {number} y - The Y coordinate of the center of the ellipse + * @param {number} width - The half width of the ellipse + * @param {number} height - The half height of the ellipse + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - AccessibilityManager.prototype.update = function update() { - if (!this.renderer.renderingToScreen) { - return; - } + Graphics.prototype.drawEllipse = function drawEllipse(x, y, width, height) { + this.drawShape(new _math.Ellipse(x, y, width, height)); - // update children... - this.updateAccessibleObjects(this.renderer._lastObjectRendered); + return this; + }; - var rect = this.renderer.view.getBoundingClientRect(); - var sx = rect.width / this.renderer.width; - var sy = rect.height / this.renderer.height; + /** + * Draws a polygon using the given path. + * + * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon. + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - var div = this.div; - div.style.left = rect.left + 'px'; - div.style.top = rect.top + 'px'; - div.style.width = this.renderer.width + 'px'; - div.style.height = this.renderer.height + 'px'; + Graphics.prototype.drawPolygon = function drawPolygon(path) { + // prevents an argument assignment deopt + // see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments + var points = path; - for (var i = 0; i < this.children.length; i++) { - var child = this.children[i]; + var closed = true; - if (child.renderId !== this.renderId) { - child._accessibleActive = false; + if (points instanceof _math.Polygon) { + closed = points.closed; + points = points.points; + } - core.utils.removeItems(this.children, i, 1); - this.div.removeChild(child._accessibleDiv); - this.pool.push(child._accessibleDiv); - child._accessibleDiv = null; + if (!Array.isArray(points)) { + // prevents an argument leak deopt + // see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments + points = new Array(arguments.length); - i--; + for (var i = 0; i < points.length; ++i) { + points[i] = arguments[i]; // eslint-disable-line prefer-rest-params + } + } - if (this.children.length === 0) { - this.deactivate(); - } - } else { - // map div to display.. - div = child._accessibleDiv; - var hitArea = child.hitArea; - var wt = child.worldTransform; + var shape = new _math.Polygon(points); - if (child.hitArea) { - div.style.left = (wt.tx + hitArea.x * wt.a) * sx + 'px'; - div.style.top = (wt.ty + hitArea.y * wt.d) * sy + 'px'; + shape.closed = closed; - div.style.width = hitArea.width * wt.a * sx + 'px'; - div.style.height = hitArea.height * wt.d * sy + 'px'; - } else { - hitArea = child.getBounds(); + this.drawShape(shape); - this.capHitArea(hitArea); + return this; + }; - div.style.left = hitArea.x * sx + 'px'; - div.style.top = hitArea.y * sy + 'px'; + /** + * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. + * + * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + */ - div.style.width = hitArea.width * sx + 'px'; - div.style.height = hitArea.height * sy + 'px'; - } - } + + Graphics.prototype.clear = function clear() { + if (this.lineWidth || this.filling || this.graphicsData.length > 0) { + this.lineWidth = 0; + this.filling = false; + + this.boundsDirty = -1; + this.dirty++; + this.clearDirty++; + this.graphicsData.length = 0; } - // increment the render id.. - this.renderId++; + this.currentPath = null; + this._spriteRect = null; + + return this; }; /** - * TODO: docs. + * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and + * masked with gl.scissor. * - * @param {Rectangle} hitArea - TODO docs + * @returns {boolean} True if only 1 rect. */ - AccessibilityManager.prototype.capHitArea = function capHitArea(hitArea) { - if (hitArea.x < 0) { - hitArea.width += hitArea.x; - hitArea.x = 0; - } + Graphics.prototype.isFastRect = function isFastRect() { + return this.graphicsData.length === 1 && this.graphicsData[0].shape.type === _const.SHAPES.RECT && !this.graphicsData[0].lineWidth; + }; - if (hitArea.y < 0) { - hitArea.height += hitArea.y; - hitArea.y = 0; - } + /** + * Renders the object using the WebGL renderer + * + * @private + * @param {PIXI.WebGLRenderer} renderer - The renderer + */ - if (hitArea.x + hitArea.width > this.renderer.width) { - hitArea.width = this.renderer.width - hitArea.x; + + Graphics.prototype._renderWebGL = function _renderWebGL(renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (this.dirty !== this.fastRectDirty) { + this.fastRectDirty = this.dirty; + this._fastRect = this.isFastRect(); } - if (hitArea.y + hitArea.height > this.renderer.height) { - hitArea.height = this.renderer.height - hitArea.y; + // TODO this check can be moved to dirty? + if (this._fastRect) { + this._renderSpriteRect(renderer); + } else { + renderer.setObjectRenderer(renderer.plugins.graphics); + renderer.plugins.graphics.render(this); } }; /** - * Adds a DisplayObject to the accessibility manager + * Renders a sprite rectangle. * * @private - * @param {DisplayObject} displayObject - The child to make accessible. + * @param {PIXI.WebGLRenderer} renderer - The renderer */ - AccessibilityManager.prototype.addChild = function addChild(displayObject) { - // this.activate(); + Graphics.prototype._renderSpriteRect = function _renderSpriteRect(renderer) { + var rect = this.graphicsData[0].shape; - var div = this.pool.pop(); + if (!this._spriteRect) { + this._spriteRect = new _Sprite2.default(new _Texture2.default(_Texture2.default.WHITE)); + } - if (!div) { - div = document.createElement('button'); + var sprite = this._spriteRect; - div.style.width = DIV_TOUCH_SIZE + 'px'; - div.style.height = DIV_TOUCH_SIZE + 'px'; - div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent'; - div.style.position = 'absolute'; - div.style.zIndex = DIV_TOUCH_ZINDEX; - div.style.borderStyle = 'none'; + if (this.tint === 0xffffff) { + sprite.tint = this.graphicsData[0].fillColor; + } else { + var t1 = tempColor1; + var t2 = tempColor2; - div.addEventListener('click', this._onClick.bind(this)); - div.addEventListener('focus', this._onFocus.bind(this)); - div.addEventListener('focusout', this._onFocusOut.bind(this)); - } + (0, _utils.hex2rgb)(this.graphicsData[0].fillColor, t1); + (0, _utils.hex2rgb)(this.tint, t2); - if (displayObject.accessibleTitle) { - div.title = displayObject.accessibleTitle; - } else if (!displayObject.accessibleTitle && !displayObject.accessibleHint) { - div.title = 'displayObject ' + this.tabIndex; - } + t1[0] *= t2[0]; + t1[1] *= t2[1]; + t1[2] *= t2[2]; - if (displayObject.accessibleHint) { - div.setAttribute('aria-label', displayObject.accessibleHint); + sprite.tint = (0, _utils.rgb2hex)(t1); } + sprite.alpha = this.graphicsData[0].fillAlpha; + sprite.worldAlpha = this.worldAlpha * sprite.alpha; + sprite.blendMode = this.blendMode; - // + sprite._texture._frame.width = rect.width; + sprite._texture._frame.height = rect.height; - displayObject._accessibleActive = true; - displayObject._accessibleDiv = div; - div.displayObject = displayObject; + sprite.transform.worldTransform = this.transform.worldTransform; - this.children.push(displayObject); - this.div.appendChild(displayObject._accessibleDiv); - displayObject._accessibleDiv.tabIndex = displayObject.tabIndex; + sprite.anchor.set(-rect.x / rect.width, -rect.y / rect.height); + sprite._onAnchorUpdate(); + + sprite._renderWebGL(renderer); }; /** - * Maps the div button press to pixi's InteractionManager (click) + * Renders the object using the Canvas renderer * * @private - * @param {MouseEvent} e - The click event. + * @param {PIXI.CanvasRenderer} renderer - The renderer */ - AccessibilityManager.prototype._onClick = function _onClick(e) { - var interactionManager = this.renderer.plugins.interaction; + Graphics.prototype._renderCanvas = function _renderCanvas(renderer) { + if (this.isMask === true) { + return; + } - interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData); + renderer.plugins.graphics.render(this); }; /** - * Maps the div focus events to pixis InteractionManager (mouseover) + * Retrieves the bounds of the graphic shape as a rectangle object * * @private - * @param {FocusEvent} e - The focus event. */ - AccessibilityManager.prototype._onFocus = function _onFocus(e) { - var interactionManager = this.renderer.plugins.interaction; + Graphics.prototype._calculateBounds = function _calculateBounds() { + if (this.boundsDirty !== this.dirty) { + this.boundsDirty = this.dirty; + this.updateLocalBounds(); - interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData); + this.cachedSpriteDirty = true; + } + + var lb = this._localBounds; + + this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY); }; /** - * Maps the div focus events to pixis InteractionManager (mouseout) + * Tests if a point is inside this graphics object * - * @private - * @param {FocusEvent} e - The focusout event. + * @param {PIXI.Point} point - the point to test + * @return {boolean} the result of the test */ - AccessibilityManager.prototype._onFocusOut = function _onFocusOut(e) { - var interactionManager = this.renderer.plugins.interaction; - - interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData); - }; + Graphics.prototype.containsPoint = function containsPoint(point) { + this.worldTransform.applyInverse(point, tempPoint); - /** - * Is called when a key is pressed - * - * @private - * @param {KeyboardEvent} e - The keydown event. - */ + var graphicsData = this.graphicsData; + for (var i = 0; i < graphicsData.length; ++i) { + var data = graphicsData[i]; - AccessibilityManager.prototype._onKeyDown = function _onKeyDown(e) { - if (e.keyCode !== KEY_CODE_TAB) { - return; - } + if (!data.fill) { + continue; + } - this.activate(); - }; + // only deal with fills.. + if (data.shape) { + if (data.shape.contains(tempPoint.x, tempPoint.y)) { + if (data.holes) { + for (var _i = 0; _i < data.holes.length; _i++) { + var hole = data.holes[_i]; - /** - * Is called when the mouse moves across the renderer element - * - * @private - */ + if (hole.contains(tempPoint.x, tempPoint.y)) { + return false; + } + } + } + return true; + } + } + } - AccessibilityManager.prototype._onMouseMove = function _onMouseMove() { - this.deactivate(); + return false; }; /** - * Destroys the accessibility manager + * Update the bounds of the object * */ - AccessibilityManager.prototype.destroy = function destroy() { - this.div = null; - - for (var i = 0; i < this.children.length; i++) { - this.children[i].div = null; - } - - window.document.removeEventListener('mousemove', this._onMouseMove); - window.removeEventListener('keydown', this._onKeyDown); - - this.pool = null; - this.children = null; - this.renderer = null; - }; - - return AccessibilityManager; -}(); + Graphics.prototype.updateLocalBounds = function updateLocalBounds() { + var minX = Infinity; + var maxX = -Infinity; -exports.default = AccessibilityManager; + var minY = Infinity; + var maxY = -Infinity; + if (this.graphicsData.length) { + var shape = 0; + var x = 0; + var y = 0; + var w = 0; + var h = 0; -core.WebGLRenderer.registerPlugin('accessibility', AccessibilityManager); -core.CanvasRenderer.registerPlugin('accessibility', AccessibilityManager); -//# sourceMappingURL=AccessibilityManager.js.map + for (var i = 0; i < this.graphicsData.length; i++) { + var data = this.graphicsData[i]; + var type = data.type; + var lineWidth = data.lineWidth; -/***/ }), -/* 520 */ -/***/ (function(module, exports, __webpack_require__) { + shape = data.shape; -"use strict"; + if (type === _const.SHAPES.RECT || type === _const.SHAPES.RREC) { + x = shape.x - lineWidth / 2; + y = shape.y - lineWidth / 2; + w = shape.width + lineWidth; + h = shape.height + lineWidth; + minX = x < minX ? x : minX; + maxX = x + w > maxX ? x + w : maxX; -exports.__esModule = true; + minY = y < minY ? y : minY; + maxY = y + h > maxY ? y + h : maxY; + } else if (type === _const.SHAPES.CIRC) { + x = shape.x; + y = shape.y; + w = shape.radius + lineWidth / 2; + h = shape.radius + lineWidth / 2; -var _accessibleTarget = __webpack_require__(233); + minX = x - w < minX ? x - w : minX; + maxX = x + w > maxX ? x + w : maxX; -Object.defineProperty(exports, 'accessibleTarget', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_accessibleTarget).default; - } -}); + minY = y - h < minY ? y - h : minY; + maxY = y + h > maxY ? y + h : maxY; + } else if (type === _const.SHAPES.ELIP) { + x = shape.x; + y = shape.y; + w = shape.width + lineWidth / 2; + h = shape.height + lineWidth / 2; -var _AccessibilityManager = __webpack_require__(519); + minX = x - w < minX ? x - w : minX; + maxX = x + w > maxX ? x + w : maxX; -Object.defineProperty(exports, 'AccessibilityManager', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_AccessibilityManager).default; - } -}); + minY = y - h < minY ? y - h : minY; + maxY = y + h > maxY ? y + h : maxY; + } else { + // POLY + var points = shape.points; + var x2 = 0; + var y2 = 0; + var dx = 0; + var dy = 0; + var rw = 0; + var rh = 0; + var cx = 0; + var cy = 0; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -//# sourceMappingURL=index.js.map + for (var j = 0; j + 2 < points.length; j += 2) { + x = points[j]; + y = points[j + 1]; + x2 = points[j + 2]; + y2 = points[j + 3]; + dx = Math.abs(x2 - x); + dy = Math.abs(y2 - y); + h = lineWidth; + w = Math.sqrt(dx * dx + dy * dy); -/***/ }), -/* 521 */ -/***/ (function(module, exports, __webpack_require__) { + if (w < 1e-9) { + continue; + } -"use strict"; + rw = (h / w * dy + dx) / 2; + rh = (h / w * dx + dy) / 2; + cx = (x2 + x) / 2; + cy = (y2 + y) / 2; + minX = cx - rw < minX ? cx - rw : minX; + maxX = cx + rw > maxX ? cx + rw : maxX; -exports.__esModule = true; + minY = cy - rh < minY ? cy - rh : minY; + maxY = cy + rh > maxY ? cy + rh : maxY; + } + } + } + } else { + minX = 0; + maxX = 0; + minY = 0; + maxY = 0; + } -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + var padding = this.boundsPadding; -var _autoDetectRenderer = __webpack_require__(234); + this._localBounds.minX = minX - padding; + this._localBounds.maxX = maxX + padding; -var _Container = __webpack_require__(53); + this._localBounds.minY = minY - padding; + this._localBounds.maxY = maxY + padding; + }; -var _Container2 = _interopRequireDefault(_Container); + /** + * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. + * + * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw. + * @return {PIXI.GraphicsData} The generated GraphicsData object. + */ -var _Ticker = __webpack_require__(251); -var _Ticker2 = _interopRequireDefault(_Ticker); + Graphics.prototype.drawShape = function drawShape(shape) { + if (this.currentPath) { + // check current path! + if (this.currentPath.shape.points.length <= 2) { + this.graphicsData.pop(); + } + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + this.currentPath = null; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var data = new _GraphicsData2.default(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, this.nativeLines, shape); -/** - * Convenience class to create a new PIXI application. - * This class automatically creates the renderer, ticker - * and root container. - * - * @example - * // Create the application - * const app = new PIXI.Application(); - * - * // Add the view to the DOM - * document.body.appendChild(app.view); - * - * // ex, add display objects - * app.stage.addChild(PIXI.Sprite.fromImage('something.png')); - * - * @class - * @memberof PIXI - */ -var Application = function () { - /** - * @param {number} [width=800] - the width of the renderers view - * @param {number} [height=600] - the height of the renderers view - * @param {object} [options] - The optional renderer parameters - * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional - * @param {boolean} [options.transparent=false] - If the render view is transparent, default false - * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment) - * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you - * need to call toDataUrl on the webgl context - * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2 - * @param {boolean} [noWebGL=false] - prevents selection of WebGL renderer, even if such is present - */ - function Application(width, height, options, noWebGL) { - _classCallCheck(this, Application); + this.graphicsData.push(data); - /** - * WebGL renderer if available, otherwise CanvasRenderer - * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer} - */ - this.renderer = (0, _autoDetectRenderer.autoDetectRenderer)(width, height, options, noWebGL); + if (data.type === _const.SHAPES.POLY) { + data.shape.closed = data.shape.closed || this.filling; + this.currentPath = data; + } - /** - * The root display container that's renderered. - * @member {PIXI.Container} - */ - this.stage = new _Container2.default(); + this.dirty++; + + return data; + }; /** - * Ticker for doing render updates. - * @member {PIXI.ticker.Ticker} + * Generates a canvas texture. + * + * @param {number} scaleMode - The scale mode of the texture. + * @param {number} resolution - The resolution of the texture. + * @return {PIXI.Texture} The new texture. */ - this.ticker = new _Ticker2.default(); - this.ticker.add(this.render, this); - - // Start the rendering - this.start(); - } - /** - * Render the current stage. - */ + Graphics.prototype.generateCanvasTexture = function generateCanvasTexture(scaleMode) { + var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + var bounds = this.getLocalBounds(); - Application.prototype.render = function render() { - this.renderer.render(this.stage); - }; + var canvasBuffer = _RenderTexture2.default.create(bounds.width, bounds.height, scaleMode, resolution); - /** - * Convenience method for stopping the render. - */ + if (!canvasRenderer) { + canvasRenderer = new _CanvasRenderer2.default(); + } + this.transform.updateLocalTransform(); + this.transform.localTransform.copy(tempMatrix); - Application.prototype.stop = function stop() { - this.ticker.stop(); - }; + tempMatrix.invert(); - /** - * Convenience method for starting the render. - */ + tempMatrix.tx -= bounds.x; + tempMatrix.ty -= bounds.y; + canvasRenderer.render(this, canvasBuffer, true, tempMatrix); - Application.prototype.start = function start() { - this.ticker.start(); - }; + var texture = _Texture2.default.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode, 'graphics'); - /** - * Reference to the renderer's canvas element. - * @member {HTMLCanvasElement} - * @readonly - */ + texture.baseTexture.resolution = resolution; + texture.baseTexture.update(); + return texture; + }; - /** - * Destroy and don't use after this. - * @param {Boolean} [removeView=false] Automatically remove canvas from DOM. - */ - Application.prototype.destroy = function destroy(removeView) { - this.stop(); - this.ticker.remove(this.render, this); - this.ticker = null; + /** + * Closes the current path. + * + * @return {PIXI.Graphics} Returns itself. + */ - this.stage.destroy(); - this.stage = null; - this.renderer.destroy(removeView); - this.renderer = null; - }; + Graphics.prototype.closePath = function closePath() { + // ok so close path assumes next one is a hole! + var currentPath = this.currentPath; - _createClass(Application, [{ - key: 'view', - get: function get() { - return this.renderer.view; - } - }]); + if (currentPath && currentPath.shape) { + currentPath.shape.close(); + } - return Application; -}(); + return this; + }; -exports.default = Application; -//# sourceMappingURL=Application.js.map + /** + * Adds a hole in the current path. + * + * @return {PIXI.Graphics} Returns itself. + */ -/***/ }), -/* 522 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + Graphics.prototype.addHole = function addHole() { + // this is a hole! + var hole = this.graphicsData.pop(); + this.currentPath = this.graphicsData[this.graphicsData.length - 1]; -exports.__esModule = true; + this.currentPath.addHole(hole.shape); + this.currentPath = null; -var _Container2 = __webpack_require__(53); + return this; + }; -var _Container3 = _interopRequireDefault(_Container2); + /** + * Destroys the Graphics object. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all + * options have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have + * their destroy method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the texture of the child sprite + * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true + * Should it destroy the base texture of the child sprite + */ -var _RenderTexture = __webpack_require__(130); -var _RenderTexture2 = _interopRequireDefault(_RenderTexture); + Graphics.prototype.destroy = function destroy(options) { + _Container.prototype.destroy.call(this, options); -var _Texture = __webpack_require__(57); + // destroy each of the GraphicsData objects + for (var i = 0; i < this.graphicsData.length; ++i) { + this.graphicsData[i].destroy(); + } -var _Texture2 = _interopRequireDefault(_Texture); + // for each webgl data entry, destroy the WebGLGraphicsData + for (var id in this._webgl) { + for (var j = 0; j < this._webgl[id].data.length; ++j) { + this._webgl[id].data[j].destroy(); + } + } -var _GraphicsData = __webpack_require__(238); + if (this._spriteRect) { + this._spriteRect.destroy(); + } -var _GraphicsData2 = _interopRequireDefault(_GraphicsData); + this.graphicsData = null; -var _Sprite = __webpack_require__(128); + this.currentPath = null; + this._webgl = null; + this._localBounds = null; + }; -var _Sprite2 = _interopRequireDefault(_Sprite); + return Graphics; +}(_Container3.default); -var _math = __webpack_require__(7); +exports.default = Graphics; -var _utils = __webpack_require__(5); -var _const = __webpack_require__(2); +Graphics._SPRITE_TEXTURE = null; +//# sourceMappingURL=Graphics.js.map -var _Bounds = __webpack_require__(123); +/***/ }), +/* 521 */ +/***/ (function(module, exports, __webpack_require__) { -var _Bounds2 = _interopRequireDefault(_Bounds); +"use strict"; -var _bezierCurveTo2 = __webpack_require__(524); -var _bezierCurveTo3 = _interopRequireDefault(_bezierCurveTo2); +exports.__esModule = true; -var _CanvasRenderer = __webpack_require__(54); +var _CanvasRenderer = __webpack_require__(56); var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); +var _const = __webpack_require__(0); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var canvasRenderer = void 0; -var tempMatrix = new _math.Matrix(); -var tempPoint = new _math.Point(); -var tempColor1 = new Float32Array(4); -var tempColor2 = new Float32Array(4); +/** + * @author Mat Groves + * + * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ + * for creating the original PixiJS version! + * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they + * now share 4 bytes on the vertex buffer + * + * Heavily inspired by LibGDX's CanvasGraphicsRenderer: + * https://github.com/libgdx/libgdx/blob/1.0.0/gdx/src/com/badlogic/gdx/graphics/glutils/ShapeRenderer.java + */ /** - * The Graphics class contains methods used to draw primitive shapes such as lines, circles and - * rectangles to the display, and to color and fill them. + * Renderer dedicated to drawing and batching graphics objects. * * @class - * @extends PIXI.Container + * @private * @memberof PIXI */ +var CanvasGraphicsRenderer = function () { + /** + * @param {PIXI.CanvasRenderer} renderer - The current PIXI renderer. + */ + function CanvasGraphicsRenderer(renderer) { + _classCallCheck(this, CanvasGraphicsRenderer); -var Graphics = function (_Container) { - _inherits(Graphics, _Container); + this.renderer = renderer; + } /** + * Renders a Graphics object to a canvas. * + * @param {PIXI.Graphics} graphics - the actual graphics object to render */ - function Graphics() { - _classCallCheck(this, Graphics); - - /** - * The alpha value used when filling the Graphics object. - * - * @member {number} - * @default 1 - */ - var _this = _possibleConstructorReturn(this, _Container.call(this)); - - _this.fillAlpha = 1; - - /** - * The width (thickness) of any lines drawn. - * - * @member {number} - * @default 0 - */ - _this.lineWidth = 0; - - /** - * The color of any lines drawn. - * - * @member {string} - * @default 0 - */ - _this.lineColor = 0; - - /** - * Graphics data - * - * @member {PIXI.GraphicsData[]} - * @private - */ - _this.graphicsData = []; - - /** - * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to - * reset the tint. - * - * @member {number} - * @default 0xFFFFFF - */ - _this.tint = 0xFFFFFF; - - /** - * The previous tint applied to the graphic shape. Used to compare to the current tint and - * check if theres change. - * - * @member {number} - * @private - * @default 0xFFFFFF - */ - _this._prevTint = 0xFFFFFF; - - /** - * The blend mode to be applied to the graphic shape. Apply a value of - * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. - * - * @member {number} - * @default PIXI.BLEND_MODES.NORMAL; - * @see PIXI.BLEND_MODES - */ - _this.blendMode = _const.BLEND_MODES.NORMAL; - - /** - * Current path - * - * @member {PIXI.GraphicsData} - * @private - */ - _this.currentPath = null; - /** - * Array containing some WebGL-related properties used by the WebGL renderer. - * - * @member {object} - * @private - */ - // TODO - _webgl should use a prototype object, not a random undocumented object... - _this._webGL = {}; - /** - * Whether this shape is being used as a mask. - * - * @member {boolean} - */ - _this.isMask = false; + CanvasGraphicsRenderer.prototype.render = function render(graphics) { + var renderer = this.renderer; + var context = renderer.context; + var worldAlpha = graphics.worldAlpha; + var transform = graphics.transform.worldTransform; + var resolution = renderer.resolution; - /** - * The bounds' padding used for bounds calculation. - * - * @member {number} - */ - _this.boundsPadding = 0; + // if the tint has changed, set the graphics object to dirty. + if (this._prevTint !== this.tint) { + this.dirty = true; + } - /** - * A cache of the local bounds to prevent recalculation. - * - * @member {PIXI.Rectangle} - * @private - */ - _this._localBounds = new _Bounds2.default(); + context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution); - /** - * Used to detect if the graphics object has changed. If this is set to true then the graphics - * object will be recalculated. - * - * @member {boolean} - * @private - */ - _this.dirty = 0; + if (graphics.dirty) { + this.updateGraphicsTint(graphics); + graphics.dirty = false; + } - /** - * Used to detect if we need to do a fast rect check using the id compare method - * @type {Number} - */ - _this.fastRectDirty = -1; + renderer.setBlendMode(graphics.blendMode); - /** - * Used to detect if we clear the graphics webGL data - * @type {Number} - */ - _this.clearDirty = 0; + for (var i = 0; i < graphics.graphicsData.length; i++) { + var data = graphics.graphicsData[i]; + var shape = data.shape; - /** - * Used to detect if we we need to recalculate local bounds - * @type {Number} - */ - _this.boundsDirty = -1; + var fillColor = data._fillTint; + var lineColor = data._lineTint; - /** - * Used to detect if the cached sprite object needs to be updated. - * - * @member {boolean} - * @private - */ - _this.cachedSpriteDirty = false; + context.lineWidth = data.lineWidth; - _this._spriteRect = null; - _this._fastRect = false; + if (data.type === _const.SHAPES.POLY) { + context.beginPath(); - /** - * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite. - * This is useful if your graphics element does not change often, as it will speed up the rendering - * of the object in exchange for taking up texture memory. It is also useful if you need the graphics - * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if - * you are constantly redrawing the graphics element. - * - * @name cacheAsBitmap - * @member {boolean} - * @memberof PIXI.Graphics# - * @default false - */ - return _this; - } + this.renderPolygon(shape.points, shape.closed, context); - /** - * Creates a new Graphics object with the same values as this one. - * Note that the only the properties of the object are cloned, not its transform (position,scale,etc) - * - * @return {PIXI.Graphics} A clone of the graphics object - */ + for (var j = 0; j < data.holes.length; j++) { + this.renderPolygon(data.holes[j].points, true, context); + } + if (data.fill) { + context.globalAlpha = data.fillAlpha * worldAlpha; + context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); + context.fill(); + } + if (data.lineWidth) { + context.globalAlpha = data.lineAlpha * worldAlpha; + context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); + context.stroke(); + } + } else if (data.type === _const.SHAPES.RECT) { + if (data.fillColor || data.fillColor === 0) { + context.globalAlpha = data.fillAlpha * worldAlpha; + context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); + context.fillRect(shape.x, shape.y, shape.width, shape.height); + } + if (data.lineWidth) { + context.globalAlpha = data.lineAlpha * worldAlpha; + context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); + context.strokeRect(shape.x, shape.y, shape.width, shape.height); + } + } else if (data.type === _const.SHAPES.CIRC) { + // TODO - need to be Undefined! + context.beginPath(); + context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI); + context.closePath(); - Graphics.prototype.clone = function clone() { - var clone = new Graphics(); + if (data.fill) { + context.globalAlpha = data.fillAlpha * worldAlpha; + context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); + context.fill(); + } + if (data.lineWidth) { + context.globalAlpha = data.lineAlpha * worldAlpha; + context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); + context.stroke(); + } + } else if (data.type === _const.SHAPES.ELIP) { + // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - clone.renderable = this.renderable; - clone.fillAlpha = this.fillAlpha; - clone.lineWidth = this.lineWidth; - clone.lineColor = this.lineColor; - clone.tint = this.tint; - clone.blendMode = this.blendMode; - clone.isMask = this.isMask; - clone.boundsPadding = this.boundsPadding; - clone.dirty = 0; - clone.cachedSpriteDirty = this.cachedSpriteDirty; + var w = shape.width * 2; + var h = shape.height * 2; - // copy graphics data - for (var i = 0; i < this.graphicsData.length; ++i) { - clone.graphicsData.push(this.graphicsData[i].clone()); - } + var x = shape.x - w / 2; + var y = shape.y - h / 2; - clone.currentPath = clone.graphicsData[clone.graphicsData.length - 1]; + context.beginPath(); - clone.updateLocalBounds(); + var kappa = 0.5522848; + var ox = w / 2 * kappa; // control point offset horizontal + var oy = h / 2 * kappa; // control point offset vertical + var xe = x + w; // x-end + var ye = y + h; // y-end + var xm = x + w / 2; // x-middle + var ym = y + h / 2; // y-middle - return clone; - }; + context.moveTo(x, ym); + context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); + context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); + context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); + context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - /** - * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() - * method or the drawCircle() method. - * - * @param {number} [lineWidth=0] - width of the line to draw, will update the objects stored style - * @param {number} [color=0] - color of the line to draw, will update the objects stored style - * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ + context.closePath(); + if (data.fill) { + context.globalAlpha = data.fillAlpha * worldAlpha; + context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); + context.fill(); + } + if (data.lineWidth) { + context.globalAlpha = data.lineAlpha * worldAlpha; + context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); + context.stroke(); + } + } else if (data.type === _const.SHAPES.RREC) { + var rx = shape.x; + var ry = shape.y; + var width = shape.width; + var height = shape.height; + var radius = shape.radius; - Graphics.prototype.lineStyle = function lineStyle() { - var lineWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; + var maxRadius = Math.min(width, height) / 2 | 0; - this.lineWidth = lineWidth; - this.lineColor = color; - this.lineAlpha = alpha; + radius = radius > maxRadius ? maxRadius : radius; - if (this.currentPath) { - if (this.currentPath.shape.points.length) { - // halfway through a line? start a new one! - var shape = new _math.Polygon(this.currentPath.shape.points.slice(-2)); + context.beginPath(); + context.moveTo(rx, ry + radius); + context.lineTo(rx, ry + height - radius); + context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); + context.lineTo(rx + width - radius, ry + height); + context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); + context.lineTo(rx + width, ry + radius); + context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); + context.lineTo(rx + radius, ry); + context.quadraticCurveTo(rx, ry, rx, ry + radius); + context.closePath(); - shape.closed = false; + if (data.fillColor || data.fillColor === 0) { + context.globalAlpha = data.fillAlpha * worldAlpha; + context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); + context.fill(); + } - this.drawShape(shape); - } else { - // otherwise its empty so lets just set the line properties - this.currentPath.lineWidth = this.lineWidth; - this.currentPath.lineColor = this.lineColor; - this.currentPath.lineAlpha = this.lineAlpha; + if (data.lineWidth) { + context.globalAlpha = data.lineAlpha * worldAlpha; + context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); + context.stroke(); + } } } - - return this; }; /** - * Moves the current drawing position to x, y. + * Updates the tint of a graphics object * - * @param {number} x - the X coordinate to move to - * @param {number} y - the Y coordinate to move to - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + * @private + * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated */ - Graphics.prototype.moveTo = function moveTo(x, y) { - var shape = new _math.Polygon([x, y]); - - shape.closed = false; - this.drawShape(shape); + CanvasGraphicsRenderer.prototype.updateGraphicsTint = function updateGraphicsTint(graphics) { + graphics._prevTint = graphics.tint; - return this; - }; + var tintR = (graphics.tint >> 16 & 0xFF) / 255; + var tintG = (graphics.tint >> 8 & 0xFF) / 255; + var tintB = (graphics.tint & 0xFF) / 255; - /** - * Draws a line using the current line style from the current drawing position to (x, y); - * The current drawing position is then set to (x, y). - * - * @param {number} x - the X coordinate to draw to - * @param {number} y - the Y coordinate to draw to - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ + for (var i = 0; i < graphics.graphicsData.length; ++i) { + var data = graphics.graphicsData[i]; + var fillColor = data.fillColor | 0; + var lineColor = data.lineColor | 0; - Graphics.prototype.lineTo = function lineTo(x, y) { - this.currentPath.shape.points.push(x, y); - this.dirty++; + // super inline cos im an optimization NAZI :) + data._fillTint = ((fillColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (fillColor & 0xFF) / 255 * tintB * 255; - return this; + data._lineTint = ((lineColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (lineColor & 0xFF) / 255 * tintB * 255; + } }; /** - * Calculate the points for a quadratic bezier curve and then draws it. - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c + * Renders a polygon. * - * @param {number} cpX - Control point x - * @param {number} cpY - Control point y - * @param {number} toX - Destination point x - * @param {number} toY - Destination point y - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + * @param {PIXI.Point[]} points - The points to render + * @param {boolean} close - Should the polygon be closed + * @param {CanvasRenderingContext2D} context - The rendering context to use */ - Graphics.prototype.quadraticCurveTo = function quadraticCurveTo(cpX, cpY, toX, toY) { - if (this.currentPath) { - if (this.currentPath.shape.points.length === 0) { - this.currentPath.shape.points = [0, 0]; - } - } else { - this.moveTo(0, 0); - } - - var n = 20; - var points = this.currentPath.shape.points; - var xa = 0; - var ya = 0; + CanvasGraphicsRenderer.prototype.renderPolygon = function renderPolygon(points, close, context) { + context.moveTo(points[0], points[1]); - if (points.length === 0) { - this.moveTo(0, 0); + for (var j = 1; j < points.length / 2; ++j) { + context.lineTo(points[j * 2], points[j * 2 + 1]); } - var fromX = points[points.length - 2]; - var fromY = points[points.length - 1]; - - for (var i = 1; i <= n; ++i) { - var j = i / n; - - xa = fromX + (cpX - fromX) * j; - ya = fromY + (cpY - fromY) * j; - - points.push(xa + (cpX + (toX - cpX) * j - xa) * j, ya + (cpY + (toY - cpY) * j - ya) * j); + if (close) { + context.closePath(); } - - this.dirty++; - - return this; }; /** - * Calculate the points for a bezier curve and then draws it. + * destroy graphics object * - * @param {number} cpX - Control point x - * @param {number} cpY - Control point y - * @param {number} cpX2 - Second Control point x - * @param {number} cpY2 - Second Control point y - * @param {number} toX - Destination point x - * @param {number} toY - Destination point y - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - Graphics.prototype.bezierCurveTo = function bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) { - if (this.currentPath) { - if (this.currentPath.shape.points.length === 0) { - this.currentPath.shape.points = [0, 0]; - } - } else { - this.moveTo(0, 0); - } - - var points = this.currentPath.shape.points; - - var fromX = points[points.length - 2]; - var fromY = points[points.length - 1]; - - points.length -= 2; - - (0, _bezierCurveTo3.default)(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, points); - - this.dirty++; - - return this; + CanvasGraphicsRenderer.prototype.destroy = function destroy() { + this.renderer = null; }; - /** - * The arcTo() method creates an arc/curve between two tangents on the canvas. - * - * "borrowed" from https://code.google.com/p/fxcanvas/ - thanks google! - * - * @param {number} x1 - The x-coordinate of the beginning of the arc - * @param {number} y1 - The y-coordinate of the beginning of the arc - * @param {number} x2 - The x-coordinate of the end of the arc - * @param {number} y2 - The y-coordinate of the end of the arc - * @param {number} radius - The radius of the arc - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ + return CanvasGraphicsRenderer; +}(); +exports.default = CanvasGraphicsRenderer; - Graphics.prototype.arcTo = function arcTo(x1, y1, x2, y2, radius) { - if (this.currentPath) { - if (this.currentPath.shape.points.length === 0) { - this.currentPath.shape.points.push(x1, y1); - } - } else { - this.moveTo(x1, y1); - } - var points = this.currentPath.shape.points; - var fromX = points[points.length - 2]; - var fromY = points[points.length - 1]; - var a1 = fromY - y1; - var b1 = fromX - x1; - var a2 = y2 - y1; - var b2 = x2 - x1; - var mm = Math.abs(a1 * b2 - b1 * a2); +_CanvasRenderer2.default.registerPlugin('graphics', CanvasGraphicsRenderer); +//# sourceMappingURL=CanvasGraphicsRenderer.js.map - if (mm < 1.0e-8 || radius === 0) { - if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) { - points.push(x1, y1); - } - } else { - var dd = a1 * a1 + b1 * b1; - var cc = a2 * a2 + b2 * b2; - var tt = a1 * a2 + b1 * b2; - var k1 = radius * Math.sqrt(dd) / mm; - var k2 = radius * Math.sqrt(cc) / mm; - var j1 = k1 * tt / dd; - var j2 = k2 * tt / cc; - var cx = k1 * b2 + k2 * b1; - var cy = k1 * a2 + k2 * a1; - var px = b1 * (k2 + j1); - var py = a1 * (k2 + j1); - var qx = b2 * (k1 + j2); - var qy = a2 * (k1 + j2); - var startAngle = Math.atan2(py - cy, px - cx); - var endAngle = Math.atan2(qy - cy, qx - cx); +/***/ }), +/* 522 */ +/***/ (function(module, exports, __webpack_require__) { - this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1); - } +"use strict"; - this.dirty++; - return this; - }; +exports.__esModule = true; +exports.default = bezierCurveTo; +/** + * Calculate the points for a bezier curve and then draws it. + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @param {number} fromX - Starting point x + * @param {number} fromY - Starting point y + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} cpX2 - Second Control point x + * @param {number} cpY2 - Second Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @param {number[]} [path=[]] - Path array to push points into + * @return {number[]} Array of points of the curve + */ +function bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) { + var path = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : []; - /** - * The arc method creates an arc/curve (used to create circles, or parts of circles). - * - * @param {number} cx - The x-coordinate of the center of the circle - * @param {number} cy - The y-coordinate of the center of the circle - * @param {number} radius - The radius of the circle - * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position - * of the arc's circle) - * @param {number} endAngle - The ending angle, in radians - * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be - * counter-clockwise or clockwise. False is default, and indicates clockwise, while true - * indicates counter-clockwise. - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ + var n = 20; + var dt = 0; + var dt2 = 0; + var dt3 = 0; + var t2 = 0; + var t3 = 0; + path.push(fromX, fromY); - Graphics.prototype.arc = function arc(cx, cy, radius, startAngle, endAngle) { - var anticlockwise = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + for (var i = 1, j = 0; i <= n; ++i) { + j = i / n; - if (startAngle === endAngle) { - return this; - } + dt = 1 - j; + dt2 = dt * dt; + dt3 = dt2 * dt; - if (!anticlockwise && endAngle <= startAngle) { - endAngle += Math.PI * 2; - } else if (anticlockwise && startAngle <= endAngle) { - startAngle += Math.PI * 2; - } + t2 = j * j; + t3 = t2 * j; - var sweep = endAngle - startAngle; - var segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * 40; + path.push(dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); + } - if (sweep === 0) { - return this; - } + return path; +} +//# sourceMappingURL=bezierCurveTo.js.map - var startX = cx + Math.cos(startAngle) * radius; - var startY = cy + Math.sin(startAngle) * radius; +/***/ }), +/* 523 */ +/***/ (function(module, exports, __webpack_require__) { - // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path. - var points = this.currentPath ? this.currentPath.shape.points : null; +"use strict"; - if (points) { - if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) { - points.push(startX, startY); - } - } else { - this.moveTo(startX, startY); - points = this.currentPath.shape.points; - } - var theta = sweep / (segs * 2); - var theta2 = theta * 2; +exports.__esModule = true; - var cTheta = Math.cos(theta); - var sTheta = Math.sin(theta); +var _utils = __webpack_require__(3); - var segMinus = segs - 1; +var _const = __webpack_require__(0); - var remainder = segMinus % 1 / segMinus; +var _ObjectRenderer2 = __webpack_require__(82); - for (var i = 0; i <= segMinus; ++i) { - var real = i + remainder * i; +var _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2); - var angle = theta + startAngle + theta2 * real; +var _WebGLRenderer = __webpack_require__(81); - var c = Math.cos(angle); - var s = -Math.sin(angle); +var _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer); - points.push((cTheta * c + sTheta * s) * radius + cx, (cTheta * -s + sTheta * c) * radius + cy); - } +var _WebGLGraphicsData = __webpack_require__(524); - this.dirty++; +var _WebGLGraphicsData2 = _interopRequireDefault(_WebGLGraphicsData); - return this; - }; +var _PrimitiveShader = __webpack_require__(525); - /** - * Specifies a simple one-color fill that subsequent calls to other Graphics methods - * (such as lineTo() or drawCircle()) use when drawing. - * - * @param {number} [color=0] - the color of the fill - * @param {number} [alpha=1] - the alpha of the fill - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ +var _PrimitiveShader2 = _interopRequireDefault(_PrimitiveShader); +var _buildPoly = __webpack_require__(527); - Graphics.prototype.beginFill = function beginFill() { - var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; +var _buildPoly2 = _interopRequireDefault(_buildPoly); - this.filling = true; - this.fillColor = color; - this.fillAlpha = alpha; +var _buildRectangle = __webpack_require__(528); - if (this.currentPath) { - if (this.currentPath.shape.points.length <= 2) { - this.currentPath.fill = this.filling; - this.currentPath.fillColor = this.fillColor; - this.currentPath.fillAlpha = this.fillAlpha; - } - } +var _buildRectangle2 = _interopRequireDefault(_buildRectangle); - return this; - }; +var _buildRoundedRectangle = __webpack_require__(529); - /** - * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method. - * - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ +var _buildRoundedRectangle2 = _interopRequireDefault(_buildRoundedRectangle); +var _buildCircle = __webpack_require__(526); - Graphics.prototype.endFill = function endFill() { - this.filling = false; - this.fillColor = null; - this.fillAlpha = 1; +var _buildCircle2 = _interopRequireDefault(_buildCircle); - return this; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * - * @param {number} x - The X coord of the top-left of the rectangle - * @param {number} y - The Y coord of the top-left of the rectangle - * @param {number} width - The width of the rectangle - * @param {number} height - The height of the rectangle - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - Graphics.prototype.drawRect = function drawRect(x, y, width, height) { - this.drawShape(new _math.Rectangle(x, y, width, height)); +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - return this; - }; +/** + * Renders the graphics object. + * + * @class + * @memberof PIXI + * @extends PIXI.ObjectRenderer + */ +var GraphicsRenderer = function (_ObjectRenderer) { + _inherits(GraphicsRenderer, _ObjectRenderer); /** - * - * @param {number} x - The X coord of the top-left of the rectangle - * @param {number} y - The Y coord of the top-left of the rectangle - * @param {number} width - The width of the rectangle - * @param {number} height - The height of the rectangle - * @param {number} radius - Radius of the rectangle corners - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + * @param {PIXI.WebGLRenderer} renderer - The renderer this object renderer works for. */ + function GraphicsRenderer(renderer) { + _classCallCheck(this, GraphicsRenderer); + var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer)); - Graphics.prototype.drawRoundedRect = function drawRoundedRect(x, y, width, height, radius) { - this.drawShape(new _math.RoundedRectangle(x, y, width, height, radius)); - - return this; - }; - - /** - * Draws a circle. - * - * @param {number} x - The X coordinate of the center of the circle - * @param {number} y - The Y coordinate of the center of the circle - * @param {number} radius - The radius of the circle - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls - */ + _this.graphicsDataPool = []; + _this.primitiveShader = null; - Graphics.prototype.drawCircle = function drawCircle(x, y, radius) { - this.drawShape(new _math.Circle(x, y, radius)); + _this.gl = renderer.gl; - return this; - }; + // easy access! + _this.CONTEXT_UID = 0; + return _this; + } /** - * Draws an ellipse. + * Called when there is a WebGL context change + * + * @private * - * @param {number} x - The X coordinate of the center of the ellipse - * @param {number} y - The Y coordinate of the center of the ellipse - * @param {number} width - The half width of the ellipse - * @param {number} height - The half height of the ellipse - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - Graphics.prototype.drawEllipse = function drawEllipse(x, y, width, height) { - this.drawShape(new _math.Ellipse(x, y, width, height)); - - return this; + GraphicsRenderer.prototype.onContextChange = function onContextChange() { + this.gl = this.renderer.gl; + this.CONTEXT_UID = this.renderer.CONTEXT_UID; + this.primitiveShader = new _PrimitiveShader2.default(this.gl); }; /** - * Draws a polygon using the given path. + * Destroys this renderer. * - * @param {number[]|PIXI.Point[]} path - The path data used to construct the polygon. - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls */ - Graphics.prototype.drawPolygon = function drawPolygon(path) { - // prevents an argument assignment deopt - // see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments - var points = path; - - var closed = true; - - if (points instanceof _math.Polygon) { - closed = points.closed; - points = points.points; - } - - if (!Array.isArray(points)) { - // prevents an argument leak deopt - // see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments - points = new Array(arguments.length); + GraphicsRenderer.prototype.destroy = function destroy() { + _ObjectRenderer3.default.prototype.destroy.call(this); - for (var i = 0; i < points.length; ++i) { - points[i] = arguments[i]; // eslint-disable-line prefer-rest-params - } + for (var i = 0; i < this.graphicsDataPool.length; ++i) { + this.graphicsDataPool[i].destroy(); } - var shape = new _math.Polygon(points); - - shape.closed = closed; - - this.drawShape(shape); - - return this; + this.graphicsDataPool = null; }; /** - * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings. + * Renders a graphics object. * - * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls + * @param {PIXI.Graphics} graphics - The graphics object to render. */ - Graphics.prototype.clear = function clear() { - if (this.lineWidth || this.filling || this.graphicsData.length > 0) { - this.lineWidth = 0; - this.filling = false; - - this.boundsDirty = -1; - this.dirty++; - this.clearDirty++; - this.graphicsData.length = 0; - } + GraphicsRenderer.prototype.render = function render(graphics) { + var renderer = this.renderer; + var gl = renderer.gl; - this.currentPath = null; - this._spriteRect = null; + var webGLData = void 0; + var webGL = graphics._webGL[this.CONTEXT_UID]; - return this; - }; + if (!webGL || graphics.dirty !== webGL.dirty) { + this.updateGraphics(graphics); - /** - * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and - * masked with gl.scissor. - * - * @returns {boolean} True if only 1 rect. - */ + webGL = graphics._webGL[this.CONTEXT_UID]; + } + // This could be speeded up for sure! + var shader = this.primitiveShader; - Graphics.prototype.isFastRect = function isFastRect() { - return this.graphicsData.length === 1 && this.graphicsData[0].shape.type === _const.SHAPES.RECT && !this.graphicsData[0].lineWidth; - }; + renderer.bindShader(shader); + renderer.state.setBlendMode(graphics.blendMode); - /** - * Renders the object using the WebGL renderer - * - * @private - * @param {PIXI.WebGLRenderer} renderer - The renderer - */ + for (var i = 0, n = webGL.data.length; i < n; i++) { + webGLData = webGL.data[i]; + var shaderTemp = webGLData.shader; + renderer.bindShader(shaderTemp); + shaderTemp.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true); + shaderTemp.uniforms.tint = (0, _utils.hex2rgb)(graphics.tint); + shaderTemp.uniforms.alpha = graphics.worldAlpha; - Graphics.prototype._renderWebGL = function _renderWebGL(renderer) { - // if the sprite is not visible or the alpha is 0 then no need to render this element - if (this.dirty !== this.fastRectDirty) { - this.fastRectDirty = this.dirty; - this._fastRect = this.isFastRect(); - } + renderer.bindVao(webGLData.vao); - // TODO this check can be moved to dirty? - if (this._fastRect) { - this._renderSpriteRect(renderer); - } else { - renderer.setObjectRenderer(renderer.plugins.graphics); - renderer.plugins.graphics.render(this); + if (webGLData.nativeLines) { + gl.drawArrays(gl.LINES, 0, webGLData.points.length / 6); + } else { + webGLData.vao.draw(gl.TRIANGLE_STRIP, webGLData.indices.length); + } } }; /** - * Renders a sprite rectangle. + * Updates the graphics object * * @private - * @param {PIXI.WebGLRenderer} renderer - The renderer + * @param {PIXI.Graphics} graphics - The graphics object to update */ - Graphics.prototype._renderSpriteRect = function _renderSpriteRect(renderer) { - var rect = this.graphicsData[0].shape; - - if (!this._spriteRect) { - if (!Graphics._SPRITE_TEXTURE) { - Graphics._SPRITE_TEXTURE = _RenderTexture2.default.create(10, 10); + GraphicsRenderer.prototype.updateGraphics = function updateGraphics(graphics) { + var gl = this.renderer.gl; - var canvas = document.createElement('canvas'); + // get the contexts graphics object + var webGL = graphics._webGL[this.CONTEXT_UID]; - canvas.width = 10; - canvas.height = 10; + // if the graphics object does not exist in the webGL context time to create it! + if (!webGL) { + webGL = graphics._webGL[this.CONTEXT_UID] = { lastIndex: 0, data: [], gl: gl, clearDirty: -1, dirty: -1 }; + } - var context = canvas.getContext('2d'); + // flag the graphics as not dirty as we are about to update it... + webGL.dirty = graphics.dirty; - context.fillStyle = 'white'; - context.fillRect(0, 0, 10, 10); + // if the user cleared the graphics object we will need to clear every object + if (graphics.clearDirty !== webGL.clearDirty) { + webGL.clearDirty = graphics.clearDirty; - Graphics._SPRITE_TEXTURE = _Texture2.default.fromCanvas(canvas); + // loop through and return all the webGLDatas to the object pool so than can be reused later on + for (var i = 0; i < webGL.data.length; i++) { + this.graphicsDataPool.push(webGL.data[i]); } - this._spriteRect = new _Sprite2.default(Graphics._SPRITE_TEXTURE); + // clear the array and reset the index.. + webGL.data.length = 0; + webGL.lastIndex = 0; } - if (this.tint === 0xffffff) { - this._spriteRect.tint = this.graphicsData[0].fillColor; - } else { - var t1 = tempColor1; - var t2 = tempColor2; - - (0, _utils.hex2rgb)(this.graphicsData[0].fillColor, t1); - (0, _utils.hex2rgb)(this.tint, t2); - t1[0] *= t2[0]; - t1[1] *= t2[1]; - t1[2] *= t2[2]; + var webGLData = void 0; + var webGLDataNativeLines = void 0; - this._spriteRect.tint = (0, _utils.rgb2hex)(t1); - } - this._spriteRect.alpha = this.graphicsData[0].fillAlpha; - this._spriteRect.worldAlpha = this.worldAlpha * this._spriteRect.alpha; + // loop through the graphics datas and construct each one.. + // if the object is a complex fill then the new stencil buffer technique will be used + // other wise graphics objects will be pushed into a batch.. + for (var _i = webGL.lastIndex; _i < graphics.graphicsData.length; _i++) { + var data = graphics.graphicsData[_i]; - Graphics._SPRITE_TEXTURE._frame.width = rect.width; - Graphics._SPRITE_TEXTURE._frame.height = rect.height; + // TODO - this can be simplified + webGLData = this.getWebGLData(webGL, 0); - this._spriteRect.transform.worldTransform = this.transform.worldTransform; + if (data.nativeLines && data.lineWidth) { + webGLDataNativeLines = this.getWebGLData(webGL, 0, true); + webGL.lastIndex++; + } - this._spriteRect.anchor.set(-rect.x / rect.width, -rect.y / rect.height); - this._spriteRect._onAnchorUpdate(); + if (data.type === _const.SHAPES.POLY) { + (0, _buildPoly2.default)(data, webGLData, webGLDataNativeLines); + } + if (data.type === _const.SHAPES.RECT) { + (0, _buildRectangle2.default)(data, webGLData, webGLDataNativeLines); + } else if (data.type === _const.SHAPES.CIRC || data.type === _const.SHAPES.ELIP) { + (0, _buildCircle2.default)(data, webGLData, webGLDataNativeLines); + } else if (data.type === _const.SHAPES.RREC) { + (0, _buildRoundedRectangle2.default)(data, webGLData, webGLDataNativeLines); + } - this._spriteRect._renderWebGL(renderer); - }; + webGL.lastIndex++; + } - /** - * Renders the object using the Canvas renderer - * - * @private - * @param {PIXI.CanvasRenderer} renderer - The renderer - */ + this.renderer.bindVao(null); + // upload all the dirty data... + for (var _i2 = 0; _i2 < webGL.data.length; _i2++) { + webGLData = webGL.data[_i2]; - Graphics.prototype._renderCanvas = function _renderCanvas(renderer) { - if (this.isMask === true) { - return; + if (webGLData.dirty) { + webGLData.upload(); + } } - - renderer.plugins.graphics.render(this); }; /** - * Retrieves the bounds of the graphic shape as a rectangle object * * @private + * @param {WebGLRenderingContext} gl - the current WebGL drawing context + * @param {number} type - TODO @Alvin + * @param {number} nativeLines - indicate whether the webGLData use for nativeLines. + * @return {*} TODO */ - Graphics.prototype._calculateBounds = function _calculateBounds() { - if (this.boundsDirty !== this.dirty) { - this.boundsDirty = this.dirty; - this.updateLocalBounds(); + GraphicsRenderer.prototype.getWebGLData = function getWebGLData(gl, type, nativeLines) { + var webGLData = gl.data[gl.data.length - 1]; - this.cachedSpriteDirty = true; + if (!webGLData || webGLData.nativeLines !== nativeLines || webGLData.points.length > 320000) { + webGLData = this.graphicsDataPool.pop() || new _WebGLGraphicsData2.default(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState); + webGLData.nativeLines = nativeLines; + webGLData.reset(type); + gl.data.push(webGLData); } - var lb = this._localBounds; + webGLData.dirty = true; - this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY); + return webGLData; }; - /** - * Tests if a point is inside this graphics object - * - * @param {PIXI.Point} point - the point to test - * @return {boolean} the result of the test - */ + return GraphicsRenderer; +}(_ObjectRenderer3.default); +exports.default = GraphicsRenderer; - Graphics.prototype.containsPoint = function containsPoint(point) { - this.worldTransform.applyInverse(point, tempPoint); - var graphicsData = this.graphicsData; +_WebGLRenderer2.default.registerPlugin('graphics', GraphicsRenderer); +//# sourceMappingURL=GraphicsRenderer.js.map - for (var i = 0; i < graphicsData.length; ++i) { - var data = graphicsData[i]; +/***/ }), +/* 524 */ +/***/ (function(module, exports, __webpack_require__) { - if (!data.fill) { - continue; - } +"use strict"; - // only deal with fills.. - if (data.shape) { - if (data.shape.contains(tempPoint.x, tempPoint.y)) { - return true; - } - } - } - return false; - }; +exports.__esModule = true; + +var _pixiGlCore = __webpack_require__(15); + +var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * An object containing WebGL specific properties to be used by the WebGL renderer + * + * @class + * @private + * @memberof PIXI + */ +var WebGLGraphicsData = function () { + /** + * @param {WebGLRenderingContext} gl - The current WebGL drawing context + * @param {PIXI.Shader} shader - The shader + * @param {object} attribsState - The state for the VAO + */ + function WebGLGraphicsData(gl, shader, attribsState) { + _classCallCheck(this, WebGLGraphicsData); /** - * Update the bounds of the object + * The current WebGL drawing context * + * @member {WebGLRenderingContext} */ + this.gl = gl; + // TODO does this need to be split before uploading?? + /** + * An array of color components (r,g,b) + * @member {number[]} + */ + this.color = [0, 0, 0]; // color split! - Graphics.prototype.updateLocalBounds = function updateLocalBounds() { - var minX = Infinity; - var maxX = -Infinity; + /** + * An array of points to draw + * @member {PIXI.Point[]} + */ + this.points = []; - var minY = Infinity; - var maxY = -Infinity; + /** + * The indices of the vertices + * @member {number[]} + */ + this.indices = []; + /** + * The main buffer + * @member {WebGLBuffer} + */ + this.buffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl); - if (this.graphicsData.length) { - var shape = 0; - var x = 0; - var y = 0; - var w = 0; - var h = 0; + /** + * The index buffer + * @member {WebGLBuffer} + */ + this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl); - for (var i = 0; i < this.graphicsData.length; i++) { - var data = this.graphicsData[i]; - var type = data.type; - var lineWidth = data.lineWidth; + /** + * Whether this graphics is dirty or not + * @member {boolean} + */ + this.dirty = true; - shape = data.shape; + /** + * Whether this graphics is nativeLines or not + * @member {boolean} + */ + this.nativeLines = false; - if (type === _const.SHAPES.RECT || type === _const.SHAPES.RREC) { - x = shape.x - lineWidth / 2; - y = shape.y - lineWidth / 2; - w = shape.width + lineWidth; - h = shape.height + lineWidth; + this.glPoints = null; + this.glIndices = null; - minX = x < minX ? x : minX; - maxX = x + w > maxX ? x + w : maxX; + /** + * + * @member {PIXI.Shader} + */ + this.shader = shader; - minY = y < minY ? y : minY; - maxY = y + h > maxY ? y + h : maxY; - } else if (type === _const.SHAPES.CIRC) { - x = shape.x; - y = shape.y; - w = shape.radius + lineWidth / 2; - h = shape.radius + lineWidth / 2; + this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, attribsState).addIndex(this.indexBuffer).addAttribute(this.buffer, shader.attributes.aVertexPosition, gl.FLOAT, false, 4 * 6, 0).addAttribute(this.buffer, shader.attributes.aColor, gl.FLOAT, false, 4 * 6, 2 * 4); + } - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; + /** + * Resets the vertices and the indices + */ - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } else if (type === _const.SHAPES.ELIP) { - x = shape.x; - y = shape.y; - w = shape.width + lineWidth / 2; - h = shape.height + lineWidth / 2; - minX = x - w < minX ? x - w : minX; - maxX = x + w > maxX ? x + w : maxX; + WebGLGraphicsData.prototype.reset = function reset() { + this.points.length = 0; + this.indices.length = 0; + }; - minY = y - h < minY ? y - h : minY; - maxY = y + h > maxY ? y + h : maxY; - } else { - // POLY - var points = shape.points; - var x2 = 0; - var y2 = 0; - var dx = 0; - var dy = 0; - var rw = 0; - var rh = 0; - var cx = 0; - var cy = 0; + /** + * Binds the buffers and uploads the data + */ - for (var j = 0; j + 2 < points.length; j += 2) { - x = points[j]; - y = points[j + 1]; - x2 = points[j + 2]; - y2 = points[j + 3]; - dx = Math.abs(x2 - x); - dy = Math.abs(y2 - y); - h = lineWidth; - w = Math.sqrt(dx * dx + dy * dy); - if (w < 1e-9) { - continue; - } + WebGLGraphicsData.prototype.upload = function upload() { + this.glPoints = new Float32Array(this.points); + this.buffer.upload(this.glPoints); - rw = (h / w * dy + dx) / 2; - rh = (h / w * dx + dy) / 2; - cx = (x2 + x) / 2; - cy = (y2 + y) / 2; + this.glIndices = new Uint16Array(this.indices); + this.indexBuffer.upload(this.glIndices); - minX = cx - rw < minX ? cx - rw : minX; - maxX = cx + rw > maxX ? cx + rw : maxX; + this.dirty = false; + }; - minY = cy - rh < minY ? cy - rh : minY; - maxY = cy + rh > maxY ? cy + rh : maxY; - } - } - } - } else { - minX = 0; - maxX = 0; - minY = 0; - maxY = 0; - } + /** + * Empties all the data + */ - var padding = this.boundsPadding; - this._localBounds.minX = minX - padding; - this._localBounds.maxX = maxX + padding * 2; + WebGLGraphicsData.prototype.destroy = function destroy() { + this.color = null; + this.points = null; + this.indices = null; - this._localBounds.minY = minY - padding; - this._localBounds.maxY = maxY + padding * 2; - }; + this.vao.destroy(); + this.buffer.destroy(); + this.indexBuffer.destroy(); - /** - * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon. - * - * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw. - * @return {PIXI.GraphicsData} The generated GraphicsData object. - */ + this.gl = null; + this.buffer = null; + this.indexBuffer = null; - Graphics.prototype.drawShape = function drawShape(shape) { - if (this.currentPath) { - // check current path! - if (this.currentPath.shape.points.length <= 2) { - this.graphicsData.pop(); - } - } + this.glPoints = null; + this.glIndices = null; + }; - this.currentPath = null; + return WebGLGraphicsData; +}(); - var data = new _GraphicsData2.default(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, shape); +exports.default = WebGLGraphicsData; +//# sourceMappingURL=WebGLGraphicsData.js.map - this.graphicsData.push(data); +/***/ }), +/* 525 */ +/***/ (function(module, exports, __webpack_require__) { - if (data.type === _const.SHAPES.POLY) { - data.shape.closed = data.shape.closed || this.filling; - this.currentPath = data; - } +"use strict"; - this.dirty++; - return data; - }; +exports.__esModule = true; - /** - * Generates a canvas texture. - * - * @param {number} scaleMode - The scale mode of the texture. - * @param {number} resolution - The resolution of the texture. - * @return {PIXI.Texture} The new texture. - */ +var _Shader2 = __webpack_require__(54); +var _Shader3 = _interopRequireDefault(_Shader2); - Graphics.prototype.generateCanvasTexture = function generateCanvasTexture(scaleMode) { - var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var bounds = this.getLocalBounds(); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var canvasBuffer = _RenderTexture2.default.create(bounds.width, bounds.height, scaleMode, resolution); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - if (!canvasRenderer) { - canvasRenderer = new _CanvasRenderer2.default(); - } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - tempMatrix.tx = -bounds.x; - tempMatrix.ty = -bounds.y; +/** + * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. + * + * @class + * @memberof PIXI + * @extends PIXI.Shader + */ +var PrimitiveShader = function (_Shader) { + _inherits(PrimitiveShader, _Shader); - canvasRenderer.render(this, canvasBuffer, false, tempMatrix); + /** + * @param {WebGLRenderingContext} gl - The webgl shader manager this shader works for. + */ + function PrimitiveShader(gl) { + _classCallCheck(this, PrimitiveShader); - var texture = _Texture2.default.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode); + return _possibleConstructorReturn(this, _Shader.call(this, gl, + // vertex shader + ['attribute vec2 aVertexPosition;', 'attribute vec4 aColor;', 'uniform mat3 translationMatrix;', 'uniform mat3 projectionMatrix;', 'uniform float alpha;', 'uniform vec3 tint;', 'varying vec4 vColor;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vColor = aColor * vec4(tint * alpha, alpha);', '}'].join('\n'), + // fragment shader + ['varying vec4 vColor;', 'void main(void){', ' gl_FragColor = vColor;', '}'].join('\n'))); + } - texture.baseTexture.resolution = resolution; - texture.baseTexture.update(); + return PrimitiveShader; +}(_Shader3.default); - return texture; - }; +exports.default = PrimitiveShader; +//# sourceMappingURL=PrimitiveShader.js.map - /** - * Closes the current path. - * - * @return {PIXI.Graphics} Returns itself. - */ +/***/ }), +/* 526 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; - Graphics.prototype.closePath = function closePath() { - // ok so close path assumes next one is a hole! - var currentPath = this.currentPath; - if (currentPath && currentPath.shape) { - currentPath.shape.close(); - } +exports.__esModule = true; +exports.default = buildCircle; - return this; - }; +var _buildLine = __webpack_require__(80); - /** - * Adds a hole in the current path. - * - * @return {PIXI.Graphics} Returns itself. - */ +var _buildLine2 = _interopRequireDefault(_buildLine); +var _const = __webpack_require__(0); - Graphics.prototype.addHole = function addHole() { - // this is a hole! - var hole = this.graphicsData.pop(); +var _utils = __webpack_require__(3); - this.currentPath = this.graphicsData[this.graphicsData.length - 1]; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - this.currentPath.addHole(hole.shape); - this.currentPath = null; +/** + * Builds a circle to draw + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw + * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines + */ +function buildCircle(graphicsData, webGLData, webGLDataNativeLines) { + // need to convert points to a nice regular data + var circleData = graphicsData.shape; + var x = circleData.x; + var y = circleData.y; + var width = void 0; + var height = void 0; - return this; - }; + // TODO - bit hacky?? + if (graphicsData.type === _const.SHAPES.CIRC) { + width = circleData.radius; + height = circleData.radius; + } else { + width = circleData.width; + height = circleData.height; + } - /** - * Destroys the Graphics object. - * - * @param {object|boolean} [options] - Options parameter. A boolean will act as if all - * options have been set to that value - * @param {boolean} [options.children=false] - if set to true, all the children will have - * their destroy method called as well. 'options' will be passed on to those calls. - * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true - * Should it destroy the texture of the child sprite - * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true - * Should it destroy the base texture of the child sprite - */ + if (width === 0 || height === 0) { + return; + } + + var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) || Math.floor(15 * Math.sqrt(circleData.width + circleData.height)); + + var seg = Math.PI * 2 / totalSegs; + if (graphicsData.fill) { + var color = (0, _utils.hex2rgb)(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; - Graphics.prototype.destroy = function destroy(options) { - _Container.prototype.destroy.call(this, options); + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; - // destroy each of the GraphicsData objects - for (var i = 0; i < this.graphicsData.length; ++i) { - this.graphicsData[i].destroy(); - } + var verts = webGLData.points; + var indices = webGLData.indices; - // for each webgl data entry, destroy the WebGLGraphicsData - for (var id in this._webgl) { - for (var j = 0; j < this._webgl[id].data.length; ++j) { - this._webgl[id].data[j].destroy(); - } - } + var vecPos = verts.length / 6; - if (this._spriteRect) { - this._spriteRect.destroy(); + indices.push(vecPos); + + for (var i = 0; i < totalSegs + 1; i++) { + verts.push(x, y, r, g, b, alpha); + + verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha); + + indices.push(vecPos++, vecPos++); } - this.graphicsData = null; + indices.push(vecPos - 1); + } - this.currentPath = null; - this._webgl = null; - this._localBounds = null; - }; + if (graphicsData.lineWidth) { + var tempPoints = graphicsData.points; - return Graphics; -}(_Container3.default); + graphicsData.points = []; -exports.default = Graphics; + for (var _i = 0; _i < totalSegs + 1; _i++) { + graphicsData.points.push(x + Math.sin(seg * _i) * width, y + Math.cos(seg * _i) * height); + } + (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines); -Graphics._SPRITE_TEXTURE = null; -//# sourceMappingURL=Graphics.js.map + graphicsData.points = tempPoints; + } +} +//# sourceMappingURL=buildCircle.js.map /***/ }), -/* 523 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; +exports.default = buildPoly; -var _CanvasRenderer = __webpack_require__(54); +var _buildLine = __webpack_require__(80); -var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); +var _buildLine2 = _interopRequireDefault(_buildLine); -var _const = __webpack_require__(2); +var _utils = __webpack_require__(3); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _earcut = __webpack_require__(139); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _earcut2 = _interopRequireDefault(_earcut); -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they - * now share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's CanvasGraphicsRenderer: - * https://github.com/libgdx/libgdx/blob/1.0.0/gdx/src/com/badlogic/gdx/graphics/glutils/ShapeRenderer.java - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** - * Renderer dedicated to drawing and batching graphics objects. + * Builds a polygon to draw * - * @class + * Ignored from docs since it is not directly exposed. + * + * @ignore * @private - * @memberof PIXI + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines */ -var CanvasGraphicsRenderer = function () { - /** - * @param {PIXI.CanvasRenderer} renderer - The current PIXI renderer. - */ - function CanvasGraphicsRenderer(renderer) { - _classCallCheck(this, CanvasGraphicsRenderer); - - this.renderer = renderer; - } - - /** - * Renders a Graphics object to a canvas. - * - * @param {PIXI.Graphics} graphics - the actual graphics object to render - */ +function buildPoly(graphicsData, webGLData, webGLDataNativeLines) { + graphicsData.points = graphicsData.shape.points.slice(); + var points = graphicsData.points; - CanvasGraphicsRenderer.prototype.render = function render(graphics) { - var renderer = this.renderer; - var context = renderer.context; - var worldAlpha = graphics.worldAlpha; - var transform = graphics.transform.worldTransform; - var resolution = renderer.resolution; + if (graphicsData.fill && points.length >= 6) { + var holeArray = []; + // Process holes.. + var holes = graphicsData.holes; - // if the tint has changed, set the graphics object to dirty. - if (this._prevTint !== this.tint) { - this.dirty = true; - } + for (var i = 0; i < holes.length; i++) { + var hole = holes[i]; - context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution); + holeArray.push(points.length / 2); - if (graphics.dirty) { - this.updateGraphicsTint(graphics); - graphics.dirty = false; + points = points.concat(hole.points); } - renderer.setBlendMode(graphics.blendMode); - - for (var i = 0; i < graphics.graphicsData.length; i++) { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - var fillColor = data._fillTint; - var lineColor = data._lineTint; - - context.lineWidth = data.lineWidth; + // get first and last point.. figure out the middle! + var verts = webGLData.points; + var indices = webGLData.indices; - if (data.type === _const.SHAPES.POLY) { - context.beginPath(); + var length = points.length / 2; - this.renderPolygon(shape.points, shape.closed, context); + // sort color + var color = (0, _utils.hex2rgb)(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; - for (var j = 0; j < data.holes.length; j++) { - this.renderPolygon(data.holes[j].points, true, context); - } + var triangles = (0, _earcut2.default)(points, holeArray, 2); - if (data.fill) { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if (data.lineWidth) { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } else if (data.type === _const.SHAPES.RECT) { - if (data.fillColor || data.fillColor === 0) { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); - context.fillRect(shape.x, shape.y, shape.width, shape.height); - } - if (data.lineWidth) { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); - context.strokeRect(shape.x, shape.y, shape.width, shape.height); - } - } else if (data.type === _const.SHAPES.CIRC) { - // TODO - need to be Undefined! - context.beginPath(); - context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI); - context.closePath(); + if (!triangles) { + return; + } - if (data.fill) { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if (data.lineWidth) { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } else if (data.type === _const.SHAPES.ELIP) { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas + var vertPos = verts.length / 6; - var w = shape.width * 2; - var h = shape.height * 2; + for (var _i = 0; _i < triangles.length; _i += 3) { + indices.push(triangles[_i] + vertPos); + indices.push(triangles[_i] + vertPos); + indices.push(triangles[_i + 1] + vertPos); + indices.push(triangles[_i + 2] + vertPos); + indices.push(triangles[_i + 2] + vertPos); + } - var x = shape.x - w / 2; - var y = shape.y - h / 2; + for (var _i2 = 0; _i2 < length; _i2++) { + verts.push(points[_i2 * 2], points[_i2 * 2 + 1], r, g, b, alpha); + } + } - context.beginPath(); + if (graphicsData.lineWidth > 0) { + (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines); + } +} +//# sourceMappingURL=buildPoly.js.map - var kappa = 0.5522848; - var ox = w / 2 * kappa; // control point offset horizontal - var oy = h / 2 * kappa; // control point offset vertical - var xe = x + w; // x-end - var ye = y + h; // y-end - var xm = x + w / 2; // x-middle - var ym = y + h / 2; // y-middle +/***/ }), +/* 528 */ +/***/ (function(module, exports, __webpack_require__) { - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); +"use strict"; - context.closePath(); - if (data.fill) { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); - context.fill(); - } - if (data.lineWidth) { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } else if (data.type === _const.SHAPES.RREC) { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; +exports.__esModule = true; +exports.default = buildRectangle; - var maxRadius = Math.min(width, height) / 2 | 0; +var _buildLine = __webpack_require__(80); - radius = radius > maxRadius ? maxRadius : radius; +var _buildLine2 = _interopRequireDefault(_buildLine); - context.beginPath(); - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); +var _utils = __webpack_require__(3); - if (data.fillColor || data.fillColor === 0) { - context.globalAlpha = data.fillAlpha * worldAlpha; - context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6); - context.fill(); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - if (data.lineWidth) { - context.globalAlpha = data.lineAlpha * worldAlpha; - context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6); - context.stroke(); - } - } - } - }; +/** + * Builds a rectangle to draw + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines + */ +function buildRectangle(graphicsData, webGLData, webGLDataNativeLines) { + // --- // + // need to convert points to a nice regular data + // + var rectData = graphicsData.shape; + var x = rectData.x; + var y = rectData.y; + var width = rectData.width; + var height = rectData.height; - /** - * Updates the tint of a graphics object - * - * @private - * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated - */ + if (graphicsData.fill) { + var color = (0, _utils.hex2rgb)(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; - CanvasGraphicsRenderer.prototype.updateGraphicsTint = function updateGraphicsTint(graphics) { - graphics._prevTint = graphics.tint; + var verts = webGLData.points; + var indices = webGLData.indices; - var tintR = (graphics.tint >> 16 & 0xFF) / 255; - var tintG = (graphics.tint >> 8 & 0xFF) / 255; - var tintB = (graphics.tint & 0xFF) / 255; + var vertPos = verts.length / 6; - for (var i = 0; i < graphics.graphicsData.length; ++i) { - var data = graphics.graphicsData[i]; + // start + verts.push(x, y); + verts.push(r, g, b, alpha); - var fillColor = data.fillColor | 0; - var lineColor = data.lineColor | 0; + verts.push(x + width, y); + verts.push(r, g, b, alpha); - // super inline cos im an optimization NAZI :) - data._fillTint = ((fillColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (fillColor & 0xFF) / 255 * tintB * 255; + verts.push(x, y + height); + verts.push(r, g, b, alpha); - data._lineTint = ((lineColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (lineColor & 0xFF) / 255 * tintB * 255; - } - }; + verts.push(x + width, y + height); + verts.push(r, g, b, alpha); - /** - * Renders a polygon. - * - * @param {PIXI.Point[]} points - The points to render - * @param {boolean} close - Should the polygon be closed - * @param {CanvasRenderingContext2D} context - The rendering context to use - */ + // insert 2 dead triangles.. + indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3); + } + if (graphicsData.lineWidth) { + var tempPoints = graphicsData.points; - CanvasGraphicsRenderer.prototype.renderPolygon = function renderPolygon(points, close, context) { - context.moveTo(points[0], points[1]); + graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y]; - for (var j = 1; j < points.length / 2; ++j) { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } + (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines); - if (close) { - context.closePath(); - } - }; + graphicsData.points = tempPoints; + } +} +//# sourceMappingURL=buildRectangle.js.map - /** - * destroy graphics object - * - */ +/***/ }), +/* 529 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; - CanvasGraphicsRenderer.prototype.destroy = function destroy() { - this.renderer = null; - }; - return CanvasGraphicsRenderer; -}(); +exports.__esModule = true; +exports.default = buildRoundedRectangle; -exports.default = CanvasGraphicsRenderer; +var _earcut = __webpack_require__(139); +var _earcut2 = _interopRequireDefault(_earcut); -_CanvasRenderer2.default.registerPlugin('graphics', CanvasGraphicsRenderer); -//# sourceMappingURL=CanvasGraphicsRenderer.js.map +var _buildLine = __webpack_require__(80); -/***/ }), -/* 524 */ -/***/ (function(module, exports, __webpack_require__) { +var _buildLine2 = _interopRequireDefault(_buildLine); -"use strict"; +var _utils = __webpack_require__(3); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -exports.__esModule = true; -exports.default = bezierCurveTo; /** - * Calculate the points for a bezier curve and then draws it. + * Builds a rounded rectangle to draw * * Ignored from docs since it is not directly exposed. * * @ignore - * @param {number} fromX - Starting point x - * @param {number} fromY - Starting point y - * @param {number} cpX - Control point x - * @param {number} cpY - Control point y - * @param {number} cpX2 - Second Control point x - * @param {number} cpY2 - Second Control point y - * @param {number} toX - Destination point x - * @param {number} toY - Destination point y - * @param {number[]} [path=[]] - Path array to push points into - * @return {number[]} Array of points of the curve + * @private + * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties + * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines */ -function bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) { - var path = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : []; +function buildRoundedRectangle(graphicsData, webGLData, webGLDataNativeLines) { + var rrectData = graphicsData.shape; + var x = rrectData.x; + var y = rrectData.y; + var width = rrectData.width; + var height = rrectData.height; - var n = 20; - var dt = 0; - var dt2 = 0; - var dt3 = 0; - var t2 = 0; - var t3 = 0; + var radius = rrectData.radius; - path.push(fromX, fromY); + var recPoints = []; - for (var i = 1, j = 0; i <= n; ++i) { - j = i / n; + recPoints.push(x, y + radius); + quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints); + quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints); + quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints); + quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints); - dt = 1 - j; - dt2 = dt * dt; - dt3 = dt2 * dt; + // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item. + // TODO - fix this properly, this is not very elegant.. but it works for now. - t2 = j * j; - t3 = t2 * j; + if (graphicsData.fill) { + var color = (0, _utils.hex2rgb)(graphicsData.fillColor); + var alpha = graphicsData.fillAlpha; - path.push(dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY); - } + var r = color[0] * alpha; + var g = color[1] * alpha; + var b = color[2] * alpha; - return path; -} -//# sourceMappingURL=bezierCurveTo.js.map + var verts = webGLData.points; + var indices = webGLData.indices; -/***/ }), -/* 525 */ -/***/ (function(module, exports, __webpack_require__) { + var vecPos = verts.length / 6; -"use strict"; + var triangles = (0, _earcut2.default)(recPoints, null, 2); + + for (var i = 0, j = triangles.length; i < j; i += 3) { + indices.push(triangles[i] + vecPos); + indices.push(triangles[i] + vecPos); + indices.push(triangles[i + 1] + vecPos); + indices.push(triangles[i + 2] + vecPos); + indices.push(triangles[i + 2] + vecPos); + } + for (var _i = 0, _j = recPoints.length; _i < _j; _i++) { + verts.push(recPoints[_i], recPoints[++_i], r, g, b, alpha); + } + } -exports.__esModule = true; + if (graphicsData.lineWidth) { + var tempPoints = graphicsData.points; -var _utils = __webpack_require__(5); + graphicsData.points = recPoints; -var _const = __webpack_require__(2); + (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines); -var _ObjectRenderer2 = __webpack_require__(83); + graphicsData.points = tempPoints; + } +} -var _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2); +/** + * Calculate a single point for a quadratic bezier curve. + * Utility function used by quadraticBezierCurve. + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {number} n1 - first number + * @param {number} n2 - second number + * @param {number} perc - percentage + * @return {number} the result + * + */ +function getPt(n1, n2, perc) { + var diff = n2 - n1; -var _WebGLRenderer = __webpack_require__(82); + return n1 + diff * perc; +} -var _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer); +/** + * Calculate the points for a quadratic bezier curve. (helper function..) + * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c + * + * Ignored from docs since it is not directly exposed. + * + * @ignore + * @private + * @param {number} fromX - Origin point x + * @param {number} fromY - Origin point x + * @param {number} cpX - Control point x + * @param {number} cpY - Control point y + * @param {number} toX - Destination point x + * @param {number} toY - Destination point y + * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created. + * @return {number[]} an array of points + */ +function quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) { + var out = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : []; + + var n = 20; + var points = out; -var _WebGLGraphicsData = __webpack_require__(526); + var xa = 0; + var ya = 0; + var xb = 0; + var yb = 0; + var x = 0; + var y = 0; -var _WebGLGraphicsData2 = _interopRequireDefault(_WebGLGraphicsData); + for (var i = 0, j = 0; i <= n; ++i) { + j = i / n; + + // The Green Line + xa = getPt(fromX, cpX, j); + ya = getPt(fromY, cpY, j); + xb = getPt(cpX, toX, j); + yb = getPt(cpY, toY, j); -var _PrimitiveShader = __webpack_require__(527); + // The Black Dot + x = getPt(xa, xb, j); + y = getPt(ya, yb, j); -var _PrimitiveShader2 = _interopRequireDefault(_PrimitiveShader); + points.push(x, y); + } -var _buildPoly = __webpack_require__(529); + return points; +} +//# sourceMappingURL=buildRoundedRectangle.js.map -var _buildPoly2 = _interopRequireDefault(_buildPoly); +/***/ }), +/* 530 */ +/***/ (function(module, exports, __webpack_require__) { -var _buildRectangle = __webpack_require__(530); +"use strict"; -var _buildRectangle2 = _interopRequireDefault(_buildRectangle); -var _buildRoundedRectangle = __webpack_require__(531); +exports.__esModule = true; -var _buildRoundedRectangle2 = _interopRequireDefault(_buildRoundedRectangle); +var _Rectangle = __webpack_require__(127); -var _buildCircle = __webpack_require__(528); +var _Rectangle2 = _interopRequireDefault(_Rectangle); -var _buildCircle2 = _interopRequireDefault(_buildCircle); +var _const = __webpack_require__(0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - /** - * Renders the graphics object. + * The Circle object can be used to specify a hit area for displayObjects * * @class * @memberof PIXI - * @extends PIXI.ObjectRenderer */ -var GraphicsRenderer = function (_ObjectRenderer) { - _inherits(GraphicsRenderer, _ObjectRenderer); - - /** - * @param {PIXI.WebGLRenderer} renderer - The renderer this object renderer works for. - */ - function GraphicsRenderer(renderer) { - _classCallCheck(this, GraphicsRenderer); - - var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer)); - - _this.graphicsDataPool = []; - - _this.primitiveShader = null; - - _this.gl = renderer.gl; +var Circle = function () { + /** + * @param {number} [x=0] - The X coordinate of the center of this circle + * @param {number} [y=0] - The Y coordinate of the center of this circle + * @param {number} [radius=0] - The radius of the circle + */ + function Circle() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - // easy access! - _this.CONTEXT_UID = 0; - return _this; - } + _classCallCheck(this, Circle); /** - * Called when there is a WebGL context change - * - * @private - * + * @member {number} + * @default 0 */ - - - GraphicsRenderer.prototype.onContextChange = function onContextChange() { - this.gl = this.renderer.gl; - this.CONTEXT_UID = this.renderer.CONTEXT_UID; - this.primitiveShader = new _PrimitiveShader2.default(this.gl); - }; + this.x = x; /** - * Destroys this renderer. - * + * @member {number} + * @default 0 */ - - - GraphicsRenderer.prototype.destroy = function destroy() { - _ObjectRenderer3.default.prototype.destroy.call(this); - - for (var i = 0; i < this.graphicsDataPool.length; ++i) { - this.graphicsDataPool[i].destroy(); - } - - this.graphicsDataPool = null; - }; + this.y = y; /** - * Renders a graphics object. - * - * @param {PIXI.Graphics} graphics - The graphics object to render. + * @member {number} + * @default 0 */ - - - GraphicsRenderer.prototype.render = function render(graphics) { - var renderer = this.renderer; - var gl = renderer.gl; - - var webGLData = void 0; - var webGL = graphics._webGL[this.CONTEXT_UID]; - - if (!webGL || graphics.dirty !== webGL.dirty) { - this.updateGraphics(graphics); - - webGL = graphics._webGL[this.CONTEXT_UID]; - } - - // This could be speeded up for sure! - var shader = this.primitiveShader; - - renderer.bindShader(shader); - renderer.state.setBlendMode(graphics.blendMode); - - for (var i = 0, n = webGL.data.length; i < n; i++) { - webGLData = webGL.data[i]; - var shaderTemp = webGLData.shader; - - renderer.bindShader(shaderTemp); - shaderTemp.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true); - shaderTemp.uniforms.tint = (0, _utils.hex2rgb)(graphics.tint); - shaderTemp.uniforms.alpha = graphics.worldAlpha; - - renderer.bindVao(webGLData.vao); - webGLData.vao.draw(gl.TRIANGLE_STRIP, webGLData.indices.length); - } - }; + this.radius = radius; /** - * Updates the graphics object + * The type of the object, mainly used to avoid `instanceof` checks * - * @private - * @param {PIXI.Graphics} graphics - The graphics object to update + * @member {number} + * @readOnly + * @default PIXI.SHAPES.CIRC + * @see PIXI.SHAPES */ + this.type = _const.SHAPES.CIRC; + } + /** + * Creates a clone of this Circle instance + * + * @return {PIXI.Circle} a copy of the Circle + */ - GraphicsRenderer.prototype.updateGraphics = function updateGraphics(graphics) { - var gl = this.renderer.gl; - - // get the contexts graphics object - var webGL = graphics._webGL[this.CONTEXT_UID]; - - // if the graphics object does not exist in the webGL context time to create it! - if (!webGL) { - webGL = graphics._webGL[this.CONTEXT_UID] = { lastIndex: 0, data: [], gl: gl, clearDirty: -1, dirty: -1 }; - } - - // flag the graphics as not dirty as we are about to update it... - webGL.dirty = graphics.dirty; - - // if the user cleared the graphics object we will need to clear every object - if (graphics.clearDirty !== webGL.clearDirty) { - webGL.clearDirty = graphics.clearDirty; - - // loop through and return all the webGLDatas to the object pool so than can be reused later on - for (var i = 0; i < webGL.data.length; i++) { - this.graphicsDataPool.push(webGL.data[i]); - } - - // clear the array and reset the index.. - webGL.data.length = 0; - webGL.lastIndex = 0; - } - - var webGLData = void 0; - - // loop through the graphics datas and construct each one.. - // if the object is a complex fill then the new stencil buffer technique will be used - // other wise graphics objects will be pushed into a batch.. - for (var _i = webGL.lastIndex; _i < graphics.graphicsData.length; _i++) { - var data = graphics.graphicsData[_i]; - - // TODO - this can be simplified - webGLData = this.getWebGLData(webGL, 0); - - if (data.type === _const.SHAPES.POLY) { - (0, _buildPoly2.default)(data, webGLData); - } - if (data.type === _const.SHAPES.RECT) { - (0, _buildRectangle2.default)(data, webGLData); - } else if (data.type === _const.SHAPES.CIRC || data.type === _const.SHAPES.ELIP) { - (0, _buildCircle2.default)(data, webGLData); - } else if (data.type === _const.SHAPES.RREC) { - (0, _buildRoundedRectangle2.default)(data, webGLData); - } - - webGL.lastIndex++; - } - - this.renderer.bindVao(null); - - // upload all the dirty data... - for (var _i2 = 0; _i2 < webGL.data.length; _i2++) { - webGLData = webGL.data[_i2]; - if (webGLData.dirty) { - webGLData.upload(); - } - } - }; + Circle.prototype.clone = function clone() { + return new Circle(this.x, this.y, this.radius); + }; - /** - * - * @private - * @param {WebGLRenderingContext} gl - the current WebGL drawing context - * @param {number} type - TODO @Alvin - * @return {*} TODO - */ + /** + * Checks whether the x and y coordinates given are contained within this circle + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this Circle + */ - GraphicsRenderer.prototype.getWebGLData = function getWebGLData(gl, type) { - var webGLData = gl.data[gl.data.length - 1]; + Circle.prototype.contains = function contains(x, y) { + if (this.radius <= 0) { + return false; + } - if (!webGLData || webGLData.points.length > 320000) { - webGLData = this.graphicsDataPool.pop() || new _WebGLGraphicsData2.default(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState); + var r2 = this.radius * this.radius; + var dx = this.x - x; + var dy = this.y - y; - webGLData.reset(type); - gl.data.push(webGLData); - } + dx *= dx; + dy *= dy; - webGLData.dirty = true; + return dx + dy <= r2; + }; - return webGLData; - }; + /** + * Returns the framing rectangle of the circle as a Rectangle object + * + * @return {PIXI.Rectangle} the framing rectangle + */ - return GraphicsRenderer; -}(_ObjectRenderer3.default); -exports.default = GraphicsRenderer; + Circle.prototype.getBounds = function getBounds() { + return new _Rectangle2.default(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); + }; + return Circle; +}(); -_WebGLRenderer2.default.registerPlugin('graphics', GraphicsRenderer); -//# sourceMappingURL=GraphicsRenderer.js.map +exports.default = Circle; +//# sourceMappingURL=Circle.js.map /***/ }), -/* 526 */ +/* 531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55012,141 +57979,126 @@ _WebGLRenderer2.default.registerPlugin('graphics', GraphicsRenderer); exports.__esModule = true; -var _pixiGlCore = __webpack_require__(15); +var _Rectangle = __webpack_require__(127); -var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); +var _Rectangle2 = _interopRequireDefault(_Rectangle); + +var _const = __webpack_require__(0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * An object containing WebGL specific properties to be used by the WebGL renderer + * The Ellipse object can be used to specify a hit area for displayObjects * * @class - * @private * @memberof PIXI */ -var WebGLGraphicsData = function () { +var Ellipse = function () { /** - * @param {WebGLRenderingContext} gl - The current WebGL drawing context - * @param {PIXI.Shader} shader - The shader - * @param {object} attribsState - The state for the VAO + * @param {number} [x=0] - The X coordinate of the center of this circle + * @param {number} [y=0] - The Y coordinate of the center of this circle + * @param {number} [width=0] - The half width of this ellipse + * @param {number} [height=0] - The half height of this ellipse */ - function WebGLGraphicsData(gl, shader, attribsState) { - _classCallCheck(this, WebGLGraphicsData); - - /** - * The current WebGL drawing context - * - * @member {WebGLRenderingContext} - */ - this.gl = gl; + function Ellipse() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - // TODO does this need to be split before uploading?? - /** - * An array of color components (r,g,b) - * @member {number[]} - */ - this.color = [0, 0, 0]; // color split! + _classCallCheck(this, Ellipse); /** - * An array of points to draw - * @member {PIXI.Point[]} + * @member {number} + * @default 0 */ - this.points = []; + this.x = x; /** - * The indices of the vertices - * @member {number[]} - */ - this.indices = []; - /** - * The main buffer - * @member {WebGLBuffer} + * @member {number} + * @default 0 */ - this.buffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl); + this.y = y; /** - * The index buffer - * @member {WebGLBuffer} + * @member {number} + * @default 0 */ - this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl); + this.width = width; /** - * Whether this graphics is dirty or not - * @member {boolean} + * @member {number} + * @default 0 */ - this.dirty = true; - - this.glPoints = null; - this.glIndices = null; + this.height = height; /** + * The type of the object, mainly used to avoid `instanceof` checks * - * @member {PIXI.Shader} + * @member {number} + * @readOnly + * @default PIXI.SHAPES.ELIP + * @see PIXI.SHAPES */ - this.shader = shader; - - this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, attribsState).addIndex(this.indexBuffer).addAttribute(this.buffer, shader.attributes.aVertexPosition, gl.FLOAT, false, 4 * 6, 0).addAttribute(this.buffer, shader.attributes.aColor, gl.FLOAT, false, 4 * 6, 2 * 4); + this.type = _const.SHAPES.ELIP; } /** - * Resets the vertices and the indices + * Creates a clone of this Ellipse instance + * + * @return {PIXI.Ellipse} a copy of the ellipse */ - WebGLGraphicsData.prototype.reset = function reset() { - this.points.length = 0; - this.indices.length = 0; + Ellipse.prototype.clone = function clone() { + return new Ellipse(this.x, this.y, this.width, this.height); }; /** - * Binds the buffers and uploads the data + * Checks whether the x and y coordinates given are contained within this ellipse + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coords are within this ellipse */ - WebGLGraphicsData.prototype.upload = function upload() { - this.glPoints = new Float32Array(this.points); - this.buffer.upload(this.glPoints); + Ellipse.prototype.contains = function contains(x, y) { + if (this.width <= 0 || this.height <= 0) { + return false; + } - this.glIndices = new Uint16Array(this.indices); - this.indexBuffer.upload(this.glIndices); + // normalize the coords to an ellipse with center 0,0 + var normx = (x - this.x) / this.width; + var normy = (y - this.y) / this.height; - this.dirty = false; + normx *= normx; + normy *= normy; + + return normx + normy <= 1; }; /** - * Empties all the data + * Returns the framing rectangle of the ellipse as a Rectangle object + * + * @return {PIXI.Rectangle} the framing rectangle */ - WebGLGraphicsData.prototype.destroy = function destroy() { - this.color = null; - this.points = null; - this.indices = null; - - this.vao.destroy(); - this.buffer.destroy(); - this.indexBuffer.destroy(); - - this.gl = null; - - this.buffer = null; - this.indexBuffer = null; - - this.glPoints = null; - this.glIndices = null; + Ellipse.prototype.getBounds = function getBounds() { + return new _Rectangle2.default(this.x - this.width, this.y - this.height, this.width, this.height); }; - return WebGLGraphicsData; + return Ellipse; }(); -exports.default = WebGLGraphicsData; -//# sourceMappingURL=WebGLGraphicsData.js.map +exports.default = Ellipse; +//# sourceMappingURL=Ellipse.js.map /***/ }), -/* 527 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55154,459 +58106,524 @@ exports.default = WebGLGraphicsData; exports.__esModule = true; -var _Shader2 = __webpack_require__(52); +var _Point = __webpack_require__(126); -var _Shader3 = _interopRequireDefault(_Shader2); +var _Point2 = _interopRequireDefault(_Point); + +var _const = __webpack_require__(0); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - /** - * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}. - * * @class * @memberof PIXI - * @extends PIXI.Shader */ -var PrimitiveShader = function (_Shader) { - _inherits(PrimitiveShader, _Shader); - +var Polygon = function () { /** - * @param {WebGLRenderingContext} gl - The webgl shader manager this shader works for. + * @param {PIXI.Point[]|number[]} points - This can be an array of Points + * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or + * the arguments passed can be all the points of the polygon e.g. + * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat + * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers. */ - function PrimitiveShader(gl) { - _classCallCheck(this, PrimitiveShader); - - return _possibleConstructorReturn(this, _Shader.call(this, gl, - // vertex shader - ['attribute vec2 aVertexPosition;', 'attribute vec4 aColor;', 'uniform mat3 translationMatrix;', 'uniform mat3 projectionMatrix;', 'uniform float alpha;', 'uniform vec3 tint;', 'varying vec4 vColor;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vColor = aColor * vec4(tint * alpha, alpha);', '}'].join('\n'), - // fragment shader - ['varying vec4 vColor;', 'void main(void){', ' gl_FragColor = vColor;', '}'].join('\n'))); - } - - return PrimitiveShader; -}(_Shader3.default); - -exports.default = PrimitiveShader; -//# sourceMappingURL=PrimitiveShader.js.map - -/***/ }), -/* 528 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - + function Polygon() { + for (var _len = arguments.length, points = Array(_len), _key = 0; _key < _len; _key++) { + points[_key] = arguments[_key]; + } -exports.__esModule = true; -exports.default = buildCircle; + _classCallCheck(this, Polygon); -var _buildLine = __webpack_require__(81); + if (Array.isArray(points[0])) { + points = points[0]; + } -var _buildLine2 = _interopRequireDefault(_buildLine); + // if this is an array of points, convert it to a flat array of numbers + if (points[0] instanceof _Point2.default) { + var p = []; -var _const = __webpack_require__(2); + for (var i = 0, il = points.length; i < il; i++) { + p.push(points[i].x, points[i].y); + } -var _utils = __webpack_require__(5); + points = p; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + this.closed = true; -/** - * Builds a circle to draw - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw - * @param {object} webGLData - an object containing all the webGL-specific information to create this shape - */ -function buildCircle(graphicsData, webGLData) { - // need to convert points to a nice regular data - var circleData = graphicsData.shape; - var x = circleData.x; - var y = circleData.y; - var width = void 0; - var height = void 0; + /** + * An array of the points of this polygon + * + * @member {number[]} + */ + this.points = points; - // TODO - bit hacky?? - if (graphicsData.type === _const.SHAPES.CIRC) { - width = circleData.radius; - height = circleData.radius; - } else { - width = circleData.width; - height = circleData.height; + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readOnly + * @default PIXI.SHAPES.POLY + * @see PIXI.SHAPES + */ + this.type = _const.SHAPES.POLY; } - var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) || Math.floor(15 * Math.sqrt(circleData.width + circleData.height)); - - var seg = Math.PI * 2 / totalSegs; - - if (graphicsData.fill) { - var color = (0, _utils.hex2rgb)(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; + /** + * Creates a clone of this polygon + * + * @return {PIXI.Polygon} a copy of the polygon + */ - var verts = webGLData.points; - var indices = webGLData.indices; - var vecPos = verts.length / 6; + Polygon.prototype.clone = function clone() { + return new Polygon(this.points.slice()); + }; - indices.push(vecPos); + /** + * Closes the polygon, adding points if necessary. + * + */ - for (var i = 0; i < totalSegs + 1; i++) { - verts.push(x, y, r, g, b, alpha); - verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha); + Polygon.prototype.close = function close() { + var points = this.points; - indices.push(vecPos++, vecPos++); + // close the poly if the value is true! + if (points[0] !== points[points.length - 2] || points[1] !== points[points.length - 1]) { + points.push(points[0], points[1]); } + }; - indices.push(vecPos - 1); - } + /** + * Checks whether the x and y coordinates passed to this function are contained within this polygon + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this polygon + */ - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - graphicsData.points = []; + Polygon.prototype.contains = function contains(x, y) { + var inside = false; - for (var _i = 0; _i < totalSegs + 1; _i++) { - graphicsData.points.push(x + Math.sin(seg * _i) * width, y + Math.cos(seg * _i) * height); + // use some raycasting to test hits + // https://github.com/substack/point-in-polygon/blob/master/index.js + var length = this.points.length / 2; + + for (var i = 0, j = length - 1; i < length; j = i++) { + var xi = this.points[i * 2]; + var yi = this.points[i * 2 + 1]; + var xj = this.points[j * 2]; + var yj = this.points[j * 2 + 1]; + var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi; + + if (intersect) { + inside = !inside; + } } - (0, _buildLine2.default)(graphicsData, webGLData); + return inside; + }; + + return Polygon; +}(); - graphicsData.points = tempPoints; - } -} -//# sourceMappingURL=buildCircle.js.map +exports.default = Polygon; +//# sourceMappingURL=Polygon.js.map /***/ }), -/* 529 */ +/* 533 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = buildPoly; - -var _buildLine = __webpack_require__(81); - -var _buildLine2 = _interopRequireDefault(_buildLine); -var _utils = __webpack_require__(5); +var _const = __webpack_require__(0); -var _earcut = __webpack_require__(138); - -var _earcut2 = _interopRequireDefault(_earcut); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * Builds a polygon to draw - * - * Ignored from docs since it is not directly exposed. + * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its + * top-left corner point (x, y) and by its width and its height and its radius. * - * @ignore - * @private - * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties - * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @class + * @memberof PIXI */ -function buildPoly(graphicsData, webGLData) { - graphicsData.points = graphicsData.shape.points.slice(); +var RoundedRectangle = function () { + /** + * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle + * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle + * @param {number} [width=0] - The overall width of this rounded rectangle + * @param {number} [height=0] - The overall height of this rounded rectangle + * @param {number} [radius=20] - Controls the radius of the rounded corners + */ + function RoundedRectangle() { + var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20; - var points = graphicsData.points; + _classCallCheck(this, RoundedRectangle); - if (graphicsData.fill && points.length >= 6) { - var holeArray = []; - // Process holes.. - var holes = graphicsData.holes; + /** + * @member {number} + * @default 0 + */ + this.x = x; - for (var i = 0; i < holes.length; i++) { - var hole = holes[i]; + /** + * @member {number} + * @default 0 + */ + this.y = y; - holeArray.push(points.length / 2); + /** + * @member {number} + * @default 0 + */ + this.width = width; - points = points.concat(hole.points); - } + /** + * @member {number} + * @default 0 + */ + this.height = height; - // get first and last point.. figure out the middle! - var verts = webGLData.points; - var indices = webGLData.indices; + /** + * @member {number} + * @default 20 + */ + this.radius = radius; - var length = points.length / 2; + /** + * The type of the object, mainly used to avoid `instanceof` checks + * + * @member {number} + * @readonly + * @default PIXI.SHAPES.RREC + * @see PIXI.SHAPES + */ + this.type = _const.SHAPES.RREC; + } - // sort color - var color = (0, _utils.hex2rgb)(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; + /** + * Creates a clone of this Rounded Rectangle + * + * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle + */ - var triangles = (0, _earcut2.default)(points, holeArray, 2); - if (!triangles) { - return; - } + RoundedRectangle.prototype.clone = function clone() { + return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); + }; - var vertPos = verts.length / 6; + /** + * Checks whether the x and y coordinates given are contained within this Rounded Rectangle + * + * @param {number} x - The X coordinate of the point to test + * @param {number} y - The Y coordinate of the point to test + * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle + */ - for (var _i = 0; _i < triangles.length; _i += 3) { - indices.push(triangles[_i] + vertPos); - indices.push(triangles[_i] + vertPos); - indices.push(triangles[_i + 1] + vertPos); - indices.push(triangles[_i + 2] + vertPos); - indices.push(triangles[_i + 2] + vertPos); + + RoundedRectangle.prototype.contains = function contains(x, y) { + if (this.width <= 0 || this.height <= 0) { + return false; } + if (x >= this.x && x <= this.x + this.width) { + if (y >= this.y && y <= this.y + this.height) { + if (y >= this.y + this.radius && y <= this.y + this.height - this.radius || x >= this.x + this.radius && x <= this.x + this.width - this.radius) { + return true; + } + var dx = x - (this.x + this.radius); + var dy = y - (this.y + this.radius); + var radius2 = this.radius * this.radius; - for (var _i2 = 0; _i2 < length; _i2++) { - verts.push(points[_i2 * 2], points[_i2 * 2 + 1], r, g, b, alpha); + if (dx * dx + dy * dy <= radius2) { + return true; + } + dx = x - (this.x + this.width - this.radius); + if (dx * dx + dy * dy <= radius2) { + return true; + } + dy = y - (this.y + this.height - this.radius); + if (dx * dx + dy * dy <= radius2) { + return true; + } + dx = x - (this.x + this.radius); + if (dx * dx + dy * dy <= radius2) { + return true; + } + } } - } - if (graphicsData.lineWidth > 0) { - (0, _buildLine2.default)(graphicsData, webGLData); - } -} -//# sourceMappingURL=buildPoly.js.map + return false; + }; + + return RoundedRectangle; +}(); + +exports.default = RoundedRectangle; +//# sourceMappingURL=RoundedRectangle.js.map /***/ }), -/* 530 */ +/* 534 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; -exports.default = buildRectangle; - -var _buildLine = __webpack_require__(81); -var _buildLine2 = _interopRequireDefault(_buildLine); - -var _utils = __webpack_require__(5); +var _const = __webpack_require__(0); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * Builds a rectangle to draw - * - * Ignored from docs since it is not directly exposed. + * A set of functions used to handle masking. * - * @ignore - * @private - * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties - * @param {object} webGLData - an object containing all the webGL-specific information to create this shape + * @class + * @memberof PIXI */ -function buildRectangle(graphicsData, webGLData) { - // --- // - // need to convert points to a nice regular data - // - var rectData = graphicsData.shape; - var x = rectData.x; - var y = rectData.y; - var width = rectData.width; - var height = rectData.height; - - if (graphicsData.fill) { - var color = (0, _utils.hex2rgb)(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; - - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; - - var verts = webGLData.points; - var indices = webGLData.indices; - - var vertPos = verts.length / 6; - - // start - verts.push(x, y); - verts.push(r, g, b, alpha); +var CanvasMaskManager = function () { + /** + * @param {PIXI.CanvasRenderer} renderer - The canvas renderer. + */ + function CanvasMaskManager(renderer) { + _classCallCheck(this, CanvasMaskManager); - verts.push(x + width, y); - verts.push(r, g, b, alpha); + this.renderer = renderer; + } - verts.push(x, y + height); - verts.push(r, g, b, alpha); + /** + * This method adds it to the current stack of masks. + * + * @param {object} maskData - the maskData that will be pushed + */ - verts.push(x + width, y + height); - verts.push(r, g, b, alpha); - // insert 2 dead triangles.. - indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3); - } + CanvasMaskManager.prototype.pushMask = function pushMask(maskData) { + var renderer = this.renderer; - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; + renderer.context.save(); - graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y]; + var cacheAlpha = maskData.alpha; + var transform = maskData.transform.worldTransform; + var resolution = renderer.resolution; - (0, _buildLine2.default)(graphicsData, webGLData); + renderer.context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution); - graphicsData.points = tempPoints; - } -} -//# sourceMappingURL=buildRectangle.js.map + // TODO suport sprite alpha masks?? + // lots of effort required. If demand is great enough.. + if (!maskData._texture) { + this.renderGraphicsShape(maskData); + renderer.context.clip(); + } -/***/ }), -/* 531 */ -/***/ (function(module, exports, __webpack_require__) { + maskData.worldAlpha = cacheAlpha; + }; -"use strict"; + /** + * Renders a PIXI.Graphics shape. + * + * @param {PIXI.Graphics} graphics - The object to render. + */ -exports.__esModule = true; -exports.default = buildRoundedRectangle; + CanvasMaskManager.prototype.renderGraphicsShape = function renderGraphicsShape(graphics) { + var context = this.renderer.context; + var len = graphics.graphicsData.length; -var _earcut = __webpack_require__(138); + if (len === 0) { + return; + } -var _earcut2 = _interopRequireDefault(_earcut); + context.beginPath(); -var _buildLine = __webpack_require__(81); + for (var i = 0; i < len; i++) { + var data = graphics.graphicsData[i]; + var shape = data.shape; -var _buildLine2 = _interopRequireDefault(_buildLine); + if (data.type === _const.SHAPES.POLY) { + var points = shape.points; -var _utils = __webpack_require__(5); + context.moveTo(points[0], points[1]); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + for (var j = 1; j < points.length / 2; j++) { + context.lineTo(points[j * 2], points[j * 2 + 1]); + } -/** - * Builds a rounded rectangle to draw - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties - * @param {object} webGLData - an object containing all the webGL-specific information to create this shape - */ -function buildRoundedRectangle(graphicsData, webGLData) { - var rrectData = graphicsData.shape; - var x = rrectData.x; - var y = rrectData.y; - var width = rrectData.width; - var height = rrectData.height; + // if the first and last point are the same close the path - much neater :) + if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) { + context.closePath(); + } + } else if (data.type === _const.SHAPES.RECT) { + context.rect(shape.x, shape.y, shape.width, shape.height); + context.closePath(); + } else if (data.type === _const.SHAPES.CIRC) { + // TODO - need to be Undefined! + context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI); + context.closePath(); + } else if (data.type === _const.SHAPES.ELIP) { + // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - var radius = rrectData.radius; + var w = shape.width * 2; + var h = shape.height * 2; - var recPoints = []; + var x = shape.x - w / 2; + var y = shape.y - h / 2; - recPoints.push(x, y + radius); - quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints); - quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints); - quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints); - quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints); + var kappa = 0.5522848; + var ox = w / 2 * kappa; // control point offset horizontal + var oy = h / 2 * kappa; // control point offset vertical + var xe = x + w; // x-end + var ye = y + h; // y-end + var xm = x + w / 2; // x-middle + var ym = y + h / 2; // y-middle - // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item. - // TODO - fix this properly, this is not very elegant.. but it works for now. + context.moveTo(x, ym); + context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); + context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); + context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); + context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); + context.closePath(); + } else if (data.type === _const.SHAPES.RREC) { + var rx = shape.x; + var ry = shape.y; + var width = shape.width; + var height = shape.height; + var radius = shape.radius; - if (graphicsData.fill) { - var color = (0, _utils.hex2rgb)(graphicsData.fillColor); - var alpha = graphicsData.fillAlpha; + var maxRadius = Math.min(width, height) / 2 | 0; - var r = color[0] * alpha; - var g = color[1] * alpha; - var b = color[2] * alpha; + radius = radius > maxRadius ? maxRadius : radius; - var verts = webGLData.points; - var indices = webGLData.indices; + context.moveTo(rx, ry + radius); + context.lineTo(rx, ry + height - radius); + context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); + context.lineTo(rx + width - radius, ry + height); + context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); + context.lineTo(rx + width, ry + radius); + context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); + context.lineTo(rx + radius, ry); + context.quadraticCurveTo(rx, ry, rx, ry + radius); + context.closePath(); + } + } + }; - var vecPos = verts.length / 6; + /** + * Restores the current drawing context to the state it was before the mask was applied. + * + * @param {PIXI.CanvasRenderer} renderer - The renderer context to use. + */ - var triangles = (0, _earcut2.default)(recPoints, null, 2); - for (var i = 0, j = triangles.length; i < j; i += 3) { - indices.push(triangles[i] + vecPos); - indices.push(triangles[i] + vecPos); - indices.push(triangles[i + 1] + vecPos); - indices.push(triangles[i + 2] + vecPos); - indices.push(triangles[i + 2] + vecPos); - } + CanvasMaskManager.prototype.popMask = function popMask(renderer) { + renderer.context.restore(); + renderer.invalidateBlendMode(); + }; - for (var _i = 0, _j = recPoints.length; _i < _j; _i++) { - verts.push(recPoints[_i], recPoints[++_i], r, g, b, alpha); - } - } + /** + * Destroys this canvas mask manager. + * + */ - if (graphicsData.lineWidth) { - var tempPoints = graphicsData.points; - graphicsData.points = recPoints; + CanvasMaskManager.prototype.destroy = function destroy() { + /* empty */ + }; - (0, _buildLine2.default)(graphicsData, webGLData); + return CanvasMaskManager; +}(); - graphicsData.points = tempPoints; - } -} +exports.default = CanvasMaskManager; +//# sourceMappingURL=CanvasMaskManager.js.map -/** - * Calculate the points for a quadratic bezier curve. (helper function..) - * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c - * - * Ignored from docs since it is not directly exposed. - * - * @ignore - * @private - * @param {number} fromX - Origin point x - * @param {number} fromY - Origin point x - * @param {number} cpX - Control point x - * @param {number} cpY - Control point y - * @param {number} toX - Destination point x - * @param {number} toY - Destination point y - * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created. - * @return {number[]} an array of points - */ -function quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) { - var out = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : []; +/***/ }), +/* 535 */ +/***/ (function(module, exports, __webpack_require__) { - var n = 20; - var points = out; +"use strict"; - var xa = 0; - var ya = 0; - var xb = 0; - var yb = 0; - var x = 0; - var y = 0; - function getPt(n1, n2, perc) { - var diff = n2 - n1; +exports.__esModule = true; +exports.default = mapCanvasBlendModesToPixi; - return n1 + diff * perc; - } +var _const = __webpack_require__(0); - for (var i = 0, j = 0; i <= n; ++i) { - j = i / n; +var _canUseNewCanvasBlendModes = __webpack_require__(245); - // The Green Line - xa = getPt(fromX, cpX, j); - ya = getPt(fromY, cpY, j); - xb = getPt(cpX, toX, j); - yb = getPt(cpY, toY, j); +var _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes); - // The Black Dot - x = getPt(xa, xb, j); - y = getPt(ya, yb, j); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - points.push(x, y); +/** + * Maps blend combinations to Canvas. + * + * @memberof PIXI + * @function mapCanvasBlendModesToPixi + * @private + * @param {string[]} [array=[]] - The array to output into. + * @return {string[]} Mapped modes. + */ +function mapCanvasBlendModesToPixi() { + var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + if ((0, _canUseNewCanvasBlendModes2.default)()) { + array[_const.BLEND_MODES.NORMAL] = 'source-over'; + array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK??? + array[_const.BLEND_MODES.MULTIPLY] = 'multiply'; + array[_const.BLEND_MODES.SCREEN] = 'screen'; + array[_const.BLEND_MODES.OVERLAY] = 'overlay'; + array[_const.BLEND_MODES.DARKEN] = 'darken'; + array[_const.BLEND_MODES.LIGHTEN] = 'lighten'; + array[_const.BLEND_MODES.COLOR_DODGE] = 'color-dodge'; + array[_const.BLEND_MODES.COLOR_BURN] = 'color-burn'; + array[_const.BLEND_MODES.HARD_LIGHT] = 'hard-light'; + array[_const.BLEND_MODES.SOFT_LIGHT] = 'soft-light'; + array[_const.BLEND_MODES.DIFFERENCE] = 'difference'; + array[_const.BLEND_MODES.EXCLUSION] = 'exclusion'; + array[_const.BLEND_MODES.HUE] = 'hue'; + array[_const.BLEND_MODES.SATURATION] = 'saturate'; + array[_const.BLEND_MODES.COLOR] = 'color'; + array[_const.BLEND_MODES.LUMINOSITY] = 'luminosity'; + } else { + // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough' + array[_const.BLEND_MODES.NORMAL] = 'source-over'; + array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK??? + array[_const.BLEND_MODES.MULTIPLY] = 'source-over'; + array[_const.BLEND_MODES.SCREEN] = 'source-over'; + array[_const.BLEND_MODES.OVERLAY] = 'source-over'; + array[_const.BLEND_MODES.DARKEN] = 'source-over'; + array[_const.BLEND_MODES.LIGHTEN] = 'source-over'; + array[_const.BLEND_MODES.COLOR_DODGE] = 'source-over'; + array[_const.BLEND_MODES.COLOR_BURN] = 'source-over'; + array[_const.BLEND_MODES.HARD_LIGHT] = 'source-over'; + array[_const.BLEND_MODES.SOFT_LIGHT] = 'source-over'; + array[_const.BLEND_MODES.DIFFERENCE] = 'source-over'; + array[_const.BLEND_MODES.EXCLUSION] = 'source-over'; + array[_const.BLEND_MODES.HUE] = 'source-over'; + array[_const.BLEND_MODES.SATURATION] = 'source-over'; + array[_const.BLEND_MODES.COLOR] = 'source-over'; + array[_const.BLEND_MODES.LUMINOSITY] = 'source-over'; } + // not-premultiplied, only for webgl + array[_const.BLEND_MODES.NORMAL_NPM] = array[_const.BLEND_MODES.NORMAL]; + array[_const.BLEND_MODES.ADD_NPM] = array[_const.BLEND_MODES.ADD]; + array[_const.BLEND_MODES.SCREEN_NPM] = array[_const.BLEND_MODES.SCREEN]; - return points; + return array; } -//# sourceMappingURL=buildRoundedRectangle.js.map +//# sourceMappingURL=mapCanvasBlendModesToPixi.js.map /***/ }), -/* 532 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55614,118 +58631,124 @@ function quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) { exports.__esModule = true; -var _Rectangle = __webpack_require__(127); +var _const = __webpack_require__(0); -var _Rectangle2 = _interopRequireDefault(_Rectangle); +var _settings = __webpack_require__(6); -var _const = __webpack_require__(2); +var _settings2 = _interopRequireDefault(_settings); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * The Circle object can be used to specify a hit area for displayObjects + * TextureGarbageCollector. This class manages the GPU and ensures that it does not get clogged + * up with textures that are no longer being used. * * @class * @memberof PIXI */ -var Circle = function () { - /** - * @param {number} [x=0] - The X coordinate of the center of this circle - * @param {number} [y=0] - The Y coordinate of the center of this circle - * @param {number} [radius=0] - The radius of the circle - */ - function Circle() { - var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - _classCallCheck(this, Circle); - +var TextureGarbageCollector = function () { /** - * @member {number} - * @default 0 + * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. */ - this.x = x; + function TextureGarbageCollector(renderer) { + _classCallCheck(this, TextureGarbageCollector); - /** - * @member {number} - * @default 0 - */ - this.y = y; + this.renderer = renderer; + + this.count = 0; + this.checkCount = 0; + this.maxIdle = _settings2.default.GC_MAX_IDLE; + this.checkCountMax = _settings2.default.GC_MAX_CHECK_COUNT; + this.mode = _settings2.default.GC_MODE; + } /** - * @member {number} - * @default 0 + * Checks to see when the last time a texture was used + * if the texture has not been used for a specified amount of time it will be removed from the GPU */ - this.radius = radius; + + + TextureGarbageCollector.prototype.update = function update() { + this.count++; + + if (this.mode === _const.GC_MODES.MANUAL) { + return; + } + + this.checkCount++; + + if (this.checkCount > this.checkCountMax) { + this.checkCount = 0; + + this.run(); + } + }; /** - * The type of the object, mainly used to avoid `instanceof` checks - * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.CIRC - * @see PIXI.SHAPES + * Checks to see when the last time a texture was used + * if the texture has not been used for a specified amount of time it will be removed from the GPU */ - this.type = _const.SHAPES.CIRC; - } - /** - * Creates a clone of this Circle instance - * - * @return {PIXI.Circle} a copy of the Circle - */ + TextureGarbageCollector.prototype.run = function run() { + var tm = this.renderer.textureManager; + var managedTextures = tm._managedTextures; + var wasRemoved = false; - Circle.prototype.clone = function clone() { - return new Circle(this.x, this.y, this.radius); - }; + for (var i = 0; i < managedTextures.length; i++) { + var texture = managedTextures[i]; - /** - * Checks whether the x and y coordinates given are contained within this circle - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this Circle - */ + // only supports non generated textures at the moment! + if (!texture._glRenderTargets && this.count - texture.touched > this.maxIdle) { + tm.destroyTexture(texture, true); + managedTextures[i] = null; + wasRemoved = true; + } + } + if (wasRemoved) { + var j = 0; - Circle.prototype.contains = function contains(x, y) { - if (this.radius <= 0) { - return false; - } + for (var _i = 0; _i < managedTextures.length; _i++) { + if (managedTextures[_i] !== null) { + managedTextures[j++] = managedTextures[_i]; + } + } - var r2 = this.radius * this.radius; - var dx = this.x - x; - var dy = this.y - y; + managedTextures.length = j; + } + }; - dx *= dx; - dy *= dy; + /** + * Removes all the textures within the specified displayObject and its children from the GPU + * + * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from. + */ - return dx + dy <= r2; - }; - /** - * Returns the framing rectangle of the circle as a Rectangle object - * - * @return {PIXI.Rectangle} the framing rectangle - */ + TextureGarbageCollector.prototype.unload = function unload(displayObject) { + var tm = this.renderer.textureManager; + // only destroy non generated textures + if (displayObject._texture && displayObject._texture._glRenderTargets) { + tm.destroyTexture(displayObject._texture, true); + } - Circle.prototype.getBounds = function getBounds() { - return new _Rectangle2.default(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2); - }; + for (var i = displayObject.children.length - 1; i >= 0; i--) { + this.unload(displayObject.children[i]); + } + }; - return Circle; + return TextureGarbageCollector; }(); -exports.default = Circle; -//# sourceMappingURL=Circle.js.map +exports.default = TextureGarbageCollector; +//# sourceMappingURL=TextureGarbageCollector.js.map /***/ }), -/* 533 */ +/* 537 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55733,262 +58756,260 @@ exports.default = Circle; exports.__esModule = true; -var _Rectangle = __webpack_require__(127); +var _pixiGlCore = __webpack_require__(15); -var _Rectangle2 = _interopRequireDefault(_Rectangle); +var _const = __webpack_require__(0); + +var _RenderTarget = __webpack_require__(83); + +var _RenderTarget2 = _interopRequireDefault(_RenderTarget); -var _const = __webpack_require__(2); +var _utils = __webpack_require__(3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * The Ellipse object can be used to specify a hit area for displayObjects + * Helper class to create a webGL Texture * * @class * @memberof PIXI */ -var Ellipse = function () { - /** - * @param {number} [x=0] - The X coordinate of the center of this circle - * @param {number} [y=0] - The Y coordinate of the center of this circle - * @param {number} [width=0] - The half width of this ellipse - * @param {number} [height=0] - The half height of this ellipse - */ - function Ellipse() { - var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - - _classCallCheck(this, Ellipse); - +var TextureManager = function () { /** - * @member {number} - * @default 0 + * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer */ - this.x = x; + function TextureManager(renderer) { + _classCallCheck(this, TextureManager); - /** - * @member {number} - * @default 0 - */ - this.y = y; + /** + * A reference to the current renderer + * + * @member {PIXI.WebGLRenderer} + */ + this.renderer = renderer; - /** - * @member {number} - * @default 0 - */ - this.width = width; + /** + * The current WebGL rendering context + * + * @member {WebGLRenderingContext} + */ + this.gl = renderer.gl; - /** - * @member {number} - * @default 0 - */ - this.height = height; + /** + * Track textures in the renderer so we can no longer listen to them on destruction. + * + * @member {Array<*>} + * @private + */ + this._managedTextures = []; + } /** - * The type of the object, mainly used to avoid `instanceof` checks + * Binds a texture. * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.ELIP - * @see PIXI.SHAPES */ - this.type = _const.SHAPES.ELIP; - } - /** - * Creates a clone of this Ellipse instance - * - * @return {PIXI.Ellipse} a copy of the ellipse - */ + TextureManager.prototype.bindTexture = function bindTexture() {} + // empty - Ellipse.prototype.clone = function clone() { - return new Ellipse(this.x, this.y, this.width, this.height); - }; - /** - * Checks whether the x and y coordinates given are contained within this ellipse - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coords are within this ellipse - */ + /** + * Gets a texture. + * + */ + ; + TextureManager.prototype.getTexture = function getTexture() {} + // empty - Ellipse.prototype.contains = function contains(x, y) { - if (this.width <= 0 || this.height <= 0) { - return false; - } - // normalize the coords to an ellipse with center 0,0 - var normx = (x - this.x) / this.width; - var normy = (y - this.y) / this.height; + /** + * Updates and/or Creates a WebGL texture for the renderer's context. + * + * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to update + * @param {number} location - the location the texture will be bound to. + * @return {GLTexture} The gl texture. + */ + ; - normx *= normx; - normy *= normy; + TextureManager.prototype.updateTexture = function updateTexture(texture, location) { + // assume it good! + // texture = texture.baseTexture || texture; - return normx + normy <= 1; - }; + var gl = this.gl; - /** - * Returns the framing rectangle of the ellipse as a Rectangle object - * - * @return {PIXI.Rectangle} the framing rectangle - */ + var isRenderTexture = !!texture._glRenderTargets; + if (!texture.hasLoaded) { + return null; + } - Ellipse.prototype.getBounds = function getBounds() { - return new _Rectangle2.default(this.x - this.width, this.y - this.height, this.width, this.height); - }; + var boundTextures = this.renderer.boundTextures; - return Ellipse; -}(); + // if the location is undefined then this may have been called by n event. + // this being the case the texture may already be bound to a slot. As a texture can only be bound once + // we need to find its current location if it exists. + if (location === undefined) { + location = 0; -exports.default = Ellipse; -//# sourceMappingURL=Ellipse.js.map + // TODO maybe we can use texture bound ids later on... + // check if texture is already bound.. + for (var i = 0; i < boundTextures.length; ++i) { + if (boundTextures[i] === texture) { + location = i; + break; + } + } + } -/***/ }), -/* 534 */ -/***/ (function(module, exports, __webpack_require__) { + boundTextures[location] = texture; -"use strict"; + gl.activeTexture(gl.TEXTURE0 + location); + var glTexture = texture._glTextures[this.renderer.CONTEXT_UID]; -exports.__esModule = true; + if (!glTexture) { + if (isRenderTexture) { + var renderTarget = new _RenderTarget2.default(this.gl, texture.width, texture.height, texture.scaleMode, texture.resolution); -var _Point = __webpack_require__(126); + renderTarget.resize(texture.width, texture.height); + texture._glRenderTargets[this.renderer.CONTEXT_UID] = renderTarget; + glTexture = renderTarget.texture; + } else { + glTexture = new _pixiGlCore.GLTexture(this.gl, null, null, null, null); + glTexture.bind(location); + glTexture.premultiplyAlpha = true; + glTexture.upload(texture.source); + } -var _Point2 = _interopRequireDefault(_Point); + texture._glTextures[this.renderer.CONTEXT_UID] = glTexture; -var _const = __webpack_require__(2); + texture.on('update', this.updateTexture, this); + texture.on('dispose', this.destroyTexture, this); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + this._managedTextures.push(texture); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (texture.isPowerOfTwo) { + if (texture.mipmap) { + glTexture.enableMipmap(); + } -/** - * @class - * @memberof PIXI - */ -var Polygon = function () { - /** - * @param {PIXI.Point[]|number[]} points - This can be an array of Points - * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or - * the arguments passed can be all the points of the polygon e.g. - * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat - * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers. - */ - function Polygon() { - for (var _len = arguments.length, points = Array(_len), _key = 0; _key < _len; _key++) { - points[_key] = arguments[_key]; + if (texture.wrapMode === _const.WRAP_MODES.CLAMP) { + glTexture.enableWrapClamp(); + } else if (texture.wrapMode === _const.WRAP_MODES.REPEAT) { + glTexture.enableWrapRepeat(); + } else { + glTexture.enableWrapMirrorRepeat(); + } + } else { + glTexture.enableWrapClamp(); + } + + if (texture.scaleMode === _const.SCALE_MODES.NEAREST) { + glTexture.enableNearestScaling(); + } else { + glTexture.enableLinearScaling(); + } } + // the texture already exists so we only need to update it.. + else if (isRenderTexture) { + texture._glRenderTargets[this.renderer.CONTEXT_UID].resize(texture.width, texture.height); + } else { + glTexture.upload(texture.source); + } - _classCallCheck(this, Polygon); + return glTexture; + }; - if (Array.isArray(points[0])) { - points = points[0]; - } + /** + * Deletes the texture from WebGL + * + * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to destroy + * @param {boolean} [skipRemove=false] - Whether to skip removing the texture from the TextureManager. + */ - // if this is an array of points, convert it to a flat array of numbers - if (points[0] instanceof _Point2.default) { - var p = []; - for (var i = 0, il = points.length; i < il; i++) { - p.push(points[i].x, points[i].y); - } + TextureManager.prototype.destroyTexture = function destroyTexture(texture, skipRemove) { + texture = texture.baseTexture || texture; - points = p; + if (!texture.hasLoaded) { + return; } - this.closed = true; + var uid = this.renderer.CONTEXT_UID; + var glTextures = texture._glTextures; + var glRenderTargets = texture._glRenderTargets; - /** - * An array of the points of this polygon - * - * @member {number[]} - */ - this.points = points; + if (glTextures[uid]) { + this.renderer.unbindTexture(texture); - /** - * The type of the object, mainly used to avoid `instanceof` checks - * - * @member {number} - * @readOnly - * @default PIXI.SHAPES.POLY - * @see PIXI.SHAPES - */ - this.type = _const.SHAPES.POLY; - } + glTextures[uid].destroy(); + texture.off('update', this.updateTexture, this); + texture.off('dispose', this.destroyTexture, this); - /** - * Creates a clone of this polygon - * - * @return {PIXI.Polygon} a copy of the polygon - */ + delete glTextures[uid]; + if (!skipRemove) { + var i = this._managedTextures.indexOf(texture); - Polygon.prototype.clone = function clone() { - return new Polygon(this.points.slice()); + if (i !== -1) { + (0, _utils.removeItems)(this._managedTextures, i, 1); + } + } + } + + if (glRenderTargets && glRenderTargets[uid]) { + glRenderTargets[uid].destroy(); + delete glRenderTargets[uid]; + } }; /** - * Closes the polygon, adding points if necessary. - * + * Deletes all the textures from WebGL */ - Polygon.prototype.close = function close() { - var points = this.points; + TextureManager.prototype.removeAll = function removeAll() { + // empty all the old gl textures as they are useless now + for (var i = 0; i < this._managedTextures.length; ++i) { + var texture = this._managedTextures[i]; - // close the poly if the value is true! - if (points[0] !== points[points.length - 2] || points[1] !== points[points.length - 1]) { - points.push(points[0], points[1]); + if (texture._glTextures[this.renderer.CONTEXT_UID]) { + delete texture._glTextures[this.renderer.CONTEXT_UID]; + } } }; /** - * Checks whether the x and y coordinates passed to this function are contained within this polygon - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this polygon + * Destroys this manager and removes all its textures */ - Polygon.prototype.contains = function contains(x, y) { - var inside = false; - - // use some raycasting to test hits - // https://github.com/substack/point-in-polygon/blob/master/index.js - var length = this.points.length / 2; + TextureManager.prototype.destroy = function destroy() { + // destroy managed textures + for (var i = 0; i < this._managedTextures.length; ++i) { + var texture = this._managedTextures[i]; - for (var i = 0, j = length - 1; i < length; j = i++) { - var xi = this.points[i * 2]; - var yi = this.points[i * 2 + 1]; - var xj = this.points[j * 2]; - var yj = this.points[j * 2 + 1]; - var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi; + this.destroyTexture(texture, true); - if (intersect) { - inside = !inside; - } + texture.off('update', this.updateTexture, this); + texture.off('dispose', this.destroyTexture, this); } - return inside; + this._managedTextures = null; }; - return Polygon; + return TextureManager; }(); -exports.default = Polygon; -//# sourceMappingURL=Polygon.js.map +exports.default = TextureManager; +//# sourceMappingURL=TextureManager.js.map /***/ }), -/* 535 */ +/* 538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -55996,505 +59017,281 @@ exports.default = Polygon; exports.__esModule = true; -var _const = __webpack_require__(2); +var _mapWebGLBlendModesToPixi = __webpack_require__(545); + +var _mapWebGLBlendModesToPixi2 = _interopRequireDefault(_mapWebGLBlendModesToPixi); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var BLEND = 0; +var DEPTH_TEST = 1; +var FRONT_FACE = 2; +var CULL_FACE = 3; +var BLEND_FUNC = 4; + /** - * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its - * top-left corner point (x, y) and by its width and its height and its radius. + * A WebGL state machines * - * @class * @memberof PIXI + * @class */ -var RoundedRectangle = function () { + +var WebGLState = function () { /** - * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle - * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle - * @param {number} [width=0] - The overall width of this rounded rectangle - * @param {number} [height=0] - The overall height of this rounded rectangle - * @param {number} [radius=20] - Controls the radius of the rounded corners + * @param {WebGLRenderingContext} gl - The current WebGL rendering context */ - function RoundedRectangle() { - var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20; - - _classCallCheck(this, RoundedRectangle); + function WebGLState(gl) { + _classCallCheck(this, WebGLState); /** - * @member {number} - * @default 0 + * The current active state + * + * @member {Uint8Array} */ - this.x = x; + this.activeState = new Uint8Array(16); /** - * @member {number} - * @default 0 + * The default state + * + * @member {Uint8Array} */ - this.y = y; + this.defaultState = new Uint8Array(16); - /** - * @member {number} - * @default 0 - */ - this.width = width; + // default blend mode.. + this.defaultState[0] = 1; /** + * The current state index in the stack + * * @member {number} - * @default 0 + * @private */ - this.height = height; + this.stackIndex = 0; /** - * @member {number} - * @default 20 + * The stack holding all the different states + * + * @member {Array<*>} + * @private */ - this.radius = radius; + this.stack = []; /** - * The type of the object, mainly used to avoid `instanceof` checks + * The current WebGL rendering context * - * @member {number} - * @readonly - * @default PIXI.SHAPES.RREC - * @see PIXI.SHAPES + * @member {WebGLRenderingContext} */ - this.type = _const.SHAPES.RREC; - } + this.gl = gl; - /** - * Creates a clone of this Rounded Rectangle - * - * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle - */ + this.maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); + + this.attribState = { + tempAttribState: new Array(this.maxAttribs), + attribState: new Array(this.maxAttribs) + }; + this.blendModes = (0, _mapWebGLBlendModesToPixi2.default)(gl); - RoundedRectangle.prototype.clone = function clone() { - return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius); - }; + // check we have vao.. + this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || gl.getExtension('MOZ_OES_vertex_array_object') || gl.getExtension('WEBKIT_OES_vertex_array_object'); + } /** - * Checks whether the x and y coordinates given are contained within this Rounded Rectangle - * - * @param {number} x - The X coordinate of the point to test - * @param {number} y - The Y coordinate of the point to test - * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle + * Pushes a new active state */ - RoundedRectangle.prototype.contains = function contains(x, y) { - if (this.width <= 0 || this.height <= 0) { - return false; - } - if (x >= this.x && x <= this.x + this.width) { - if (y >= this.y && y <= this.y + this.height) { - if (y >= this.y + this.radius && y <= this.y + this.height - this.radius || x >= this.x + this.radius && x <= this.x + this.width - this.radius) { - return true; - } - var dx = x - (this.x + this.radius); - var dy = y - (this.y + this.radius); - var radius2 = this.radius * this.radius; + WebGLState.prototype.push = function push() { + // next state.. + var state = this.stack[this.stackIndex]; - if (dx * dx + dy * dy <= radius2) { - return true; - } - dx = x - (this.x + this.width - this.radius); - if (dx * dx + dy * dy <= radius2) { - return true; - } - dy = y - (this.y + this.height - this.radius); - if (dx * dx + dy * dy <= radius2) { - return true; - } - dx = x - (this.x + this.radius); - if (dx * dx + dy * dy <= radius2) { - return true; - } - } + if (!state) { + state = this.stack[this.stackIndex] = new Uint8Array(16); } - return false; - }; - - return RoundedRectangle; -}(); - -exports.default = RoundedRectangle; -//# sourceMappingURL=RoundedRectangle.js.map - -/***/ }), -/* 536 */ -/***/ (function(module, exports, __webpack_require__) { + ++this.stackIndex; -"use strict"; + // copy state.. + // set active state so we can force overrides of gl state + for (var i = 0; i < this.activeState.length; i++) { + state[i] = this.activeState[i]; + } + }; + /** + * Pops a state out + */ -exports.__esModule = true; -var _const = __webpack_require__(2); + WebGLState.prototype.pop = function pop() { + var state = this.stack[--this.stackIndex]; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + this.setState(state); + }; -/** - * A set of functions used to handle masking. - * - * @class - * @memberof PIXI - */ -var CanvasMaskManager = function () { /** - * @param {PIXI.CanvasRenderer} renderer - The canvas renderer. + * Sets the current state + * + * @param {*} state - The state to set. */ - function CanvasMaskManager(renderer) { - _classCallCheck(this, CanvasMaskManager); - this.renderer = renderer; - } + + WebGLState.prototype.setState = function setState(state) { + this.setBlend(state[BLEND]); + this.setDepthTest(state[DEPTH_TEST]); + this.setFrontFace(state[FRONT_FACE]); + this.setCullFace(state[CULL_FACE]); + this.setBlendMode(state[BLEND_FUNC]); + }; /** - * This method adds it to the current stack of masks. + * Enables or disabled blending. * - * @param {object} maskData - the maskData that will be pushed + * @param {boolean} value - Turn on or off webgl blending. */ - CanvasMaskManager.prototype.pushMask = function pushMask(maskData) { - var renderer = this.renderer; - - renderer.context.save(); - - var cacheAlpha = maskData.alpha; - var transform = maskData.transform.worldTransform; - var resolution = renderer.resolution; - - renderer.context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution); + WebGLState.prototype.setBlend = function setBlend(value) { + value = value ? 1 : 0; - // TODO suport sprite alpha masks?? - // lots of effort required. If demand is great enough.. - if (!maskData._texture) { - this.renderGraphicsShape(maskData); - renderer.context.clip(); + if (this.activeState[BLEND] === value) { + return; } - maskData.worldAlpha = cacheAlpha; + this.activeState[BLEND] = value; + this.gl[value ? 'enable' : 'disable'](this.gl.BLEND); }; /** - * Renders a PIXI.Graphics shape. + * Sets the blend mode. * - * @param {PIXI.Graphics} graphics - The object to render. + * @param {number} value - The blend mode to set to. */ - CanvasMaskManager.prototype.renderGraphicsShape = function renderGraphicsShape(graphics) { - var context = this.renderer.context; - var len = graphics.graphicsData.length; - - if (len === 0) { + WebGLState.prototype.setBlendMode = function setBlendMode(value) { + if (value === this.activeState[BLEND_FUNC]) { return; } - context.beginPath(); - - for (var i = 0; i < len; i++) { - var data = graphics.graphicsData[i]; - var shape = data.shape; - - if (data.type === _const.SHAPES.POLY) { - var points = shape.points; - - context.moveTo(points[0], points[1]); - - for (var j = 1; j < points.length / 2; j++) { - context.lineTo(points[j * 2], points[j * 2 + 1]); - } - - // if the first and last point are the same close the path - much neater :) - if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) { - context.closePath(); - } - } else if (data.type === _const.SHAPES.RECT) { - context.rect(shape.x, shape.y, shape.width, shape.height); - context.closePath(); - } else if (data.type === _const.SHAPES.CIRC) { - // TODO - need to be Undefined! - context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI); - context.closePath(); - } else if (data.type === _const.SHAPES.ELIP) { - // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas - - var w = shape.width * 2; - var h = shape.height * 2; - - var x = shape.x - w / 2; - var y = shape.y - h / 2; - - var kappa = 0.5522848; - var ox = w / 2 * kappa; // control point offset horizontal - var oy = h / 2 * kappa; // control point offset vertical - var xe = x + w; // x-end - var ye = y + h; // y-end - var xm = x + w / 2; // x-middle - var ym = y + h / 2; // y-middle - - context.moveTo(x, ym); - context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); - context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); - context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); - context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); - context.closePath(); - } else if (data.type === _const.SHAPES.RREC) { - var rx = shape.x; - var ry = shape.y; - var width = shape.width; - var height = shape.height; - var radius = shape.radius; - - var maxRadius = Math.min(width, height) / 2 | 0; + this.activeState[BLEND_FUNC] = value; - radius = radius > maxRadius ? maxRadius : radius; + var mode = this.blendModes[value]; - context.moveTo(rx, ry + radius); - context.lineTo(rx, ry + height - radius); - context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height); - context.lineTo(rx + width - radius, ry + height); - context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius); - context.lineTo(rx + width, ry + radius); - context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry); - context.lineTo(rx + radius, ry); - context.quadraticCurveTo(rx, ry, rx, ry + radius); - context.closePath(); - } + if (mode.length === 2) { + this.gl.blendFunc(mode[0], mode[1]); + } else { + this.gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]); } }; /** - * Restores the current drawing context to the state it was before the mask was applied. + * Sets whether to enable or disable depth test. * - * @param {PIXI.CanvasRenderer} renderer - The renderer context to use. + * @param {boolean} value - Turn on or off webgl depth testing. */ - CanvasMaskManager.prototype.popMask = function popMask(renderer) { - renderer.context.restore(); + WebGLState.prototype.setDepthTest = function setDepthTest(value) { + value = value ? 1 : 0; + + if (this.activeState[DEPTH_TEST] === value) { + return; + } + + this.activeState[DEPTH_TEST] = value; + this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST); }; /** - * Destroys this canvas mask manager. + * Sets whether to enable or disable cull face. * + * @param {boolean} value - Turn on or off webgl cull face. */ - CanvasMaskManager.prototype.destroy = function destroy() { - /* empty */ - }; - - return CanvasMaskManager; -}(); - -exports.default = CanvasMaskManager; -//# sourceMappingURL=CanvasMaskManager.js.map - -/***/ }), -/* 537 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.default = mapCanvasBlendModesToPixi; - -var _const = __webpack_require__(2); - -var _canUseNewCanvasBlendModes = __webpack_require__(243); - -var _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Maps blend combinations to Canvas. - * - * @memberof PIXI - * @function mapCanvasBlendModesToPixi - * @private - * @param {string[]} [array=[]] - The array to output into. - * @return {string[]} Mapped modes. - */ -function mapCanvasBlendModesToPixi() { - var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - if ((0, _canUseNewCanvasBlendModes2.default)()) { - array[_const.BLEND_MODES.NORMAL] = 'source-over'; - array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK??? - array[_const.BLEND_MODES.MULTIPLY] = 'multiply'; - array[_const.BLEND_MODES.SCREEN] = 'screen'; - array[_const.BLEND_MODES.OVERLAY] = 'overlay'; - array[_const.BLEND_MODES.DARKEN] = 'darken'; - array[_const.BLEND_MODES.LIGHTEN] = 'lighten'; - array[_const.BLEND_MODES.COLOR_DODGE] = 'color-dodge'; - array[_const.BLEND_MODES.COLOR_BURN] = 'color-burn'; - array[_const.BLEND_MODES.HARD_LIGHT] = 'hard-light'; - array[_const.BLEND_MODES.SOFT_LIGHT] = 'soft-light'; - array[_const.BLEND_MODES.DIFFERENCE] = 'difference'; - array[_const.BLEND_MODES.EXCLUSION] = 'exclusion'; - array[_const.BLEND_MODES.HUE] = 'hue'; - array[_const.BLEND_MODES.SATURATION] = 'saturate'; - array[_const.BLEND_MODES.COLOR] = 'color'; - array[_const.BLEND_MODES.LUMINOSITY] = 'luminosity'; - } else { - // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough' - array[_const.BLEND_MODES.NORMAL] = 'source-over'; - array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK??? - array[_const.BLEND_MODES.MULTIPLY] = 'source-over'; - array[_const.BLEND_MODES.SCREEN] = 'source-over'; - array[_const.BLEND_MODES.OVERLAY] = 'source-over'; - array[_const.BLEND_MODES.DARKEN] = 'source-over'; - array[_const.BLEND_MODES.LIGHTEN] = 'source-over'; - array[_const.BLEND_MODES.COLOR_DODGE] = 'source-over'; - array[_const.BLEND_MODES.COLOR_BURN] = 'source-over'; - array[_const.BLEND_MODES.HARD_LIGHT] = 'source-over'; - array[_const.BLEND_MODES.SOFT_LIGHT] = 'source-over'; - array[_const.BLEND_MODES.DIFFERENCE] = 'source-over'; - array[_const.BLEND_MODES.EXCLUSION] = 'source-over'; - array[_const.BLEND_MODES.HUE] = 'source-over'; - array[_const.BLEND_MODES.SATURATION] = 'source-over'; - array[_const.BLEND_MODES.COLOR] = 'source-over'; - array[_const.BLEND_MODES.LUMINOSITY] = 'source-over'; - } - - return array; -} -//# sourceMappingURL=mapCanvasBlendModesToPixi.js.map - -/***/ }), -/* 538 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _const = __webpack_require__(2); - -var _settings = __webpack_require__(10); - -var _settings2 = _interopRequireDefault(_settings); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * TextureGarbageCollector. This class manages the GPU and ensures that it does not get clogged - * up with textures that are no longer being used. - * - * @class - * @memberof PIXI - */ -var TextureGarbageCollector = function () { - /** - * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. - */ - function TextureGarbageCollector(renderer) { - _classCallCheck(this, TextureGarbageCollector); + WebGLState.prototype.setCullFace = function setCullFace(value) { + value = value ? 1 : 0; - this.renderer = renderer; + if (this.activeState[CULL_FACE] === value) { + return; + } - this.count = 0; - this.checkCount = 0; - this.maxIdle = _settings2.default.GC_MAX_IDLE; - this.checkCountMax = _settings2.default.GC_MAX_CHECK_COUNT; - this.mode = _settings2.default.GC_MODE; - } + this.activeState[CULL_FACE] = value; + this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE); + }; /** - * Checks to see when the last time a texture was used - * if the texture has not been used for a specified amount of time it will be removed from the GPU + * Sets the gl front face. + * + * @param {boolean} value - true is clockwise and false is counter-clockwise */ - TextureGarbageCollector.prototype.update = function update() { - this.count++; + WebGLState.prototype.setFrontFace = function setFrontFace(value) { + value = value ? 1 : 0; - if (this.mode === _const.GC_MODES.MANUAL) { + if (this.activeState[FRONT_FACE] === value) { return; } - this.checkCount++; - - if (this.checkCount > this.checkCountMax) { - this.checkCount = 0; - - this.run(); - } + this.activeState[FRONT_FACE] = value; + this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']); }; /** - * Checks to see when the last time a texture was used - * if the texture has not been used for a specified amount of time it will be removed from the GPU + * Disables all the vaos in use + * */ - TextureGarbageCollector.prototype.run = function run() { - var tm = this.renderer.textureManager; - var managedTextures = tm._managedTextures; - var wasRemoved = false; - - for (var i = 0; i < managedTextures.length; i++) { - var texture = managedTextures[i]; - - // only supports non generated textures at the moment! - if (!texture._glRenderTargets && this.count - texture.touched > this.maxIdle) { - tm.destroyTexture(texture, true); - managedTextures[i] = null; - wasRemoved = true; - } + WebGLState.prototype.resetAttributes = function resetAttributes() { + for (var i = 0; i < this.attribState.tempAttribState.length; i++) { + this.attribState.tempAttribState[i] = 0; } - if (wasRemoved) { - var j = 0; - - for (var _i = 0; _i < managedTextures.length; _i++) { - if (managedTextures[_i] !== null) { - managedTextures[j++] = managedTextures[_i]; - } - } + for (var _i = 0; _i < this.attribState.attribState.length; _i++) { + this.attribState.attribState[_i] = 0; + } - managedTextures.length = j; + // im going to assume one is always active for performance reasons. + for (var _i2 = 1; _i2 < this.maxAttribs; _i2++) { + this.gl.disableVertexAttribArray(_i2); } }; + // used /** - * Removes all the textures within the specified displayObject and its children from the GPU - * - * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from. + * Resets all the logic and disables the vaos */ - TextureGarbageCollector.prototype.unload = function unload(displayObject) { - var tm = this.renderer.textureManager; - - // only destroy non generated textures - if (displayObject._texture && displayObject._texture._glRenderTargets) { - tm.destroyTexture(displayObject._texture, true); + WebGLState.prototype.resetToDefault = function resetToDefault() { + // unbind any VAO if they exist.. + if (this.nativeVaoExtension) { + this.nativeVaoExtension.bindVertexArrayOES(null); } - for (var i = displayObject.children.length - 1; i >= 0; i--) { - this.unload(displayObject.children[i]); + // reset all attributes.. + this.resetAttributes(); + + // set active state so we can force overrides of gl state + for (var i = 0; i < this.activeState.length; ++i) { + this.activeState[i] = 32; } + + this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false); + + this.setState(this.defaultState); }; - return TextureGarbageCollector; + return WebGLState; }(); -exports.default = TextureGarbageCollector; -//# sourceMappingURL=TextureGarbageCollector.js.map +exports.default = WebGLState; +//# sourceMappingURL=WebGLState.js.map /***/ }), /* 539 */ @@ -56504,683 +59301,730 @@ exports.default = TextureGarbageCollector; exports.__esModule = true; +exports.default = extractUniformsFromSrc; var _pixiGlCore = __webpack_require__(15); -var _const = __webpack_require__(2); +var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); -var _RenderTarget = __webpack_require__(84); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _RenderTarget2 = _interopRequireDefault(_RenderTarget); +var defaultValue = _pixiGlCore2.default.shader.defaultValue; + +function extractUniformsFromSrc(vertexSrc, fragmentSrc, mask) { + var vertUniforms = extractUniformsFromString(vertexSrc, mask); + var fragUniforms = extractUniformsFromString(fragmentSrc, mask); -var _utils = __webpack_require__(5); + return Object.assign(vertUniforms, fragUniforms); +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function extractUniformsFromString(string) { + var maskRegex = new RegExp('^(projectionMatrix|uSampler|filterArea|filterClamp)$'); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var uniforms = {}; + var nameSplit = void 0; + + // clean the lines a little - remove extra spaces / tabs etc + // then split along ';' + var lines = string.replace(/\s+/g, ' ').split(/\s*;\s*/); + + // loop through.. + for (var i = 0; i < lines.length; i++) { + var line = lines[i].trim(); + + if (line.indexOf('uniform') > -1) { + var splitLine = line.split(' '); + var type = splitLine[1]; + + var name = splitLine[2]; + var size = 1; + + if (name.indexOf('[') > -1) { + // array! + nameSplit = name.split(/\[|]/); + name = nameSplit[0]; + size *= Number(nameSplit[1]); + } + + if (!name.match(maskRegex)) { + uniforms[name] = { + value: defaultValue(type, size), + name: name, + type: type + }; + } + } + } + + return uniforms; +} +//# sourceMappingURL=extractUniformsFromSrc.js.map + +/***/ }), +/* 540 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.calculateScreenSpaceMatrix = calculateScreenSpaceMatrix; +exports.calculateNormalizedScreenSpaceMatrix = calculateNormalizedScreenSpaceMatrix; +exports.calculateSpriteMatrix = calculateSpriteMatrix; + +var _math = __webpack_require__(8); /** - * Helper class to create a webGL Texture - * - * @class - * @memberof PIXI + * Calculates the mapped matrix + * @param filterArea {Rectangle} The filter area + * @param sprite {Sprite} the target sprite + * @param outputMatrix {Matrix} @alvin */ -var TextureManager = function () { - /** - * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer - */ - function TextureManager(renderer) { - _classCallCheck(this, TextureManager); +// TODO playing around here.. this is temporary - (will end up in the shader) +// this returns a matrix that will normalise map filter cords in the filter to screen space +function calculateScreenSpaceMatrix(outputMatrix, filterArea, textureSize) { + // let worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX), + // let texture = {width:1136, height:700};//sprite._texture.baseTexture; - /** - * A reference to the current renderer - * - * @member {PIXI.WebGLRenderer} - */ - this.renderer = renderer; + // TODO unwrap? + var mappedMatrix = outputMatrix.identity(); - /** - * The current WebGL rendering context - * - * @member {WebGLRenderingContext} - */ - this.gl = renderer.gl; + mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height); - /** - * Track textures in the renderer so we can no longer listen to them on destruction. - * - * @member {Array<*>} - * @private - */ - this._managedTextures = []; - } + mappedMatrix.scale(textureSize.width, textureSize.height); - /** - * Binds a texture. - * - */ + return mappedMatrix; +} +function calculateNormalizedScreenSpaceMatrix(outputMatrix, filterArea, textureSize) { + var mappedMatrix = outputMatrix.identity(); - TextureManager.prototype.bindTexture = function bindTexture() {} - // empty + mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height); + var translateScaleX = textureSize.width / filterArea.width; + var translateScaleY = textureSize.height / filterArea.height; - /** - * Gets a texture. - * - */ - ; + mappedMatrix.scale(translateScaleX, translateScaleY); - TextureManager.prototype.getTexture = function getTexture() {} - // empty + return mappedMatrix; +} +// this will map the filter coord so that a texture can be used based on the transform of a sprite +function calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite) { + var texture = sprite._texture.baseTexture; + var mappedMatrix = outputMatrix.set(textureSize.width, 0, 0, textureSize.height, filterArea.x, filterArea.y); + var worldTransform = sprite.worldTransform.copy(_math.Matrix.TEMP_MATRIX); - /** - * Updates and/or Creates a WebGL texture for the renderer's context. - * - * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to update - * @param {Number} location - the location the texture will be bound to. - * @return {GLTexture} The gl texture. - */ - ; + worldTransform.invert(); + mappedMatrix.prepend(worldTransform); + mappedMatrix.scale(1.0 / texture.width, 1.0 / texture.height); + mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y); - TextureManager.prototype.updateTexture = function updateTexture(texture, location) { - // assume it good! - // texture = texture.baseTexture || texture; + return mappedMatrix; +} +//# sourceMappingURL=filterTransforms.js.map - var gl = this.gl; +/***/ }), +/* 541 */ +/***/ (function(module, exports, __webpack_require__) { - var isRenderTexture = !!texture._glRenderTargets; +"use strict"; - if (!texture.hasLoaded) { - return null; - } - var boundTextures = this.renderer.boundTextures; +exports.__esModule = true; - // if the location is undefined then this may have been called by n event. - // this being the case the texture may already be bound to a slot. As a texture can only be bound once - // we need to find its current location if it exists. - if (location === undefined) { - location = 0; +var _WebGLManager2 = __webpack_require__(57); - // TODO maybe we can use texture bound ids later on... - // check if texture is already bound.. - for (var i = 0; i < boundTextures.length; ++i) { - if (boundTextures[i] === texture) { - location = i; - break; - } - } - } +var _WebGLManager3 = _interopRequireDefault(_WebGLManager2); - boundTextures[location] = texture; +var _RenderTarget = __webpack_require__(83); - gl.activeTexture(gl.TEXTURE0 + location); +var _RenderTarget2 = _interopRequireDefault(_RenderTarget); - var glTexture = texture._glTextures[this.renderer.CONTEXT_UID]; +var _Quad = __webpack_require__(248); - if (!glTexture) { - if (isRenderTexture) { - var renderTarget = new _RenderTarget2.default(this.gl, texture.width, texture.height, texture.scaleMode, texture.resolution); +var _Quad2 = _interopRequireDefault(_Quad); - renderTarget.resize(texture.width, texture.height); - texture._glRenderTargets[this.renderer.CONTEXT_UID] = renderTarget; - glTexture = renderTarget.texture; - } else { - glTexture = new _pixiGlCore.GLTexture(this.gl, null, null, null, null); - glTexture.bind(location); - glTexture.premultiplyAlpha = true; - glTexture.upload(texture.source); - } +var _math = __webpack_require__(8); - texture._glTextures[this.renderer.CONTEXT_UID] = glTexture; +var _Shader = __webpack_require__(54); - texture.on('update', this.updateTexture, this); - texture.on('dispose', this.destroyTexture, this); +var _Shader2 = _interopRequireDefault(_Shader); - this._managedTextures.push(texture); +var _filterTransforms = __webpack_require__(540); - if (texture.isPowerOfTwo) { - if (texture.mipmap) { - glTexture.enableMipmap(); - } +var filterTransforms = _interopRequireWildcard(_filterTransforms); - if (texture.wrapMode === _const.WRAP_MODES.CLAMP) { - glTexture.enableWrapClamp(); - } else if (texture.wrapMode === _const.WRAP_MODES.REPEAT) { - glTexture.enableWrapRepeat(); - } else { - glTexture.enableWrapMirrorRepeat(); - } - } else { - glTexture.enableWrapClamp(); - } +var _bitTwiddle = __webpack_require__(87); - if (texture.scaleMode === _const.SCALE_MODES.NEAREST) { - glTexture.enableNearestScaling(); - } else { - glTexture.enableLinearScaling(); - } - } - // the texture already exists so we only need to update it.. - else if (isRenderTexture) { - texture._glRenderTargets[this.renderer.CONTEXT_UID].resize(texture.width, texture.height); - } else { - glTexture.upload(texture.source); - } +var _bitTwiddle2 = _interopRequireDefault(_bitTwiddle); - return glTexture; - }; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - /** - * Deletes the texture from WebGL - * - * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to destroy - * @param {boolean} [skipRemove=false] - Whether to skip removing the texture from the TextureManager. - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - TextureManager.prototype.destroyTexture = function destroyTexture(texture, skipRemove) { - texture = texture.baseTexture || texture; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - if (!texture.hasLoaded) { - return; - } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - if (texture._glTextures[this.renderer.CONTEXT_UID]) { - this.renderer.unbindTexture(texture); +/** + * @ignore + * @class + */ +var FilterState = +/** + * + */ +function FilterState() { + _classCallCheck(this, FilterState); - texture._glTextures[this.renderer.CONTEXT_UID].destroy(); - texture.off('update', this.updateTexture, this); - texture.off('dispose', this.destroyTexture, this); + this.renderTarget = null; + this.sourceFrame = new _math.Rectangle(); + this.destinationFrame = new _math.Rectangle(); + this.filters = []; + this.target = null; + this.resolution = 1; +}; - delete texture._glTextures[this.renderer.CONTEXT_UID]; +/** + * @class + * @memberof PIXI + * @extends PIXI.WebGLManager + */ - if (!skipRemove) { - var i = this._managedTextures.indexOf(texture); - if (i !== -1) { - (0, _utils.removeItems)(this._managedTextures, i, 1); - } - } - } - }; +var FilterManager = function (_WebGLManager) { + _inherits(FilterManager, _WebGLManager); /** - * Deletes all the textures from WebGL + * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. */ + function FilterManager(renderer) { + _classCallCheck(this, FilterManager); + var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer)); - TextureManager.prototype.removeAll = function removeAll() { - // empty all the old gl textures as they are useless now - for (var i = 0; i < this._managedTextures.length; ++i) { - var texture = this._managedTextures[i]; + _this.gl = _this.renderer.gl; + // know about sprites! + _this.quad = new _Quad2.default(_this.gl, renderer.state.attribState); - if (texture._glTextures[this.renderer.CONTEXT_UID]) { - delete texture._glTextures[this.renderer.CONTEXT_UID]; - } - } - }; + _this.shaderCache = {}; + // todo add default! + _this.pool = {}; + + _this.filterData = null; + + _this.managedFilters = []; + return _this; + } /** - * Destroys this manager and removes all its textures + * Adds a new filter to the manager. + * + * @param {PIXI.DisplayObject} target - The target of the filter to render. + * @param {PIXI.Filter[]} filters - The filters to apply. */ - TextureManager.prototype.destroy = function destroy() { - // destroy managed textures - for (var i = 0; i < this._managedTextures.length; ++i) { - var texture = this._managedTextures[i]; + FilterManager.prototype.pushFilter = function pushFilter(target, filters) { + var renderer = this.renderer; - this.destroyTexture(texture, true); + var filterData = this.filterData; - texture.off('update', this.updateTexture, this); - texture.off('dispose', this.destroyTexture, this); + if (!filterData) { + filterData = this.renderer._activeRenderTarget.filterStack; + + // add new stack + var filterState = new FilterState(); + + filterState.sourceFrame = filterState.destinationFrame = this.renderer._activeRenderTarget.size; + filterState.renderTarget = renderer._activeRenderTarget; + + this.renderer._activeRenderTarget.filterData = filterData = { + index: 0, + stack: [filterState] + }; + + this.filterData = filterData; } - this._managedTextures = null; - }; + // get the current filter state.. + var currentState = filterData.stack[++filterData.index]; - return TextureManager; -}(); + if (!currentState) { + currentState = filterData.stack[filterData.index] = new FilterState(); + } -exports.default = TextureManager; -//# sourceMappingURL=TextureManager.js.map + // for now we go off the filter of the first resolution.. + var resolution = filters[0].resolution; + var padding = filters[0].padding | 0; + var targetBounds = target.filterArea || target.getBounds(true); + var sourceFrame = currentState.sourceFrame; + var destinationFrame = currentState.destinationFrame; -/***/ }), -/* 540 */ -/***/ (function(module, exports, __webpack_require__) { + sourceFrame.x = (targetBounds.x * resolution | 0) / resolution; + sourceFrame.y = (targetBounds.y * resolution | 0) / resolution; + sourceFrame.width = (targetBounds.width * resolution | 0) / resolution; + sourceFrame.height = (targetBounds.height * resolution | 0) / resolution; -"use strict"; + if (filterData.stack[0].renderTarget.transform) {// + // TODO we should fit the rect around the transform.. + } else if (filters[0].autoFit) { + sourceFrame.fit(filterData.stack[0].destinationFrame); + } -exports.__esModule = true; + // lets apply the padding After we fit the element to the screen. + // this should stop the strange side effects that can occur when cropping to the edges + sourceFrame.pad(padding); -var _mapWebGLBlendModesToPixi = __webpack_require__(547); + destinationFrame.width = sourceFrame.width; + destinationFrame.height = sourceFrame.height; -var _mapWebGLBlendModesToPixi2 = _interopRequireDefault(_mapWebGLBlendModesToPixi); + // lets play the padding after we fit the element to the screen. + // this should stop the strange side effects that can occur when cropping to the edges -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + currentState.target = target; + currentState.filters = filters; + currentState.resolution = resolution; + currentState.renderTarget = renderTarget; -var BLEND = 0; -var DEPTH_TEST = 1; -var FRONT_FACE = 2; -var CULL_FACE = 3; -var BLEND_FUNC = 4; + // bind the render target to draw the shape in the top corner.. -/** - * A WebGL state machines - * - * @memberof PIXI - * @class - */ + renderTarget.setFrame(destinationFrame, sourceFrame); + + // bind the render target + renderer.bindRenderTarget(renderTarget); + renderTarget.clear(); + }; -var WebGLState = function () { /** - * @param {WebGLRenderingContext} gl - The current WebGL rendering context + * Pops off the filter and applies it. + * */ - function WebGLState(gl) { - _classCallCheck(this, WebGLState); - /** - * The current active state - * - * @member {Uint8Array} - */ - this.activeState = new Uint8Array(16); - /** - * The default state - * - * @member {Uint8Array} - */ - this.defaultState = new Uint8Array(16); + FilterManager.prototype.popFilter = function popFilter() { + var filterData = this.filterData; - // default blend mode.. - this.defaultState[0] = 1; + var lastState = filterData.stack[filterData.index - 1]; + var currentState = filterData.stack[filterData.index]; - /** - * The current state index in the stack - * - * @member {number} - * @private - */ - this.stackIndex = 0; + this.quad.map(currentState.renderTarget.size, currentState.sourceFrame).upload(); - /** - * The stack holding all the different states - * - * @member {Array<*>} - * @private - */ - this.stack = []; + var filters = currentState.filters; - /** - * The current WebGL rendering context - * - * @member {WebGLRenderingContext} - */ - this.gl = gl; + if (filters.length === 1) { + filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false, currentState); + this.freePotRenderTarget(currentState.renderTarget); + } else { + var flip = currentState.renderTarget; + var flop = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, currentState.resolution); - this.maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS); + flop.setFrame(currentState.destinationFrame, currentState.sourceFrame); - this.attribState = { - tempAttribState: new Array(this.maxAttribs), - attribState: new Array(this.maxAttribs) - }; + // finally lets clear the render target before drawing to it.. + flop.clear(); - this.blendModes = (0, _mapWebGLBlendModesToPixi2.default)(gl); + var i = 0; - // check we have vao.. - this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || gl.getExtension('MOZ_OES_vertex_array_object') || gl.getExtension('WEBKIT_OES_vertex_array_object'); - } + for (i = 0; i < filters.length - 1; ++i) { + filters[i].apply(this, flip, flop, true, currentState); - /** - * Pushes a new active state - */ + var t = flip; + flip = flop; + flop = t; + } - WebGLState.prototype.push = function push() { - // next state.. - var state = this.stack[++this.stackIndex]; + filters[i].apply(this, flip, lastState.renderTarget, false, currentState); - if (!state) { - state = this.stack[this.stackIndex] = new Uint8Array(16); + this.freePotRenderTarget(flip); + this.freePotRenderTarget(flop); } - // copy state.. - // set active state so we can force overrides of gl state - for (var i = 0; i < this.activeState.length; i++) { - this.activeState[i] = state[i]; + filterData.index--; + + if (filterData.index === 0) { + this.filterData = null; } }; /** - * Pops a state out + * Draws a filter. + * + * @param {PIXI.Filter} filter - The filter to draw. + * @param {PIXI.RenderTarget} input - The input render target. + * @param {PIXI.RenderTarget} output - The target to output to. + * @param {boolean} clear - Should the output be cleared before rendering to it */ - WebGLState.prototype.pop = function pop() { - var state = this.stack[--this.stackIndex]; - - this.setState(state); - }; + FilterManager.prototype.applyFilter = function applyFilter(filter, input, output, clear) { + var renderer = this.renderer; + var gl = renderer.gl; - /** - * Sets the current state - * - * @param {*} state - The state to set. - */ + var shader = filter.glShaders[renderer.CONTEXT_UID]; + // cacheing.. + if (!shader) { + if (filter.glShaderKey) { + shader = this.shaderCache[filter.glShaderKey]; - WebGLState.prototype.setState = function setState(state) { - this.setBlend(state[BLEND]); - this.setDepthTest(state[DEPTH_TEST]); - this.setFrontFace(state[FRONT_FACE]); - this.setCullFace(state[CULL_FACE]); - this.setBlendMode(state[BLEND_FUNC]); - }; + if (!shader) { + shader = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc); - /** - * Enables or disabled blending. - * - * @param {boolean} value - Turn on or off webgl blending. - */ + filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader; + } + } else { + shader = filter.glShaders[renderer.CONTEXT_UID] = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc); + } + this.managedFilters.push(filter); - WebGLState.prototype.setBlend = function setBlend(value) { - value = value ? 1 : 0; + // TODO - this only needs to be done once? + renderer.bindVao(null); - if (this.activeState[BLEND] === value) { - return; + this.quad.initVao(shader); } - this.activeState[BLEND] = value; - this.gl[value ? 'enable' : 'disable'](this.gl.BLEND); - }; + renderer.bindVao(this.quad.vao); - /** - * Sets the blend mode. - * - * @param {number} value - The blend mode to set to. - */ + renderer.bindRenderTarget(output); + if (clear) { + gl.disable(gl.SCISSOR_TEST); + renderer.clear(); // [1, 1, 1, 1]); + gl.enable(gl.SCISSOR_TEST); + } - WebGLState.prototype.setBlendMode = function setBlendMode(value) { - if (value === this.activeState[BLEND_FUNC]) { - return; + // in case the render target is being masked using a scissor rect + if (output === renderer.maskManager.scissorRenderTarget) { + renderer.maskManager.pushScissorMask(null, renderer.maskManager.scissorData); } - this.activeState[BLEND_FUNC] = value; + renderer.bindShader(shader); - this.gl.blendFunc(this.blendModes[value][0], this.blendModes[value][1]); - }; + // free unit 0 for us, doesn't matter what was there + // don't try to restore it, because syncUniforms can upload it to another slot + // and it'll be a problem + var tex = this.renderer.emptyTextures[0]; - /** - * Sets whether to enable or disable depth test. - * - * @param {boolean} value - Turn on or off webgl depth testing. - */ + this.renderer.boundTextures[0] = tex; + // this syncs the PixiJS filters uniforms with glsl uniforms + this.syncUniforms(shader, filter); + renderer.state.setBlendMode(filter.blendMode); - WebGLState.prototype.setDepthTest = function setDepthTest(value) { - value = value ? 1 : 0; + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, input.texture.texture); - if (this.activeState[DEPTH_TEST] === value) { - return; - } + this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0); - this.activeState[DEPTH_TEST] = value; - this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST); + gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture); }; /** - * Sets whether to enable or disable cull face. + * Uploads the uniforms of the filter. * - * @param {boolean} value - Turn on or off webgl cull face. + * @param {GLShader} shader - The underlying gl shader. + * @param {PIXI.Filter} filter - The filter we are synchronizing. */ - WebGLState.prototype.setCullFace = function setCullFace(value) { - value = value ? 1 : 0; + FilterManager.prototype.syncUniforms = function syncUniforms(shader, filter) { + var uniformData = filter.uniformData; + var uniforms = filter.uniforms; - if (this.activeState[CULL_FACE] === value) { - return; - } + // 0 is reserved for the PixiJS texture so we start at 1! + var textureCount = 1; + var currentState = void 0; - this.activeState[CULL_FACE] = value; - this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE); - }; + // filterArea and filterClamp that are handled by FilterManager directly + // they must not appear in uniformData - /** - * Sets the gl front face. - * - * @param {boolean} value - true is clockwise and false is counter-clockwise - */ + if (shader.uniforms.filterArea) { + currentState = this.filterData.stack[this.filterData.index]; + var filterArea = shader.uniforms.filterArea; - WebGLState.prototype.setFrontFace = function setFrontFace(value) { - value = value ? 1 : 0; + filterArea[0] = currentState.renderTarget.size.width; + filterArea[1] = currentState.renderTarget.size.height; + filterArea[2] = currentState.sourceFrame.x; + filterArea[3] = currentState.sourceFrame.y; - if (this.activeState[FRONT_FACE] === value) { - return; + shader.uniforms.filterArea = filterArea; } - this.activeState[FRONT_FACE] = value; - this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']); - }; + // use this to clamp displaced texture coords so they belong to filterArea + // see displacementFilter fragment shader for an example + if (shader.uniforms.filterClamp) { + currentState = currentState || this.filterData.stack[this.filterData.index]; - /** - * Disables all the vaos in use - * - */ + var filterClamp = shader.uniforms.filterClamp; + filterClamp[0] = 0; + filterClamp[1] = 0; + filterClamp[2] = (currentState.sourceFrame.width - 1) / currentState.renderTarget.size.width; + filterClamp[3] = (currentState.sourceFrame.height - 1) / currentState.renderTarget.size.height; - WebGLState.prototype.resetAttributes = function resetAttributes() { - for (var i = 0; i < this.attribState.tempAttribState.length; i++) { - this.attribState.tempAttribState[i] = 0; + shader.uniforms.filterClamp = filterClamp; } - for (var _i = 0; _i < this.attribState.attribState.length; _i++) { - this.attribState.attribState[_i] = 0; - } + // TODO Cacheing layer.. + for (var i in uniformData) { + var type = uniformData[i].type; - // im going to assume one is always active for performance reasons. - for (var _i2 = 1; _i2 < this.maxAttribs; _i2++) { - this.gl.disableVertexAttribArray(_i2); - } - }; + if (type === 'sampler2d' && uniforms[i] !== 0) { + if (uniforms[i].baseTexture) { + shader.uniforms[i] = this.renderer.bindTexture(uniforms[i].baseTexture, textureCount); + } else { + shader.uniforms[i] = textureCount; - // used - /** - * Resets all the logic and disables the vaos - */ + // TODO + // this is helpful as renderTargets can also be set. + // Although thinking about it, we could probably + // make the filter texture cache return a RenderTexture + // rather than a renderTarget + var gl = this.renderer.gl; + this.renderer.boundTextures[textureCount] = this.renderer.emptyTextures[textureCount]; + gl.activeTexture(gl.TEXTURE0 + textureCount); - WebGLState.prototype.resetToDefault = function resetToDefault() { - // unbind any VAO if they exist.. - if (this.nativeVaoExtension) { - this.nativeVaoExtension.bindVertexArrayOES(null); - } + uniforms[i].texture.bind(); + } - // reset all attributes.. - this.resetAttributes(); + textureCount++; + } else if (type === 'mat3') { + // check if its PixiJS matrix.. + if (uniforms[i].a !== undefined) { + shader.uniforms[i] = uniforms[i].toArray(true); + } else { + shader.uniforms[i] = uniforms[i]; + } + } else if (type === 'vec2') { + // check if its a point.. + if (uniforms[i].x !== undefined) { + var val = shader.uniforms[i] || new Float32Array(2); - // set active state so we can force overrides of gl state - for (var i = 0; i < this.activeState.length; ++i) { - this.activeState[i] = 32; + val[0] = uniforms[i].x; + val[1] = uniforms[i].y; + shader.uniforms[i] = val; + } else { + shader.uniforms[i] = uniforms[i]; + } + } else if (type === 'float') { + if (shader.uniforms.data[i].value !== uniformData[i]) { + shader.uniforms[i] = uniforms[i]; + } + } else { + shader.uniforms[i] = uniforms[i]; + } } - - this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false); - - this.setState(this.defaultState); }; - return WebGLState; -}(); + /** + * Gets a render target from the pool, or creates a new one. + * + * @param {boolean} clear - Should we clear the render texture when we get it? + * @param {number} resolution - The resolution of the target. + * @return {PIXI.RenderTarget} The new render target + */ -exports.default = WebGLState; -//# sourceMappingURL=WebGLState.js.map -/***/ }), -/* 541 */ -/***/ (function(module, exports, __webpack_require__) { + FilterManager.prototype.getRenderTarget = function getRenderTarget(clear, resolution) { + var currentState = this.filterData.stack[this.filterData.index]; + var renderTarget = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, resolution || currentState.resolution); -"use strict"; + renderTarget.setFrame(currentState.destinationFrame, currentState.sourceFrame); + return renderTarget; + }; -exports.__esModule = true; -exports.default = extractUniformsFromSrc; + /** + * Returns a render target to the pool. + * + * @param {PIXI.RenderTarget} renderTarget - The render target to return. + */ -var _pixiGlCore = __webpack_require__(15); -var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); + FilterManager.prototype.returnRenderTarget = function returnRenderTarget(renderTarget) { + this.freePotRenderTarget(renderTarget); + }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * Calculates the mapped matrix. + * + * TODO playing around here.. this is temporary - (will end up in the shader) + * this returns a matrix that will normalise map filter cords in the filter to screen space + * + * @param {PIXI.Matrix} outputMatrix - the matrix to output to. + * @return {PIXI.Matrix} The mapped matrix. + */ -var defaultValue = _pixiGlCore2.default.shader.defaultValue; -function extractUniformsFromSrc(vertexSrc, fragmentSrc, mask) { - var vertUniforms = extractUniformsFromString(vertexSrc, mask); - var fragUniforms = extractUniformsFromString(fragmentSrc, mask); + FilterManager.prototype.calculateScreenSpaceMatrix = function calculateScreenSpaceMatrix(outputMatrix) { + var currentState = this.filterData.stack[this.filterData.index]; - return Object.assign(vertUniforms, fragUniforms); -} + return filterTransforms.calculateScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size); + }; -function extractUniformsFromString(string) { - var maskRegex = new RegExp('^(projectionMatrix|uSampler|filterArea)$'); + /** + * Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea + * + * @param {PIXI.Matrix} outputMatrix - The matrix to output to. + * @return {PIXI.Matrix} The mapped matrix. + */ - var uniforms = {}; - var nameSplit = void 0; - // clean the lines a little - remove extra spaces / tabs etc - // then split along ';' - var lines = string.replace(/\s+/g, ' ').split(/\s*;\s*/); + FilterManager.prototype.calculateNormalizedScreenSpaceMatrix = function calculateNormalizedScreenSpaceMatrix(outputMatrix) { + var currentState = this.filterData.stack[this.filterData.index]; - // loop through.. - for (var i = 0; i < lines.length; i++) { - var line = lines[i].trim(); + return filterTransforms.calculateNormalizedScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, currentState.destinationFrame); + }; - if (line.indexOf('uniform') > -1) { - var splitLine = line.split(' '); - var type = splitLine[1]; + /** + * This will map the filter coord so that a texture can be used based on the transform of a sprite + * + * @param {PIXI.Matrix} outputMatrix - The matrix to output to. + * @param {PIXI.Sprite} sprite - The sprite to map to. + * @return {PIXI.Matrix} The mapped matrix. + */ - var name = splitLine[2]; - var size = 1; - if (name.indexOf('[') > -1) { - // array! - nameSplit = name.split(/\[|]/); - name = nameSplit[0]; - size *= Number(nameSplit[1]); - } + FilterManager.prototype.calculateSpriteMatrix = function calculateSpriteMatrix(outputMatrix, sprite) { + var currentState = this.filterData.stack[this.filterData.index]; - if (!name.match(maskRegex)) { - uniforms[name] = { - value: defaultValue(type, size), - name: name, - type: type - }; - } - } - } + return filterTransforms.calculateSpriteMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, sprite); + }; - return uniforms; -} -//# sourceMappingURL=extractUniformsFromSrc.js.map + /** + * Destroys this Filter Manager. + * + * @param {boolean} [contextLost=false] context was lost, do not free shaders + * + */ -/***/ }), -/* 542 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + FilterManager.prototype.destroy = function destroy() { + var contextLost = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var renderer = this.renderer; + var filters = this.managedFilters; -exports.__esModule = true; -exports.calculateScreenSpaceMatrix = calculateScreenSpaceMatrix; -exports.calculateNormalizedScreenSpaceMatrix = calculateNormalizedScreenSpaceMatrix; -exports.calculateSpriteMatrix = calculateSpriteMatrix; + for (var i = 0; i < filters.length; i++) { + if (!contextLost) { + filters[i].glShaders[renderer.CONTEXT_UID].destroy(); + } + delete filters[i].glShaders[renderer.CONTEXT_UID]; + } -var _math = __webpack_require__(7); + this.shaderCache = {}; + if (!contextLost) { + this.emptyPool(); + } else { + this.pool = {}; + } + }; -/* - * Calculates the mapped matrix - * @param filterArea {Rectangle} The filter area - * @param sprite {Sprite} the target sprite - * @param outputMatrix {Matrix} @alvin - */ -// TODO playing around here.. this is temporary - (will end up in the shader) -// this returns a matrix that will normalise map filter cords in the filter to screen space -function calculateScreenSpaceMatrix(outputMatrix, filterArea, textureSize) { - // let worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX), - // let texture = {width:1136, height:700};//sprite._texture.baseTexture; + /** + * Gets a Power-of-Two render texture. + * + * TODO move to a seperate class could be on renderer? + * also - could cause issue with multiple contexts? + * + * @private + * @param {WebGLRenderingContext} gl - The webgl rendering context + * @param {number} minWidth - The minimum width of the render target. + * @param {number} minHeight - The minimum height of the render target. + * @param {number} resolution - The resolution of the render target. + * @return {PIXI.RenderTarget} The new render target. + */ - // TODO unwrap? - var mappedMatrix = outputMatrix.identity(); - mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height); + FilterManager.prototype.getPotRenderTarget = function getPotRenderTarget(gl, minWidth, minHeight, resolution) { + // TODO you could return a bigger texture if there is not one in the pool? + minWidth = _bitTwiddle2.default.nextPow2(minWidth * resolution); + minHeight = _bitTwiddle2.default.nextPow2(minHeight * resolution); - mappedMatrix.scale(textureSize.width, textureSize.height); + var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF; - return mappedMatrix; -} + if (!this.pool[key]) { + this.pool[key] = []; + } -function calculateNormalizedScreenSpaceMatrix(outputMatrix, filterArea, textureSize) { - var mappedMatrix = outputMatrix.identity(); + var renderTarget = this.pool[key].pop(); - mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height); + // creating render target will cause texture to be bound! + if (!renderTarget) { + // temporary bypass cache.. + var tex = this.renderer.boundTextures[0]; - var translateScaleX = textureSize.width / filterArea.width; - var translateScaleY = textureSize.height / filterArea.height; + gl.activeTexture(gl.TEXTURE0); - mappedMatrix.scale(translateScaleX, translateScaleY); + // internally - this will cause a texture to be bound.. + renderTarget = new _RenderTarget2.default(gl, minWidth, minHeight, null, 1); - return mappedMatrix; -} + // set the current one back + gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture); + } -// this will map the filter coord so that a texture can be used based on the transform of a sprite -function calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite) { - var worldTransform = sprite.worldTransform.copy(_math.Matrix.TEMP_MATRIX); - var texture = sprite._texture.baseTexture; + // manually tweak the resolution... + // this will not modify the size of the frame buffer, just its resolution. + renderTarget.resolution = resolution; + renderTarget.defaultFrame.width = renderTarget.size.width = minWidth / resolution; + renderTarget.defaultFrame.height = renderTarget.size.height = minHeight / resolution; - // TODO unwrap? - var mappedMatrix = outputMatrix.identity(); + return renderTarget; + }; - // scale.. - var ratio = textureSize.height / textureSize.width; + /** + * Empties the texture pool. + * + */ - mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height); - mappedMatrix.scale(1, ratio); + FilterManager.prototype.emptyPool = function emptyPool() { + for (var i in this.pool) { + var textures = this.pool[i]; - var translateScaleX = textureSize.width / texture.width; - var translateScaleY = textureSize.height / texture.height; + if (textures) { + for (var j = 0; j < textures.length; j++) { + textures[j].destroy(true); + } + } + } - worldTransform.tx /= texture.width * translateScaleX; + this.pool = {}; + }; - // this...? free beer for anyone who can explain why this makes sense! - worldTransform.ty /= texture.width * translateScaleX; - // worldTransform.ty /= texture.height * translateScaleY; + /** + * Frees a render target back into the pool. + * + * @param {PIXI.RenderTarget} renderTarget - The renderTarget to free + */ - worldTransform.invert(); - mappedMatrix.prepend(worldTransform); - // apply inverse scale.. - mappedMatrix.scale(1, 1 / ratio); + FilterManager.prototype.freePotRenderTarget = function freePotRenderTarget(renderTarget) { + var minWidth = renderTarget.size.width * renderTarget.resolution; + var minHeight = renderTarget.size.height * renderTarget.resolution; + var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF; - mappedMatrix.scale(translateScaleX, translateScaleY); + this.pool[key].push(renderTarget); + }; - mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y); + return FilterManager; +}(_WebGLManager3.default); - return mappedMatrix; -} -//# sourceMappingURL=filterTransforms.js.map +exports.default = FilterManager; +//# sourceMappingURL=FilterManager.js.map /***/ }), -/* 543 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57188,568 +60032,564 @@ function calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite) { exports.__esModule = true; -var _WebGLManager2 = __webpack_require__(55); +var _WebGLManager2 = __webpack_require__(57); var _WebGLManager3 = _interopRequireDefault(_WebGLManager2); -var _RenderTarget = __webpack_require__(84); - -var _RenderTarget2 = _interopRequireDefault(_RenderTarget); - -var _Quad = __webpack_require__(246); - -var _Quad2 = _interopRequireDefault(_Quad); - -var _math = __webpack_require__(7); - -var _Shader = __webpack_require__(52); - -var _Shader2 = _interopRequireDefault(_Shader); - -var _filterTransforms = __webpack_require__(542); - -var filterTransforms = _interopRequireWildcard(_filterTransforms); - -var _bitTwiddle = __webpack_require__(88); +var _SpriteMaskFilter = __webpack_require__(247); -var _bitTwiddle2 = _interopRequireDefault(_bitTwiddle); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +var _SpriteMaskFilter2 = _interopRequireDefault(_SpriteMaskFilter); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -/** - * @ignore - * @class - */ -var FilterState = -/** - * - */ -function FilterState() { - _classCallCheck(this, FilterState); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - this.renderTarget = null; - this.sourceFrame = new _math.Rectangle(); - this.destinationFrame = new _math.Rectangle(); - this.filters = []; - this.target = null; - this.resolution = 1; -}; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * @class - * @memberof PIXI * @extends PIXI.WebGLManager + * @memberof PIXI */ - - -var FilterManager = function (_WebGLManager) { - _inherits(FilterManager, _WebGLManager); +var MaskManager = function (_WebGLManager) { + _inherits(MaskManager, _WebGLManager); /** * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. */ - function FilterManager(renderer) { - _classCallCheck(this, FilterManager); + function MaskManager(renderer) { + _classCallCheck(this, MaskManager); + // TODO - we don't need both! var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer)); - _this.gl = _this.renderer.gl; - // know about sprites! - _this.quad = new _Quad2.default(_this.gl, renderer.state.attribState); + _this.scissor = false; + _this.scissorData = null; + _this.scissorRenderTarget = null; - _this.shaderCache = {}; - // todo add default! - _this.pool = {}; + _this.enableScissor = true; - _this.filterData = null; + _this.alphaMaskPool = []; + _this.alphaMaskIndex = 0; return _this; } /** - * Adds a new filter to the manager. + * Applies the Mask and adds it to the current filter stack. * - * @param {PIXI.DisplayObject} target - The target of the filter to render. - * @param {PIXI.Filter[]} filters - The filters to apply. + * @param {PIXI.DisplayObject} target - Display Object to push the mask to + * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. */ - FilterManager.prototype.pushFilter = function pushFilter(target, filters) { - var renderer = this.renderer; - - var filterData = this.filterData; - - if (!filterData) { - filterData = this.renderer._activeRenderTarget.filterStack; + MaskManager.prototype.pushMask = function pushMask(target, maskData) { + // TODO the root check means scissor rect will not + // be used on render textures more info here: + // https://github.com/pixijs/pixi.js/pull/3545 - // add new stack - var filterState = new FilterState(); + if (maskData.texture) { + this.pushSpriteMask(target, maskData); + } else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) { + var matrix = maskData.worldTransform; - filterState.sourceFrame = filterState.destinationFrame = this.renderer._activeRenderTarget.size; - filterState.renderTarget = renderer._activeRenderTarget; + var rot = Math.atan2(matrix.b, matrix.a); - this.renderer._activeRenderTarget.filterData = filterData = { - index: 0, - stack: [filterState] - }; + // use the nearest degree! + rot = Math.round(rot * (180 / Math.PI)); - this.filterData = filterData; + if (rot % 90) { + this.pushStencilMask(maskData); + } else { + this.pushScissorMask(target, maskData); + } + } else { + this.pushStencilMask(maskData); } + }; - // get the current filter state.. - var currentState = filterData.stack[++filterData.index]; + /** + * Removes the last mask from the mask stack and doesn't return it. + * + * @param {PIXI.DisplayObject} target - Display Object to pop the mask from + * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. + */ - if (!currentState) { - currentState = filterData.stack[filterData.index] = new FilterState(); + + MaskManager.prototype.popMask = function popMask(target, maskData) { + if (maskData.texture) { + this.popSpriteMask(target, maskData); + } else if (this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length) { + this.popScissorMask(target, maskData); + } else { + this.popStencilMask(target, maskData); } + }; - // for now we go off the filter of the first resolution.. - var resolution = filters[0].resolution; - var padding = filters[0].padding | 0; - var targetBounds = target.filterArea || target.getBounds(true); - var sourceFrame = currentState.sourceFrame; - var destinationFrame = currentState.destinationFrame; + /** + * Applies the Mask and adds it to the current filter stack. + * + * @param {PIXI.RenderTarget} target - Display Object to push the sprite mask to + * @param {PIXI.Sprite} maskData - Sprite to be used as the mask + */ - sourceFrame.x = (targetBounds.x * resolution | 0) / resolution; - sourceFrame.y = (targetBounds.y * resolution | 0) / resolution; - sourceFrame.width = (targetBounds.width * resolution | 0) / resolution; - sourceFrame.height = (targetBounds.height * resolution | 0) / resolution; - if (filterData.stack[0].renderTarget.transform) {// + MaskManager.prototype.pushSpriteMask = function pushSpriteMask(target, maskData) { + var alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex]; - // TODO we should fit the rect around the transform.. - } else { - sourceFrame.fit(filterData.stack[0].destinationFrame); + if (!alphaMaskFilter) { + alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new _SpriteMaskFilter2.default(maskData)]; } - // lets apply the padding After we fit the element to the screen. - // this should stop the strange side effects that can occur when cropping to the edges - sourceFrame.pad(padding); - - destinationFrame.width = sourceFrame.width; - destinationFrame.height = sourceFrame.height; + alphaMaskFilter[0].resolution = this.renderer.resolution; + alphaMaskFilter[0].maskSprite = maskData; - // lets play the padding after we fit the element to the screen. - // this should stop the strange side effects that can occur when cropping to the edges + // TODO - may cause issues! + target.filterArea = maskData.getBounds(true); - var renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution); + this.renderer.filterManager.pushFilter(target, alphaMaskFilter); - currentState.target = target; - currentState.filters = filters; - currentState.resolution = resolution; - currentState.renderTarget = renderTarget; + this.alphaMaskIndex++; + }; - // bind the render target to draw the shape in the top corner.. + /** + * Removes the last filter from the filter stack and doesn't return it. + * + */ - renderTarget.setFrame(destinationFrame, sourceFrame); - // bind the render target - renderer.bindRenderTarget(renderTarget); - renderTarget.clear(); + MaskManager.prototype.popSpriteMask = function popSpriteMask() { + this.renderer.filterManager.popFilter(); + this.alphaMaskIndex--; }; /** - * Pops off the filter and applies it. + * Applies the Mask and adds it to the current filter stack. * + * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. */ - FilterManager.prototype.popFilter = function popFilter() { - var filterData = this.filterData; - - var lastState = filterData.stack[filterData.index - 1]; - var currentState = filterData.stack[filterData.index]; + MaskManager.prototype.pushStencilMask = function pushStencilMask(maskData) { + this.renderer.currentRenderer.stop(); + this.renderer.stencilManager.pushStencil(maskData); + }; - this.quad.map(currentState.renderTarget.size, currentState.sourceFrame).upload(); + /** + * Removes the last filter from the filter stack and doesn't return it. + * + */ - var filters = currentState.filters; - if (filters.length === 1) { - filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false); - this.freePotRenderTarget(currentState.renderTarget); - } else { - var flip = currentState.renderTarget; - var flop = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, currentState.resolution); + MaskManager.prototype.popStencilMask = function popStencilMask() { + this.renderer.currentRenderer.stop(); + this.renderer.stencilManager.popStencil(); + }; - flop.setFrame(currentState.destinationFrame, currentState.sourceFrame); + /** + * + * @param {PIXI.DisplayObject} target - Display Object to push the mask to + * @param {PIXI.Graphics} maskData - The masking data. + */ - // finally lets clear the render target before drawing to it.. - flop.clear(); - var i = 0; + MaskManager.prototype.pushScissorMask = function pushScissorMask(target, maskData) { + maskData.renderable = true; - for (i = 0; i < filters.length - 1; ++i) { - filters[i].apply(this, flip, flop, true); + var renderTarget = this.renderer._activeRenderTarget; - var t = flip; + var bounds = maskData.getBounds(); - flip = flop; - flop = t; - } + bounds.fit(renderTarget.size); + maskData.renderable = false; - filters[i].apply(this, flip, lastState.renderTarget, true); + this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST); - this.freePotRenderTarget(flip); - this.freePotRenderTarget(flop); - } + var resolution = this.renderer.resolution; - filterData.index--; + this.renderer.gl.scissor(bounds.x * resolution, (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution, bounds.width * resolution, bounds.height * resolution); - if (filterData.index === 0) { - this.filterData = null; - } + this.scissorRenderTarget = renderTarget; + this.scissorData = maskData; + this.scissor = true; }; /** - * Draws a filter. * - * @param {PIXI.Filter} filter - The filter to draw. - * @param {PIXI.RenderTarget} input - The input render target. - * @param {PIXI.RenderTarget} output - The target to output to. - * @param {boolean} clear - Should the output be cleared before rendering to it + * */ - FilterManager.prototype.applyFilter = function applyFilter(filter, input, output, clear) { - var renderer = this.renderer; - var gl = renderer.gl; + MaskManager.prototype.popScissorMask = function popScissorMask() { + this.scissorRenderTarget = null; + this.scissorData = null; + this.scissor = false; - var shader = filter.glShaders[renderer.CONTEXT_UID]; + // must be scissor! + var gl = this.renderer.gl; - // cacheing.. - if (!shader) { - if (filter.glShaderKey) { - shader = this.shaderCache[filter.glShaderKey]; + gl.disable(gl.SCISSOR_TEST); + }; - if (!shader) { - shader = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc); + return MaskManager; +}(_WebGLManager3.default); - filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader; - } - } else { - shader = filter.glShaders[renderer.CONTEXT_UID] = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc); - } +exports.default = MaskManager; +//# sourceMappingURL=MaskManager.js.map - // TODO - this only needs to be done once? - renderer.bindVao(null); +/***/ }), +/* 543 */ +/***/ (function(module, exports, __webpack_require__) { - this.quad.initVao(shader); - } +"use strict"; - renderer.bindVao(this.quad.vao); - renderer.bindRenderTarget(output); +exports.__esModule = true; - if (clear) { - gl.disable(gl.SCISSOR_TEST); - renderer.clear(); // [1, 1, 1, 1]); - gl.enable(gl.SCISSOR_TEST); - } +var _WebGLManager2 = __webpack_require__(57); - // in case the render target is being masked using a scissor rect - if (output === renderer.maskManager.scissorRenderTarget) { - renderer.maskManager.pushScissorMask(null, renderer.maskManager.scissorData); - } +var _WebGLManager3 = _interopRequireDefault(_WebGLManager2); - renderer.bindShader(shader); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - // this syncs the pixi filters uniforms with glsl uniforms - this.syncUniforms(shader, filter); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - renderer.state.setBlendMode(filter.blendMode); +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - // temporary bypass cache.. - var tex = this.renderer.boundTextures[0]; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - gl.activeTexture(gl.TEXTURE0); - gl.bindTexture(gl.TEXTURE_2D, input.texture.texture); +/** + * @class + * @extends PIXI.WebGLManager + * @memberof PIXI + */ +var StencilManager = function (_WebGLManager) { + _inherits(StencilManager, _WebGLManager); - this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0); + /** + * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. + */ + function StencilManager(renderer) { + _classCallCheck(this, StencilManager); - // restore cache. - gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture); - }; + var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer)); + + _this.stencilMaskStack = null; + return _this; + } /** - * Uploads the uniforms of the filter. + * Changes the mask stack that is used by this manager. * - * @param {GLShader} shader - The underlying gl shader. - * @param {PIXI.Filter} filter - The filter we are synchronizing. + * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack */ - FilterManager.prototype.syncUniforms = function syncUniforms(shader, filter) { - var uniformData = filter.uniformData; - var uniforms = filter.uniforms; + StencilManager.prototype.setMaskStack = function setMaskStack(stencilMaskStack) { + this.stencilMaskStack = stencilMaskStack; - // 0 is reserved for the pixi texture so we start at 1! - var textureCount = 1; - var currentState = void 0; + var gl = this.renderer.gl; - if (shader.uniforms.data.filterArea) { - currentState = this.filterData.stack[this.filterData.index]; - var filterArea = shader.uniforms.filterArea; + if (stencilMaskStack.length === 0) { + gl.disable(gl.STENCIL_TEST); + } else { + gl.enable(gl.STENCIL_TEST); + } + }; - filterArea[0] = currentState.renderTarget.size.width; - filterArea[1] = currentState.renderTarget.size.height; - filterArea[2] = currentState.sourceFrame.x; - filterArea[3] = currentState.sourceFrame.y; + /** + * Applies the Mask and adds it to the current stencil stack. @alvin + * + * @param {PIXI.Graphics} graphics - The mask + */ - shader.uniforms.filterArea = filterArea; - } - // use this to clamp displaced texture coords so they belong to filterArea - // see displacementFilter fragment shader for an example - if (shader.uniforms.data.filterClamp) { - currentState = this.filterData.stack[this.filterData.index]; + StencilManager.prototype.pushStencil = function pushStencil(graphics) { + this.renderer.setObjectRenderer(this.renderer.plugins.graphics); - var filterClamp = shader.uniforms.filterClamp; + this.renderer._activeRenderTarget.attachStencilBuffer(); - filterClamp[0] = 0; - filterClamp[1] = 0; - filterClamp[2] = (currentState.sourceFrame.width - 1) / currentState.renderTarget.size.width; - filterClamp[3] = (currentState.sourceFrame.height - 1) / currentState.renderTarget.size.height; + var gl = this.renderer.gl; + var prevMaskCount = this.stencilMaskStack.length; - shader.uniforms.filterClamp = filterClamp; + if (prevMaskCount === 0) { + gl.enable(gl.STENCIL_TEST); } - // TODO Cacheing layer.. - for (var i in uniformData) { - if (uniformData[i].type === 'sampler2D' && uniforms[i] !== 0) { - if (uniforms[i].baseTexture) { - shader.uniforms[i] = this.renderer.bindTexture(uniforms[i].baseTexture, textureCount); - } else { - shader.uniforms[i] = textureCount; + this.stencilMaskStack.push(graphics); - // TODO - // this is helpful as renderTargets can also be set. - // Although thinking about it, we could probably - // make the filter texture cache return a RenderTexture - // rather than a renderTarget - var gl = this.renderer.gl; + // Increment the refference stencil value where the new mask overlaps with the old ones. + gl.colorMask(false, false, false, false); + gl.stencilFunc(gl.EQUAL, prevMaskCount, this._getBitwiseMask()); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + this.renderer.plugins.graphics.render(graphics); - this.renderer.boundTextures[textureCount] = this.renderer.emptyTextures[textureCount]; - gl.activeTexture(gl.TEXTURE0 + textureCount); + this._useCurrent(); + }; - uniforms[i].texture.bind(); - } + /** + * Removes the last mask from the stencil stack. @alvin + */ - textureCount++; - } else if (uniformData[i].type === 'mat3') { - // check if its pixi matrix.. - if (uniforms[i].a !== undefined) { - shader.uniforms[i] = uniforms[i].toArray(true); - } else { - shader.uniforms[i] = uniforms[i]; - } - } else if (uniformData[i].type === 'vec2') { - // check if its a point.. - if (uniforms[i].x !== undefined) { - var val = shader.uniforms[i] || new Float32Array(2); - val[0] = uniforms[i].x; - val[1] = uniforms[i].y; - shader.uniforms[i] = val; - } else { - shader.uniforms[i] = uniforms[i]; - } - } else if (uniformData[i].type === 'float') { - if (shader.uniforms.data[i].value !== uniformData[i]) { - shader.uniforms[i] = uniforms[i]; - } - } else { - shader.uniforms[i] = uniforms[i]; - } + StencilManager.prototype.popStencil = function popStencil() { + this.renderer.setObjectRenderer(this.renderer.plugins.graphics); + + var gl = this.renderer.gl; + var graphics = this.stencilMaskStack.pop(); + + if (this.stencilMaskStack.length === 0) { + // the stack is empty! + gl.disable(gl.STENCIL_TEST); + gl.clear(gl.STENCIL_BUFFER_BIT); + gl.clearStencil(0); + } else { + // Decrement the refference stencil value where the popped mask overlaps with the other ones + gl.colorMask(false, false, false, false); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); + this.renderer.plugins.graphics.render(graphics); + + this._useCurrent(); } }; /** - * Gets a render target from the pool, or creates a new one. - * - * @param {boolean} clear - Should we clear the render texture when we get it? - * @param {number} resolution - The resolution of the target. - * @return {PIXI.RenderTarget} The new render target + * Setup renderer to use the current stencil data. */ - FilterManager.prototype.getRenderTarget = function getRenderTarget(clear, resolution) { - var currentState = this.filterData.stack[this.filterData.index]; - var renderTarget = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, resolution || currentState.resolution); - - renderTarget.setFrame(currentState.destinationFrame, currentState.sourceFrame); + StencilManager.prototype._useCurrent = function _useCurrent() { + var gl = this.renderer.gl; - return renderTarget; + gl.colorMask(true, true, true, true); + gl.stencilFunc(gl.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask()); + gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); }; /** - * Returns a render target to the pool. + * Fill 1s equal to the number of acitve stencil masks. * - * @param {PIXI.RenderTarget} renderTarget - The render target to return. + * @return {number} The bitwise mask. */ - FilterManager.prototype.returnRenderTarget = function returnRenderTarget(renderTarget) { - this.freePotRenderTarget(renderTarget); + StencilManager.prototype._getBitwiseMask = function _getBitwiseMask() { + return (1 << this.stencilMaskStack.length) - 1; }; /** - * Calculates the mapped matrix. - * - * TODO playing around here.. this is temporary - (will end up in the shader) - * this returns a matrix that will normalise map filter cords in the filter to screen space + * Destroys the mask stack. * - * @param {PIXI.Matrix} outputMatrix - the matrix to output to. - * @return {PIXI.Matrix} The mapped matrix. */ - FilterManager.prototype.calculateScreenSpaceMatrix = function calculateScreenSpaceMatrix(outputMatrix) { - var currentState = this.filterData.stack[this.filterData.index]; + StencilManager.prototype.destroy = function destroy() { + _WebGLManager3.default.prototype.destroy.call(this); - return filterTransforms.calculateScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size); + this.stencilMaskStack.stencilStack = null; }; - /** - * Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea - * - * @param {PIXI.Matrix} outputMatrix - The matrix to output to. - * @return {PIXI.Matrix} The mapped matrix. - */ + return StencilManager; +}(_WebGLManager3.default); +exports.default = StencilManager; +//# sourceMappingURL=StencilManager.js.map - FilterManager.prototype.calculateNormalizedScreenSpaceMatrix = function calculateNormalizedScreenSpaceMatrix(outputMatrix) { - var currentState = this.filterData.stack[this.filterData.index]; +/***/ }), +/* 544 */ +/***/ (function(module, exports, __webpack_require__) { - return filterTransforms.calculateNormalizedScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, currentState.destinationFrame); - }; +"use strict"; - /** - * This will map the filter coord so that a texture can be used based on the transform of a sprite - * - * @param {PIXI.Matrix} outputMatrix - The matrix to output to. - * @param {PIXI.Sprite} sprite - The sprite to map to. - * @return {PIXI.Matrix} The mapped matrix. - */ +exports.__esModule = true; +exports.default = checkMaxIfStatmentsInShader; - FilterManager.prototype.calculateSpriteMatrix = function calculateSpriteMatrix(outputMatrix, sprite) { - var currentState = this.filterData.stack[this.filterData.index]; +var _pixiGlCore = __webpack_require__(15); - return filterTransforms.calculateSpriteMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, sprite); - }; +var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); - /** - * Destroys this Filter Manager. - * - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var fragTemplate = ['precision mediump float;', 'void main(void){', 'float test = 0.1;', '%forloop%', 'gl_FragColor = vec4(0.0);', '}'].join('\n'); - FilterManager.prototype.destroy = function destroy() { - this.shaderCache = []; - this.emptyPool(); - }; +function checkMaxIfStatmentsInShader(maxIfs, gl) { + var createTempContext = !gl; - /** - * Gets a Power-of-Two render texture. - * - * TODO move to a seperate class could be on renderer? - * also - could cause issue with multiple contexts? - * - * @private - * @param {WebGLRenderingContext} gl - The webgl rendering context - * @param {number} minWidth - The minimum width of the render target. - * @param {number} minHeight - The minimum height of the render target. - * @param {number} resolution - The resolution of the render target. - * @return {PIXI.RenderTarget} The new render target. - */ + // @if DEBUG + if (maxIfs === 0) { + throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`'); + } + // @endif + + if (createTempContext) { + var tinyCanvas = document.createElement('canvas'); + + tinyCanvas.width = 1; + tinyCanvas.height = 1; + + gl = _pixiGlCore2.default.createContext(tinyCanvas); + } + + var shader = gl.createShader(gl.FRAGMENT_SHADER); + + while (true) // eslint-disable-line no-constant-condition + { + var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs)); + + gl.shaderSource(shader, fragmentSrc); + gl.compileShader(shader); + + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { + maxIfs = maxIfs / 2 | 0; + } else { + // valid! + break; + } + } + + if (createTempContext) { + // get rid of context + if (gl.getExtension('WEBGL_lose_context')) { + gl.getExtension('WEBGL_lose_context').loseContext(); + } + } + + return maxIfs; +} + +function generateIfTestSrc(maxIfs) { + var src = ''; + + for (var i = 0; i < maxIfs; ++i) { + if (i > 0) { + src += '\nelse '; + } + + if (i < maxIfs - 1) { + src += 'if(test == ' + i + '.0){}'; + } + } + + return src; +} +//# sourceMappingURL=checkMaxIfStatmentsInShader.js.map +/***/ }), +/* 545 */ +/***/ (function(module, exports, __webpack_require__) { - FilterManager.prototype.getPotRenderTarget = function getPotRenderTarget(gl, minWidth, minHeight, resolution) { - // TODO you could return a bigger texture if there is not one in the pool? - minWidth = _bitTwiddle2.default.nextPow2(minWidth * resolution); - minHeight = _bitTwiddle2.default.nextPow2(minHeight * resolution); +"use strict"; - var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF; - if (!this.pool[key]) { - this.pool[key] = []; - } +exports.__esModule = true; +exports.default = mapWebGLBlendModesToPixi; - var renderTarget = this.pool[key].pop(); +var _const = __webpack_require__(0); - // creating render target will cause texture to be bound! - if (!renderTarget) { - // temporary bypass cache.. - var tex = this.renderer.boundTextures[0]; +/** + * Maps gl blend combinations to WebGL. + * + * @memberof PIXI + * @function mapWebGLBlendModesToPixi + * @private + * @param {WebGLRenderingContext} gl - The rendering context. + * @param {string[]} [array=[]] - The array to output into. + * @return {string[]} Mapped modes. + */ +function mapWebGLBlendModesToPixi(gl) { + var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - gl.activeTexture(gl.TEXTURE0); + // TODO - premultiply alpha would be different. + // add a boolean for that! + array[_const.BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.ADD] = [gl.ONE, gl.DST_ALPHA]; + array[_const.BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR]; + array[_const.BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - // internally - this will cause a texture to be bound.. - renderTarget = new _RenderTarget2.default(gl, minWidth, minHeight, null, 1); + // not-premultiplied blend modes + array[_const.BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + array[_const.BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.DST_ALPHA, gl.ONE, gl.DST_ALPHA]; + array[_const.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_COLOR]; - // set the current one back - gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture); - } + return array; +} +//# sourceMappingURL=mapWebGLBlendModesToPixi.js.map - // manually tweak the resolution... - // this will not modify the size of the frame buffer, just its resolution. - renderTarget.resolution = resolution; - renderTarget.defaultFrame.width = renderTarget.size.width = minWidth / resolution; - renderTarget.defaultFrame.height = renderTarget.size.height = minHeight / resolution; +/***/ }), +/* 546 */ +/***/ (function(module, exports, __webpack_require__) { - return renderTarget; - }; +"use strict"; - /** - * Empties the texture pool. - * - */ +exports.__esModule = true; +exports.default = mapWebGLDrawModesToPixi; - FilterManager.prototype.emptyPool = function emptyPool() { - for (var i in this.pool) { - var textures = this.pool[i]; +var _const = __webpack_require__(0); - if (textures) { - for (var j = 0; j < textures.length; j++) { - textures[j].destroy(true); - } - } - } +/** + * Generic Mask Stack data structure. + * + * @memberof PIXI + * @function mapWebGLDrawModesToPixi + * @private + * @param {WebGLRenderingContext} gl - The current WebGL drawing context + * @param {object} [object={}] - The object to map into + * @return {object} The mapped draw modes. + */ +function mapWebGLDrawModesToPixi(gl) { + var object = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - this.pool = {}; - }; + object[_const.DRAW_MODES.POINTS] = gl.POINTS; + object[_const.DRAW_MODES.LINES] = gl.LINES; + object[_const.DRAW_MODES.LINE_LOOP] = gl.LINE_LOOP; + object[_const.DRAW_MODES.LINE_STRIP] = gl.LINE_STRIP; + object[_const.DRAW_MODES.TRIANGLES] = gl.TRIANGLES; + object[_const.DRAW_MODES.TRIANGLE_STRIP] = gl.TRIANGLE_STRIP; + object[_const.DRAW_MODES.TRIANGLE_FAN] = gl.TRIANGLE_FAN; - /** - * Frees a render target back into the pool. - * - * @param {PIXI.RenderTarget} renderTarget - The renderTarget to free - */ + return object; +} +//# sourceMappingURL=mapWebGLDrawModesToPixi.js.map +/***/ }), +/* 547 */ +/***/ (function(module, exports, __webpack_require__) { - FilterManager.prototype.freePotRenderTarget = function freePotRenderTarget(renderTarget) { - var minWidth = renderTarget.size.width * renderTarget.resolution; - var minHeight = renderTarget.size.height * renderTarget.resolution; - var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF; +"use strict"; - this.pool[key].push(renderTarget); - }; - return FilterManager; -}(_WebGLManager3.default); +exports.__esModule = true; +exports.default = validateContext; +function validateContext(gl) { + var attributes = gl.getContextAttributes(); -exports.default = FilterManager; -//# sourceMappingURL=FilterManager.js.map + // this is going to be fairly simple for now.. but at least we have room to grow! + if (!attributes.stencil) { + /* eslint-disable no-console */ + console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly'); + /* eslint-enable no-console */ + } +} +//# sourceMappingURL=validateContext.js.map /***/ }), -/* 544 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57757,224 +60597,259 @@ exports.default = FilterManager; exports.__esModule = true; -var _WebGLManager2 = __webpack_require__(55); +var _CanvasRenderer = __webpack_require__(56); -var _WebGLManager3 = _interopRequireDefault(_WebGLManager2); +var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); -var _SpriteMaskFilter = __webpack_require__(245); +var _const = __webpack_require__(0); -var _SpriteMaskFilter2 = _interopRequireDefault(_SpriteMaskFilter); +var _math = __webpack_require__(8); + +var _CanvasTinter = __webpack_require__(129); + +var _CanvasTinter2 = _interopRequireDefault(_CanvasTinter); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } +var canvasRenderWorldTransform = new _math.Matrix(); -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +/** + * @author Mat Groves + * + * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ + * for creating the original PixiJS version! + * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now + * share 4 bytes on the vertex buffer + * + * Heavily inspired by LibGDX's CanvasSpriteRenderer: + * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java + */ /** + * Renderer dedicated to drawing and batching sprites. + * * @class - * @extends PIXI.WebGLManager + * @private * @memberof PIXI */ -var MaskManager = function (_WebGLManager) { - _inherits(MaskManager, _WebGLManager); +var CanvasSpriteRenderer = function () { /** - * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. + * @param {PIXI.WebGLRenderer} renderer -The renderer sprite this batch works for. */ - function MaskManager(renderer) { - _classCallCheck(this, MaskManager); - - // TODO - we don't need both! - var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer)); - - _this.scissor = false; - _this.scissorData = null; - _this.scissorRenderTarget = null; - - _this.enableScissor = true; + function CanvasSpriteRenderer(renderer) { + _classCallCheck(this, CanvasSpriteRenderer); - _this.alphaMaskPool = []; - _this.alphaMaskIndex = 0; - return _this; + this.renderer = renderer; } /** - * Applies the Mask and adds it to the current filter stack. + * Renders the sprite object. * - * @param {PIXI.DisplayObject} target - Display Object to push the mask to - * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. + * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch */ - MaskManager.prototype.pushMask = function pushMask(target, maskData) { - // TODO the root check means scissor rect will not - // be used on render textures more info here: - // https://github.com/pixijs/pixi.js/pull/3545 + CanvasSpriteRenderer.prototype.render = function render(sprite) { + var texture = sprite._texture; + var renderer = this.renderer; - if (maskData.texture) { - this.pushSpriteMask(target, maskData); - } else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) { - var matrix = maskData.worldTransform; + var width = texture._frame.width; + var height = texture._frame.height; - var rot = Math.atan2(matrix.b, matrix.a); + var wt = sprite.transform.worldTransform; + var dx = 0; + var dy = 0; - // use the nearest degree! - rot = Math.round(rot * (180 / Math.PI)); + if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.baseTexture.source) { + return; + } - if (rot % 90) { - this.pushStencilMask(maskData); + renderer.setBlendMode(sprite.blendMode); + + // Ignore null sources + if (texture.valid) { + renderer.context.globalAlpha = sprite.worldAlpha; + + // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture + var smoothingEnabled = texture.baseTexture.scaleMode === _const.SCALE_MODES.LINEAR; + + if (renderer.smoothProperty && renderer.context[renderer.smoothProperty] !== smoothingEnabled) { + renderer.context[renderer.smoothProperty] = smoothingEnabled; + } + + if (texture.trim) { + dx = texture.trim.width / 2 + texture.trim.x - sprite.anchor.x * texture.orig.width; + dy = texture.trim.height / 2 + texture.trim.y - sprite.anchor.y * texture.orig.height; } else { - this.pushScissorMask(target, maskData); + dx = (0.5 - sprite.anchor.x) * texture.orig.width; + dy = (0.5 - sprite.anchor.y) * texture.orig.height; + } + + if (texture.rotate) { + wt.copy(canvasRenderWorldTransform); + wt = canvasRenderWorldTransform; + _math.GroupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy); + // the anchor has already been applied above, so lets set it to zero + dx = 0; + dy = 0; + } + + dx -= width / 2; + dy -= height / 2; + + // Allow for pixel rounding + if (renderer.roundPixels) { + renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution | 0, wt.ty * renderer.resolution | 0); + + dx = dx | 0; + dy = dy | 0; + } else { + renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution); + } + + var resolution = texture.baseTexture.resolution; + + if (sprite.tint !== 0xFFFFFF) { + if (sprite.cachedTint !== sprite.tint || sprite.tintedTexture.tintId !== sprite._texture._updateID) { + sprite.cachedTint = sprite.tint; + + // TODO clean up caching - how to clean up the caches? + sprite.tintedTexture = _CanvasTinter2.default.getTintedTexture(sprite, sprite.tint); + } + + renderer.context.drawImage(sprite.tintedTexture, 0, 0, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution); + } else { + renderer.context.drawImage(texture.baseTexture.source, texture._frame.x * resolution, texture._frame.y * resolution, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution); } - } else { - this.pushStencilMask(maskData); } }; /** - * Removes the last mask from the mask stack and doesn't return it. + * destroy the sprite object. * - * @param {PIXI.DisplayObject} target - Display Object to pop the mask from - * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. */ - MaskManager.prototype.popMask = function popMask(target, maskData) { - if (maskData.texture) { - this.popSpriteMask(target, maskData); - } else if (this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length) { - this.popScissorMask(target, maskData); - } else { - this.popStencilMask(target, maskData); - } + CanvasSpriteRenderer.prototype.destroy = function destroy() { + this.renderer = null; }; - /** - * Applies the Mask and adds it to the current filter stack. - * - * @param {PIXI.RenderTarget} target - Display Object to push the sprite mask to - * @param {PIXI.Sprite} maskData - Sprite to be used as the mask - */ + return CanvasSpriteRenderer; +}(); +exports.default = CanvasSpriteRenderer; - MaskManager.prototype.pushSpriteMask = function pushSpriteMask(target, maskData) { - var alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex]; - if (!alphaMaskFilter) { - alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new _SpriteMaskFilter2.default(maskData)]; - } +_CanvasRenderer2.default.registerPlugin('sprite', CanvasSpriteRenderer); +//# sourceMappingURL=CanvasSpriteRenderer.js.map - alphaMaskFilter[0].resolution = this.renderer.resolution; - alphaMaskFilter[0].maskSprite = maskData; +/***/ }), +/* 549 */ +/***/ (function(module, exports, __webpack_require__) { - // TODO - may cause issues! - target.filterArea = maskData.getBounds(true); +"use strict"; - this.renderer.filterManager.pushFilter(target, alphaMaskFilter); - this.alphaMaskIndex++; - }; +exports.__esModule = true; - /** - * Removes the last filter from the filter stack and doesn't return it. - * - */ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/** + * @class + * @memberof PIXI + */ +var Buffer = function () { + /** + * @param {number} size - The size of the buffer in bytes. + */ + function Buffer(size) { + _classCallCheck(this, Buffer); - MaskManager.prototype.popSpriteMask = function popSpriteMask() { - this.renderer.filterManager.popFilter(); - this.alphaMaskIndex--; - }; + this.vertices = new ArrayBuffer(size); /** - * Applies the Mask and adds it to the current filter stack. + * View on the vertices as a Float32Array for positions * - * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data. + * @member {Float32Array} */ - - - MaskManager.prototype.pushStencilMask = function pushStencilMask(maskData) { - this.renderer.currentRenderer.stop(); - this.renderer.stencilManager.pushStencil(maskData); - }; + this.float32View = new Float32Array(this.vertices); /** - * Removes the last filter from the filter stack and doesn't return it. + * View on the vertices as a Uint32Array for uvs * + * @member {Float32Array} */ + this.uint32View = new Uint32Array(this.vertices); + } + /** + * Destroys the buffer. + * + */ - MaskManager.prototype.popStencilMask = function popStencilMask() { - this.renderer.currentRenderer.stop(); - this.renderer.stencilManager.popStencil(); - }; - /** - * - * @param {PIXI.DisplayObject} target - Display Object to push the mask to - * @param {PIXI.Graphics} maskData - The masking data. - */ + Buffer.prototype.destroy = function destroy() { + this.vertices = null; + this.positions = null; + this.uvs = null; + this.colors = null; + }; + return Buffer; +}(); - MaskManager.prototype.pushScissorMask = function pushScissorMask(target, maskData) { - maskData.renderable = true; +exports.default = Buffer; +//# sourceMappingURL=BatchBuffer.js.map - var renderTarget = this.renderer._activeRenderTarget; +/***/ }), +/* 550 */ +/***/ (function(module, exports, __webpack_require__) { - var bounds = maskData.getBounds(); +"use strict"; - bounds.fit(renderTarget.size); - maskData.renderable = false; - this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST); +exports.__esModule = true; - var resolution = this.renderer.resolution; +var _ObjectRenderer2 = __webpack_require__(82); - this.renderer.gl.scissor(bounds.x * resolution, (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution, bounds.width * resolution, bounds.height * resolution); +var _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2); - this.scissorRenderTarget = renderTarget; - this.scissorData = maskData; - this.scissor = true; - }; +var _WebGLRenderer = __webpack_require__(81); - /** - * - * - */ +var _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer); +var _createIndicesForQuads = __webpack_require__(132); - MaskManager.prototype.popScissorMask = function popScissorMask() { - this.scissorRenderTarget = null; - this.scissorData = null; - this.scissor = false; +var _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads); - // must be scissor! - var gl = this.renderer.gl; +var _generateMultiTextureShader = __webpack_require__(551); - gl.disable(gl.SCISSOR_TEST); - }; +var _generateMultiTextureShader2 = _interopRequireDefault(_generateMultiTextureShader); - return MaskManager; -}(_WebGLManager3.default); +var _checkMaxIfStatmentsInShader = __webpack_require__(544); -exports.default = MaskManager; -//# sourceMappingURL=MaskManager.js.map +var _checkMaxIfStatmentsInShader2 = _interopRequireDefault(_checkMaxIfStatmentsInShader); -/***/ }), -/* 545 */ -/***/ (function(module, exports, __webpack_require__) { +var _BatchBuffer = __webpack_require__(549); -"use strict"; +var _BatchBuffer2 = _interopRequireDefault(_BatchBuffer); +var _settings = __webpack_require__(6); -exports.__esModule = true; +var _settings2 = _interopRequireDefault(_settings); -var _WebGLManager2 = __webpack_require__(55); +var _utils = __webpack_require__(3); -var _WebGLManager3 = _interopRequireDefault(_WebGLManager2); +var _pixiGlCore = __webpack_require__(15); + +var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); + +var _bitTwiddle = __webpack_require__(87); + +var _bitTwiddle2 = _interopRequireDefault(_bitTwiddle); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -57984,468 +60859,497 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var TICK = 0; +var TEXTURE_TICK = 0; + /** + * Renderer dedicated to drawing and batching sprites. + * * @class - * @extends PIXI.WebGLManager + * @private * @memberof PIXI + * @extends PIXI.ObjectRenderer */ -var StencilManager = function (_WebGLManager) { - _inherits(StencilManager, _WebGLManager); + +var SpriteRenderer = function (_ObjectRenderer) { + _inherits(SpriteRenderer, _ObjectRenderer); /** - * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for. + * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for. */ - function StencilManager(renderer) { - _classCallCheck(this, StencilManager); + function SpriteRenderer(renderer) { + _classCallCheck(this, SpriteRenderer); - var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer)); + /** + * Number of values sent in the vertex buffer. + * aVertexPosition(2), aTextureCoord(1), aColor(1), aTextureId(1) = 5 + * + * @member {number} + */ + var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer)); - _this.stencilMaskStack = null; + _this.vertSize = 5; + + /** + * The size of the vertex information in bytes. + * + * @member {number} + */ + _this.vertByteSize = _this.vertSize * 4; + + /** + * The number of images in the SpriteRenderer before it flushes. + * + * @member {number} + */ + _this.size = _settings2.default.SPRITE_BATCH_SIZE; // 2000 is a nice balance between mobile / desktop + + // the total number of bytes in our batch + // let numVerts = this.size * 4 * this.vertByteSize; + + _this.buffers = []; + for (var i = 1; i <= _bitTwiddle2.default.nextPow2(_this.size); i *= 2) { + _this.buffers.push(new _BatchBuffer2.default(i * 4 * _this.vertByteSize)); + } + + /** + * Holds the indices of the geometry (quads) to draw + * + * @member {Uint16Array} + */ + _this.indices = (0, _createIndicesForQuads2.default)(_this.size); + + /** + * The default shaders that is used if a sprite doesn't have a more specific one. + * there is a shader for each number of textures that can be rendererd. + * These shaders will also be generated on the fly as required. + * @member {PIXI.Shader[]} + */ + _this.shader = null; + + _this.currentIndex = 0; + _this.groups = []; + + for (var k = 0; k < _this.size; k++) { + _this.groups[k] = { textures: [], textureCount: 0, ids: [], size: 0, start: 0, blend: 0 }; + } + + _this.sprites = []; + + _this.vertexBuffers = []; + _this.vaos = []; + + _this.vaoMax = 2; + _this.vertexCount = 0; + + _this.renderer.on('prerender', _this.onPrerender, _this); return _this; } /** - * Changes the mask stack that is used by this manager. + * Sets up the renderer context and necessary buffers. * - * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack + * @private */ - StencilManager.prototype.setMaskStack = function setMaskStack(stencilMaskStack) { - this.stencilMaskStack = stencilMaskStack; - + SpriteRenderer.prototype.onContextChange = function onContextChange() { var gl = this.renderer.gl; - if (stencilMaskStack.length === 0) { - gl.disable(gl.STENCIL_TEST); + if (this.renderer.legacy) { + this.MAX_TEXTURES = 1; } else { - gl.enable(gl.STENCIL_TEST); + // step 1: first check max textures the GPU can handle. + this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), _settings2.default.SPRITE_MAX_TEXTURES); + + // step 2: check the maximum number of if statements the shader can have too.. + this.MAX_TEXTURES = (0, _checkMaxIfStatmentsInShader2.default)(this.MAX_TEXTURES, gl); } - }; - /** - * Applies the Mask and adds it to the current filter stack. @alvin - * - * @param {PIXI.Graphics} graphics - The mask - */ + this.shader = (0, _generateMultiTextureShader2.default)(gl, this.MAX_TEXTURES); + // create a couple of buffers + this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW); - StencilManager.prototype.pushStencil = function pushStencil(graphics) { - this.renderer.setObjectRenderer(this.renderer.plugins.graphics); + // we use the second shader as the first one depending on your browser may omit aTextureId + // as it is not used by the shader so is optimized out. - this.renderer._activeRenderTarget.attachStencilBuffer(); + this.renderer.bindVao(null); - var gl = this.renderer.gl; - var sms = this.stencilMaskStack; + var attrs = this.shader.attributes; - if (sms.length === 0) { - gl.enable(gl.STENCIL_TEST); - gl.clear(gl.STENCIL_BUFFER_BIT); - gl.stencilFunc(gl.ALWAYS, 1, 1); - } + for (var i = 0; i < this.vaoMax; i++) { + /* eslint-disable max-len */ + var vertexBuffer = this.vertexBuffers[i] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW); + /* eslint-enable max-len */ - sms.push(graphics); + // build the vao object that will render.. + var vao = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(vertexBuffer, attrs.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(vertexBuffer, attrs.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(vertexBuffer, attrs.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4); - gl.colorMask(false, false, false, false); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR); + if (attrs.aTextureId) { + vao.addAttribute(vertexBuffer, attrs.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4); + } - this.renderer.plugins.graphics.render(graphics); + this.vaos[i] = vao; + } - gl.colorMask(true, true, true, true); - gl.stencilFunc(gl.NOTEQUAL, 0, sms.length); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + this.vao = this.vaos[0]; + this.currentBlendMode = 99999; + + this.boundTextures = new Array(this.MAX_TEXTURES); }; /** - * TODO @alvin + * Called before the renderer starts rendering. + * */ - StencilManager.prototype.popStencil = function popStencil() { - this.renderer.setObjectRenderer(this.renderer.plugins.graphics); + SpriteRenderer.prototype.onPrerender = function onPrerender() { + this.vertexCount = 0; + }; - var gl = this.renderer.gl; - var sms = this.stencilMaskStack; + /** + * Renders the sprite object. + * + * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch + */ - var graphics = sms.pop(); - if (sms.length === 0) { - // the stack is empty! - gl.disable(gl.STENCIL_TEST); - } else { - gl.colorMask(false, false, false, false); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR); + SpriteRenderer.prototype.render = function render(sprite) { + // TODO set blend modes.. + // check texture.. + if (this.currentIndex >= this.size) { + this.flush(); + } - this.renderer.plugins.graphics.render(graphics); + // get the uvs for the texture - gl.colorMask(true, true, true, true); - gl.stencilFunc(gl.NOTEQUAL, 0, sms.length); - gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP); + // if the uvs have not updated then no point rendering just yet! + if (!sprite._texture._uvs) { + return; } + + // push a texture. + // increment the batchsize + this.sprites[this.currentIndex++] = sprite; }; /** - * Destroys the mask stack. + * Renders the content and empties the current batch. * */ - StencilManager.prototype.destroy = function destroy() { - _WebGLManager3.default.prototype.destroy.call(this); - - this.stencilMaskStack.stencilStack = null; - }; - - return StencilManager; -}(_WebGLManager3.default); - -exports.default = StencilManager; -//# sourceMappingURL=StencilManager.js.map - -/***/ }), -/* 546 */ -/***/ (function(module, exports, __webpack_require__) { + SpriteRenderer.prototype.flush = function flush() { + if (this.currentIndex === 0) { + return; + } -"use strict"; + var gl = this.renderer.gl; + var MAX_TEXTURES = this.MAX_TEXTURES; + var np2 = _bitTwiddle2.default.nextPow2(this.currentIndex); + var log2 = _bitTwiddle2.default.log2(np2); + var buffer = this.buffers[log2]; -exports.__esModule = true; -exports.default = checkMaxIfStatmentsInShader; + var sprites = this.sprites; + var groups = this.groups; -var _pixiGlCore = __webpack_require__(15); + var float32View = buffer.float32View; + var uint32View = buffer.uint32View; -var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); + var boundTextures = this.boundTextures; + var rendererBoundTextures = this.renderer.boundTextures; + var touch = this.renderer.textureGC.count; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + var index = 0; + var nextTexture = void 0; + var currentTexture = void 0; + var groupCount = 1; + var textureCount = 0; + var currentGroup = groups[0]; + var vertexData = void 0; + var uvs = void 0; + var blendMode = _utils.premultiplyBlendMode[sprites[0]._texture.baseTexture.premultipliedAlpha ? 1 : 0][sprites[0].blendMode]; -var fragTemplate = ['precision mediump float;', 'void main(void){', 'float test = 0.1;', '%forloop%', 'gl_FragColor = vec4(0.0);', '}'].join('\n'); + currentGroup.textureCount = 0; + currentGroup.start = 0; + currentGroup.blend = blendMode; -function checkMaxIfStatmentsInShader(maxIfs, gl) { - var createTempContext = !gl; + TICK++; - // @if DEBUG - if (maxIfs === 0) { - throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`'); - } - // @endif + var i = void 0; - if (createTempContext) { - var tinyCanvas = document.createElement('canvas'); + // copy textures.. + for (i = 0; i < MAX_TEXTURES; ++i) { + boundTextures[i] = rendererBoundTextures[i]; + boundTextures[i]._virtalBoundId = i; + } - tinyCanvas.width = 1; - tinyCanvas.height = 1; + for (i = 0; i < this.currentIndex; ++i) { + // upload the sprite elemetns... + // they have all ready been calculated so we just need to push them into the buffer. + var sprite = sprites[i]; - gl = _pixiGlCore2.default.createContext(tinyCanvas); - } + nextTexture = sprite._texture.baseTexture; - var shader = gl.createShader(gl.FRAGMENT_SHADER); + var spriteBlendMode = _utils.premultiplyBlendMode[Number(nextTexture.premultipliedAlpha)][sprite.blendMode]; - while (true) // eslint-disable-line no-constant-condition - { - var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs)); + if (blendMode !== spriteBlendMode) { + // finish a group.. + blendMode = spriteBlendMode; - gl.shaderSource(shader, fragmentSrc); - gl.compileShader(shader); + // force the batch to break! + currentTexture = null; + textureCount = MAX_TEXTURES; + TICK++; + } - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { - maxIfs = maxIfs / 2 | 0; - } else { - // valid! - break; - } - } + if (currentTexture !== nextTexture) { + currentTexture = nextTexture; - if (createTempContext) { - // get rid of context - if (gl.getExtension('WEBGL_lose_context')) { - gl.getExtension('WEBGL_lose_context').loseContext(); - } - } + if (nextTexture._enabled !== TICK) { + if (textureCount === MAX_TEXTURES) { + TICK++; - return maxIfs; -} + currentGroup.size = i - currentGroup.start; -function generateIfTestSrc(maxIfs) { - var src = ''; + textureCount = 0; - for (var i = 0; i < maxIfs; ++i) { - if (i > 0) { - src += '\nelse '; - } + currentGroup = groups[groupCount++]; + currentGroup.blend = blendMode; + currentGroup.textureCount = 0; + currentGroup.start = i; + } - if (i < maxIfs - 1) { - src += 'if(test == ' + i + '.0){}'; - } - } + nextTexture.touched = touch; - return src; -} -//# sourceMappingURL=checkMaxIfStatmentsInShader.js.map + if (nextTexture._virtalBoundId === -1) { + for (var j = 0; j < MAX_TEXTURES; ++j) { + var tIndex = (j + TEXTURE_TICK) % MAX_TEXTURES; -/***/ }), -/* 547 */ -/***/ (function(module, exports, __webpack_require__) { + var t = boundTextures[tIndex]; -"use strict"; + if (t._enabled !== TICK) { + TEXTURE_TICK++; + t._virtalBoundId = -1; -exports.__esModule = true; -exports.default = mapWebGLBlendModesToPixi; + nextTexture._virtalBoundId = tIndex; -var _const = __webpack_require__(2); + boundTextures[tIndex] = nextTexture; + break; + } + } + } -/** - * Maps gl blend combinations to WebGL. - * - * @memberof PIXI - * @function mapWebGLBlendModesToPixi - * @private - * @param {WebGLRenderingContext} gl - The rendering context. - * @param {string[]} [array=[]] - The array to output into. - * @return {string[]} Mapped modes. - */ -function mapWebGLBlendModesToPixi(gl) { - var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + nextTexture._enabled = TICK; - // TODO - premultiply alpha would be different. - // add a boolean for that! - array[_const.BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.ADD] = [gl.ONE, gl.DST_ALPHA]; - array[_const.BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR]; - array[_const.BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; - array[_const.BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA]; + currentGroup.textureCount++; + currentGroup.ids[textureCount] = nextTexture._virtalBoundId; + currentGroup.textures[textureCount++] = nextTexture; + } + } - return array; -} -//# sourceMappingURL=mapWebGLBlendModesToPixi.js.map + vertexData = sprite.vertexData; -/***/ }), -/* 548 */ -/***/ (function(module, exports, __webpack_require__) { + // TODO this sum does not need to be set each frame.. + uvs = sprite._texture._uvs.uvsUint32; -"use strict"; + if (this.renderer.roundPixels) { + var resolution = this.renderer.resolution; + // xy + float32View[index] = (vertexData[0] * resolution | 0) / resolution; + float32View[index + 1] = (vertexData[1] * resolution | 0) / resolution; -exports.__esModule = true; -exports.default = mapWebGLDrawModesToPixi; + // xy + float32View[index + 5] = (vertexData[2] * resolution | 0) / resolution; + float32View[index + 6] = (vertexData[3] * resolution | 0) / resolution; -var _const = __webpack_require__(2); + // xy + float32View[index + 10] = (vertexData[4] * resolution | 0) / resolution; + float32View[index + 11] = (vertexData[5] * resolution | 0) / resolution; -/** - * Generic Mask Stack data structure. - * - * @memberof PIXI - * @function mapWebGLDrawModesToPixi - * @private - * @param {WebGLRenderingContext} gl - The current WebGL drawing context - * @param {object} [object={}] - The object to map into - * @return {object} The mapped draw modes. - */ -function mapWebGLDrawModesToPixi(gl) { - var object = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + // xy + float32View[index + 15] = (vertexData[6] * resolution | 0) / resolution; + float32View[index + 16] = (vertexData[7] * resolution | 0) / resolution; + } else { + // xy + float32View[index] = vertexData[0]; + float32View[index + 1] = vertexData[1]; - object[_const.DRAW_MODES.POINTS] = gl.POINTS; - object[_const.DRAW_MODES.LINES] = gl.LINES; - object[_const.DRAW_MODES.LINE_LOOP] = gl.LINE_LOOP; - object[_const.DRAW_MODES.LINE_STRIP] = gl.LINE_STRIP; - object[_const.DRAW_MODES.TRIANGLES] = gl.TRIANGLES; - object[_const.DRAW_MODES.TRIANGLE_STRIP] = gl.TRIANGLE_STRIP; - object[_const.DRAW_MODES.TRIANGLE_FAN] = gl.TRIANGLE_FAN; + // xy + float32View[index + 5] = vertexData[2]; + float32View[index + 6] = vertexData[3]; - return object; -} -//# sourceMappingURL=mapWebGLDrawModesToPixi.js.map + // xy + float32View[index + 10] = vertexData[4]; + float32View[index + 11] = vertexData[5]; -/***/ }), -/* 549 */ -/***/ (function(module, exports, __webpack_require__) { + // xy + float32View[index + 15] = vertexData[6]; + float32View[index + 16] = vertexData[7]; + } -"use strict"; + uint32View[index + 2] = uvs[0]; + uint32View[index + 7] = uvs[1]; + uint32View[index + 12] = uvs[2]; + uint32View[index + 17] = uvs[3]; + /* eslint-disable max-len */ + var alpha = Math.min(sprite.worldAlpha, 1.0); + // we dont call extra function if alpha is 1.0, that's faster + var argb = alpha < 1.0 && nextTexture.premultipliedAlpha ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24); + uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = argb; + float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId; + /* eslint-enable max-len */ -exports.__esModule = true; -exports.default = validateContext; -function validateContext(gl) { - var attributes = gl.getContextAttributes(); + index += 20; + } - // this is going to be fairly simple for now.. but at least we have room to grow! - if (!attributes.stencil) { - /* eslint-disable no-console */ - console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly'); - /* eslint-enable no-console */ - } -} -//# sourceMappingURL=validateContext.js.map + currentGroup.size = i - currentGroup.start; -/***/ }), -/* 550 */ -/***/ (function(module, exports, __webpack_require__) { + if (!_settings2.default.CAN_UPLOAD_SAME_BUFFER) { + // this is still needed for IOS performance.. + // it really does not like uploading to the same buffer in a single frame! + if (this.vaoMax <= this.vertexCount) { + this.vaoMax++; -"use strict"; + var attrs = this.shader.attributes; + /* eslint-disable max-len */ + var vertexBuffer = this.vertexBuffers[this.vertexCount] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW); + /* eslint-enable max-len */ -exports.__esModule = true; + // build the vao object that will render.. + var vao = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(vertexBuffer, attrs.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(vertexBuffer, attrs.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(vertexBuffer, attrs.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4); -var _CanvasRenderer = __webpack_require__(54); + if (attrs.aTextureId) { + vao.addAttribute(vertexBuffer, attrs.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4); + } -var _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer); + this.vaos[this.vertexCount] = vao; + } -var _const = __webpack_require__(2); + this.renderer.bindVao(this.vaos[this.vertexCount]); -var _math = __webpack_require__(7); + this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, false); -var _CanvasTinter = __webpack_require__(129); + this.vertexCount++; + } else { + // lets use the faster option, always use buffer number 0 + this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, true); + } -var _CanvasTinter2 = _interopRequireDefault(_CanvasTinter); + for (i = 0; i < MAX_TEXTURES; ++i) { + rendererBoundTextures[i]._virtalBoundId = -1; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + // render the groups.. + for (i = 0; i < groupCount; ++i) { + var group = groups[i]; + var groupTextureCount = group.textureCount; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + for (var _j = 0; _j < groupTextureCount; _j++) { + currentTexture = group.textures[_j]; -var canvasRenderWorldTransform = new _math.Matrix(); + // reset virtual ids.. + // lets do a quick check.. + if (rendererBoundTextures[group.ids[_j]] !== currentTexture) { + this.renderer.bindTexture(currentTexture, group.ids[_j], true); + } -/** - * @author Mat Groves - * - * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! - * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now - * share 4 bytes on the vertex buffer - * - * Heavily inspired by LibGDX's CanvasSpriteRenderer: - * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java - */ + // reset the virtualId.. + currentTexture._virtalBoundId = -1; + } -/** - * Renderer dedicated to drawing and batching sprites. - * - * @class - * @private - * @memberof PIXI - */ + // set the blend mode.. + this.renderer.state.setBlendMode(group.blend); -var CanvasSpriteRenderer = function () { - /** - * @param {PIXI.WebGLRenderer} renderer -The renderer sprite this batch works for. - */ - function CanvasSpriteRenderer(renderer) { - _classCallCheck(this, CanvasSpriteRenderer); + gl.drawElements(gl.TRIANGLES, group.size * 6, gl.UNSIGNED_SHORT, group.start * 6 * 2); + } - this.renderer = renderer; - } + // reset elements for the next flush + this.currentIndex = 0; + }; /** - * Renders the sprite object. - * - * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch + * Starts a new sprite batch. */ - CanvasSpriteRenderer.prototype.render = function render(sprite) { - var texture = sprite._texture; - var renderer = this.renderer; - - var width = texture._frame.width; - var height = texture._frame.height; + SpriteRenderer.prototype.start = function start() { + this.renderer.bindShader(this.shader); - var wt = sprite.transform.worldTransform; - var dx = 0; - var dy = 0; + if (_settings2.default.CAN_UPLOAD_SAME_BUFFER) { + // bind buffer #0, we don't need others + this.renderer.bindVao(this.vaos[this.vertexCount]); - if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.baseTexture.source) { - return; + this.vertexBuffers[this.vertexCount].bind(); } + }; - renderer.setBlendMode(sprite.blendMode); + /** + * Stops and flushes the current batch. + * + */ - // Ignore null sources - if (texture.valid) { - renderer.context.globalAlpha = sprite.worldAlpha; - // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture - var smoothingEnabled = texture.baseTexture.scaleMode === _const.SCALE_MODES.LINEAR; + SpriteRenderer.prototype.stop = function stop() { + this.flush(); + }; - if (renderer.smoothProperty && renderer.context[renderer.smoothProperty] !== smoothingEnabled) { - renderer.context[renderer.smoothProperty] = smoothingEnabled; - } + /** + * Destroys the SpriteRenderer. + * + */ - if (texture.trim) { - dx = texture.trim.width / 2 + texture.trim.x - sprite.anchor.x * texture.orig.width; - dy = texture.trim.height / 2 + texture.trim.y - sprite.anchor.y * texture.orig.height; - } else { - dx = (0.5 - sprite.anchor.x) * texture.orig.width; - dy = (0.5 - sprite.anchor.y) * texture.orig.height; - } - if (texture.rotate) { - wt.copy(canvasRenderWorldTransform); - wt = canvasRenderWorldTransform; - _math.GroupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy); - // the anchor has already been applied above, so lets set it to zero - dx = 0; - dy = 0; + SpriteRenderer.prototype.destroy = function destroy() { + for (var i = 0; i < this.vaoMax; i++) { + if (this.vertexBuffers[i]) { + this.vertexBuffers[i].destroy(); } - - dx -= width / 2; - dy -= height / 2; - - // Allow for pixel rounding - if (renderer.roundPixels) { - renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution | 0, wt.ty * renderer.resolution | 0); - - dx = dx | 0; - dy = dy | 0; - } else { - renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution); + if (this.vaos[i]) { + this.vaos[i].destroy(); } + } - var resolution = texture.baseTexture.resolution; + if (this.indexBuffer) { + this.indexBuffer.destroy(); + } - if (sprite.tint !== 0xFFFFFF) { - if (sprite.cachedTint !== sprite.tint) { - sprite.cachedTint = sprite.tint; + this.renderer.off('prerender', this.onPrerender, this); - // TODO clean up caching - how to clean up the caches? - sprite.tintedTexture = _CanvasTinter2.default.getTintedTexture(sprite, sprite.tint); - } + _ObjectRenderer.prototype.destroy.call(this); - renderer.context.drawImage(sprite.tintedTexture, 0, 0, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution); - } else { - renderer.context.drawImage(texture.baseTexture.source, texture._frame.x * resolution, texture._frame.y * resolution, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution); - } + if (this.shader) { + this.shader.destroy(); + this.shader = null; } - }; - /** - * destroy the sprite object. - * - */ + this.vertexBuffers = null; + this.vaos = null; + this.indexBuffer = null; + this.indices = null; + this.sprites = null; - CanvasSpriteRenderer.prototype.destroy = function destroy() { - this.renderer = null; + for (var _i = 0; _i < this.buffers.length; ++_i) { + this.buffers[_i].destroy(); + } }; - return CanvasSpriteRenderer; -}(); + return SpriteRenderer; +}(_ObjectRenderer3.default); -exports.default = CanvasSpriteRenderer; +exports.default = SpriteRenderer; -_CanvasRenderer2.default.registerPlugin('sprite', CanvasSpriteRenderer); -//# sourceMappingURL=CanvasSpriteRenderer.js.map +_WebGLRenderer2.default.registerPlugin('sprite', SpriteRenderer); +//# sourceMappingURL=SpriteRenderer.js.map /***/ }), /* 551 */ @@ -58455,55 +61359,65 @@ _CanvasRenderer2.default.registerPlugin('sprite', CanvasSpriteRenderer); exports.__esModule = true; +exports.default = generateMultiTextureShader; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +var _Shader = __webpack_require__(54); -/** - * @class - * @memberof PIXI - */ -var Buffer = function () { - /** - * @param {number} size - The size of the buffer in bytes. - */ - function Buffer(size) { - _classCallCheck(this, Buffer); +var _Shader2 = _interopRequireDefault(_Shader); - this.vertices = new ArrayBuffer(size); +var _path = __webpack_require__(21); - /** - * View on the vertices as a Float32Array for positions - * - * @member {Float32Array} - */ - this.float32View = new Float32Array(this.vertices); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - /** - * View on the vertices as a Uint32Array for uvs - * - * @member {Float32Array} - */ - this.uint32View = new Uint32Array(this.vertices); - } +var fragTemplate = ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'varying float vTextureId;', 'uniform sampler2D uSamplers[%count%];', 'void main(void){', 'vec4 color;', 'float textureId = floor(vTextureId+0.5);', '%forloop%', 'gl_FragColor = color * vColor;', '}'].join('\n'); - /** - * Destroys the buffer. - * - */ +function generateMultiTextureShader(gl, maxTextures) { + var vertexSrc = 'precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor;\n}\n'; + var fragmentSrc = fragTemplate; + fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures); + fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures)); - Buffer.prototype.destroy = function destroy() { - this.vertices = null; - this.positions = null; - this.uvs = null; - this.colors = null; - }; + var shader = new _Shader2.default(gl, vertexSrc, fragmentSrc); - return Buffer; -}(); + var sampleValues = []; -exports.default = Buffer; -//# sourceMappingURL=BatchBuffer.js.map + for (var i = 0; i < maxTextures; i++) { + sampleValues[i] = i; + } + + shader.bind(); + shader.uniforms.uSamplers = sampleValues; + + return shader; +} + +function generateSampleSrc(maxTextures) { + var src = ''; + + src += '\n'; + src += '\n'; + + for (var i = 0; i < maxTextures; i++) { + if (i > 0) { + src += '\nelse '; + } + + if (i < maxTextures - 1) { + src += 'if(textureId == ' + i + '.0)'; + } + + src += '\n{'; + src += '\n\tcolor = texture2D(uSamplers[' + i + '], vTextureCoord);'; + src += '\n}'; + } + + src += '\n'; + src += '\n'; + + return src; +} +//# sourceMappingURL=generateMultiTextureShader.js.map /***/ }), /* 552 */ @@ -58514,41 +61428,37 @@ exports.default = Buffer; exports.__esModule = true; -var _ObjectRenderer2 = __webpack_require__(83); - -var _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2); - -var _WebGLRenderer = __webpack_require__(82); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer); +var _Sprite2 = __webpack_require__(128); -var _createIndicesForQuads = __webpack_require__(131); +var _Sprite3 = _interopRequireDefault(_Sprite2); -var _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads); +var _Texture = __webpack_require__(37); -var _generateMultiTextureShader = __webpack_require__(553); +var _Texture2 = _interopRequireDefault(_Texture); -var _generateMultiTextureShader2 = _interopRequireDefault(_generateMultiTextureShader); +var _math = __webpack_require__(8); -var _checkMaxIfStatmentsInShader = __webpack_require__(546); +var _utils = __webpack_require__(3); -var _checkMaxIfStatmentsInShader2 = _interopRequireDefault(_checkMaxIfStatmentsInShader); +var _const = __webpack_require__(0); -var _BatchBuffer = __webpack_require__(551); +var _settings = __webpack_require__(6); -var _BatchBuffer2 = _interopRequireDefault(_BatchBuffer); +var _settings2 = _interopRequireDefault(_settings); -var _settings = __webpack_require__(10); +var _TextStyle = __webpack_require__(250); -var _settings2 = _interopRequireDefault(_settings); +var _TextStyle2 = _interopRequireDefault(_TextStyle); -var _pixiGlCore = __webpack_require__(15); +var _TextMetrics = __webpack_require__(249); -var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); +var _TextMetrics2 = _interopRequireDefault(_TextMetrics); -var _bitTwiddle = __webpack_require__(88); +var _trimCanvas = __webpack_require__(562); -var _bitTwiddle2 = _interopRequireDefault(_bitTwiddle); +var _trimCanvas2 = _interopRequireDefault(_trimCanvas); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -58556,547 +61466,885 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint max-depth: [2, 8] */ -var TICK = 0; -var TEXTURE_TICK = 0; + +var defaultDestroyOptions = { + texture: true, + children: false, + baseTexture: true +}; /** - * Renderer dedicated to drawing and batching sprites. + * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, + * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. + * + * A Text can be created directly from a string and a style object + * + * ```js + * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'}); + * ``` * * @class - * @private + * @extends PIXI.Sprite * @memberof PIXI - * @extends PIXI.ObjectRenderer */ -var SpriteRenderer = function (_ObjectRenderer) { - _inherits(SpriteRenderer, _ObjectRenderer); +var Text = function (_Sprite) { + _inherits(Text, _Sprite); /** - * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for. + * @param {string} text - The string that you would like the text to display + * @param {object|PIXI.TextStyle} [style] - The style parameters + * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text */ - function SpriteRenderer(renderer) { - _classCallCheck(this, SpriteRenderer); + function Text(text, style, canvas) { + _classCallCheck(this, Text); + + canvas = canvas || document.createElement('canvas'); + + canvas.width = 3; + canvas.height = 3; + + var texture = _Texture2.default.fromCanvas(canvas, _settings2.default.SCALE_MODE, 'text'); + + texture.orig = new _math.Rectangle(); + texture.trim = new _math.Rectangle(); + + // base texture is already automatically added to the cache, now adding the actual texture + var _this = _possibleConstructorReturn(this, _Sprite.call(this, texture)); + + _Texture2.default.addToCache(_this._texture, _this._texture.baseTexture.textureCacheIds[0]); /** - * Number of values sent in the vertex buffer. - * positionX, positionY, colorR, colorG, colorB = 5 + * The canvas element that everything is drawn to * - * @member {number} + * @member {HTMLCanvasElement} */ - var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer)); + _this.canvas = canvas; - _this.vertSize = 5; + /** + * The canvas 2d context that everything is drawn with + * @member {CanvasRenderingContext2D} + */ + _this.context = _this.canvas.getContext('2d'); /** - * The size of the vertex information in bytes. - * + * The resolution / device pixel ratio of the canvas. This is set automatically by the renderer. * @member {number} + * @default 1 */ - _this.vertByteSize = _this.vertSize * 4; + _this.resolution = _settings2.default.RESOLUTION; /** - * The number of images in the SpriteRenderer before it flushes. + * Private tracker for the current text. * - * @member {number} + * @member {string} + * @private */ - _this.size = _settings2.default.SPRITE_BATCH_SIZE; // 2000 is a nice balance between mobile / desktop - - // the total number of bytes in our batch - // let numVerts = this.size * 4 * this.vertByteSize; - - _this.buffers = []; - for (var i = 1; i <= _bitTwiddle2.default.nextPow2(_this.size); i *= 2) { - _this.buffers.push(new _BatchBuffer2.default(i * 4 * _this.vertByteSize)); - } + _this._text = null; /** - * Holds the indices of the geometry (quads) to draw + * Private tracker for the current style. * - * @member {Uint16Array} + * @member {object} + * @private */ - _this.indices = (0, _createIndicesForQuads2.default)(_this.size); - + _this._style = null; /** - * The default shaders that is used if a sprite doesn't have a more specific one. - * there is a shader for each number of textures that can be rendererd. - * These shaders will also be generated on the fly as required. - * @member {PIXI.Shader[]} + * Private listener to track style changes. + * + * @member {Function} + * @private */ - _this.shader = null; - - _this.currentIndex = 0; - TICK = 0; - _this.groups = []; - - for (var k = 0; k < _this.size; k++) { - _this.groups[k] = { textures: [], textureCount: 0, ids: [], size: 0, start: 0, blend: 0 }; - } - - _this.sprites = []; + _this._styleListener = null; - _this.vertexBuffers = []; - _this.vaos = []; + /** + * Private tracker for the current font. + * + * @member {string} + * @private + */ + _this._font = ''; - _this.vaoMax = 2; - _this.vertexCount = 0; + _this.text = text; + _this.style = style; - _this.renderer.on('prerender', _this.onPrerender, _this); + _this.localStyleID = -1; return _this; } /** - * Sets up the renderer context and necessary buffers. + * Renders text and updates it when needed. * * @private + * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called. */ - SpriteRenderer.prototype.onContextChange = function onContextChange() { - var gl = this.renderer.gl; + Text.prototype.updateText = function updateText(respectDirty) { + var style = this._style; - // step 1: first check max textures the GPU can handle. - this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), _settings2.default.SPRITE_MAX_TEXTURES); + // check if style has changed.. + if (this.localStyleID !== style.styleID) { + this.dirty = true; + this.localStyleID = style.styleID; + } - // step 2: check the maximum number of if statements the shader can have too.. - this.MAX_TEXTURES = (0, _checkMaxIfStatmentsInShader2.default)(this.MAX_TEXTURES, gl); + if (!this.dirty && respectDirty) { + return; + } - var shader = this.shader = (0, _generateMultiTextureShader2.default)(gl, this.MAX_TEXTURES); + this._font = this._style.toFontString(); - // create a couple of buffers - this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW); + var context = this.context; + var measured = _TextMetrics2.default.measureText(this._text, this._style, this._style.wordWrap, this.canvas); + var width = measured.width; + var height = measured.height; + var lines = measured.lines; + var lineHeight = measured.lineHeight; + var lineWidths = measured.lineWidths; + var maxLineWidth = measured.maxLineWidth; + var fontProperties = measured.fontProperties; - // we use the second shader as the first one depending on your browser may omit aTextureId - // as it is not used by the shader so is optimized out. + this.canvas.width = Math.ceil((width + style.padding * 2) * this.resolution); + this.canvas.height = Math.ceil((height + style.padding * 2) * this.resolution); - this.renderer.bindVao(null); + context.scale(this.resolution, this.resolution); - for (var i = 0; i < this.vaoMax; i++) { - this.vertexBuffers[i] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW); + context.clearRect(0, 0, this.canvas.width, this.canvas.height); - /* eslint-disable max-len */ + context.font = this._font; + context.strokeStyle = style.stroke; + context.lineWidth = style.strokeThickness; + context.textBaseline = style.textBaseline; + context.lineJoin = style.lineJoin; + context.miterLimit = style.miterLimit; - // build the vao object that will render.. - this.vaos[i] = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[i], shader.attributes.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(this.vertexBuffers[i], shader.attributes.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(this.vertexBuffers[i], shader.attributes.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4).addAttribute(this.vertexBuffers[i], shader.attributes.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4); + var linePositionX = void 0; + var linePositionY = void 0; - /* eslint-enable max-len */ + if (style.dropShadow) { + context.fillStyle = style.dropShadowColor; + context.globalAlpha = style.dropShadowAlpha; + context.shadowBlur = style.dropShadowBlur; + + if (style.dropShadowBlur > 0) { + context.shadowColor = style.dropShadowColor; + } + + var xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance; + var yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance; + + for (var i = 0; i < lines.length; i++) { + linePositionX = style.strokeThickness / 2; + linePositionY = style.strokeThickness / 2 + i * lineHeight + fontProperties.ascent; + + if (style.align === 'right') { + linePositionX += maxLineWidth - lineWidths[i]; + } else if (style.align === 'center') { + linePositionX += (maxLineWidth - lineWidths[i]) / 2; + } + + if (style.fill) { + this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding); + + if (style.stroke && style.strokeThickness) { + context.strokeStyle = style.dropShadowColor; + this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding, true); + context.strokeStyle = style.stroke; + } + } + } } - this.vao = this.vaos[0]; - this.currentBlendMode = 99999; + // reset the shadow blur and alpha that was set by the drop shadow, for the regular text + context.shadowBlur = 0; + context.globalAlpha = 1; - this.boundTextures = new Array(this.MAX_TEXTURES); + // set canvas text styles + context.fillStyle = this._generateFillStyle(style, lines); + + // draw lines line by line + for (var _i = 0; _i < lines.length; _i++) { + linePositionX = style.strokeThickness / 2; + linePositionY = style.strokeThickness / 2 + _i * lineHeight + fontProperties.ascent; + + if (style.align === 'right') { + linePositionX += maxLineWidth - lineWidths[_i]; + } else if (style.align === 'center') { + linePositionX += (maxLineWidth - lineWidths[_i]) / 2; + } + + if (style.stroke && style.strokeThickness) { + this.drawLetterSpacing(lines[_i], linePositionX + style.padding, linePositionY + style.padding, true); + } + + if (style.fill) { + this.drawLetterSpacing(lines[_i], linePositionX + style.padding, linePositionY + style.padding); + } + } + + this.updateTexture(); }; /** - * Called before the renderer starts rendering. - * + * Render the text with letter-spacing. + * @param {string} text - The text to draw + * @param {number} x - Horizontal position to draw the text + * @param {number} y - Vertical position to draw the text + * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the + * text? If not, it's for the inside fill + * @private */ - SpriteRenderer.prototype.onPrerender = function onPrerender() { - this.vertexCount = 0; + Text.prototype.drawLetterSpacing = function drawLetterSpacing(text, x, y) { + var isStroke = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + var style = this._style; + + // letterSpacing of 0 means normal + var letterSpacing = style.letterSpacing; + + if (letterSpacing === 0) { + if (isStroke) { + this.context.strokeText(text, x, y); + } else { + this.context.fillText(text, x, y); + } + + return; + } + + var characters = String.prototype.split.call(text, ''); + var currentPosition = x; + var index = 0; + var current = ''; + + while (index < text.length) { + current = characters[index++]; + if (isStroke) { + this.context.strokeText(current, currentPosition, y); + } else { + this.context.fillText(current, currentPosition, y); + } + currentPosition += this.context.measureText(current).width + letterSpacing; + } }; /** - * Renders the sprite object. + * Updates texture size based on canvas size * - * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch + * @private */ - SpriteRenderer.prototype.render = function render(sprite) { - // TODO set blend modes.. - // check texture.. - if (this.currentIndex >= this.size) { - this.flush(); + Text.prototype.updateTexture = function updateTexture() { + var canvas = this.canvas; + + if (this._style.trim) { + var trimmed = (0, _trimCanvas2.default)(canvas); + + canvas.width = trimmed.width; + canvas.height = trimmed.height; + this.context.putImageData(trimmed.data, 0, 0); } - // get the uvs for the texture + var texture = this._texture; + var style = this._style; + var padding = style.trim ? 0 : style.padding; + var baseTexture = texture.baseTexture; - // if the uvs have not updated then no point rendering just yet! - if (!sprite._texture._uvs) { - return; + baseTexture.hasLoaded = true; + baseTexture.resolution = this.resolution; + + baseTexture.realWidth = canvas.width; + baseTexture.realHeight = canvas.height; + baseTexture.width = canvas.width / this.resolution; + baseTexture.height = canvas.height / this.resolution; + + texture.trim.width = texture._frame.width = canvas.width / this.resolution; + texture.trim.height = texture._frame.height = canvas.height / this.resolution; + texture.trim.x = -padding; + texture.trim.y = -padding; + + texture.orig.width = texture._frame.width - padding * 2; + texture.orig.height = texture._frame.height - padding * 2; + + // call sprite onTextureUpdate to update scale if _width or _height were set + this._onTextureUpdate(); + + baseTexture.emit('update', baseTexture); + + this.dirty = false; + }; + + /** + * Renders the object using the WebGL renderer + * + * @param {PIXI.WebGLRenderer} renderer - The renderer + */ + + + Text.prototype.renderWebGL = function renderWebGL(renderer) { + if (this.resolution !== renderer.resolution) { + this.resolution = renderer.resolution; + this.dirty = true; } - // push a texture. - // increment the batchsize - this.sprites[this.currentIndex++] = sprite; + this.updateText(true); + + _Sprite.prototype.renderWebGL.call(this, renderer); }; /** - * Renders the content and empties the current batch. + * Renders the object using the Canvas renderer * + * @private + * @param {PIXI.CanvasRenderer} renderer - The renderer */ - SpriteRenderer.prototype.flush = function flush() { - if (this.currentIndex === 0) { - return; + Text.prototype._renderCanvas = function _renderCanvas(renderer) { + if (this.resolution !== renderer.resolution) { + this.resolution = renderer.resolution; + this.dirty = true; } - var gl = this.renderer.gl; - var MAX_TEXTURES = this.MAX_TEXTURES; + this.updateText(true); - var np2 = _bitTwiddle2.default.nextPow2(this.currentIndex); - var log2 = _bitTwiddle2.default.log2(np2); - var buffer = this.buffers[log2]; + _Sprite.prototype._renderCanvas.call(this, renderer); + }; - var sprites = this.sprites; - var groups = this.groups; + /** + * Gets the local bounds of the text object. + * + * @param {Rectangle} rect - The output rectangle. + * @return {Rectangle} The bounds. + */ - var float32View = buffer.float32View; - var uint32View = buffer.uint32View; - var boundTextures = this.boundTextures; - var rendererBoundTextures = this.renderer.boundTextures; - var touch = this.renderer.textureGC.count; + Text.prototype.getLocalBounds = function getLocalBounds(rect) { + this.updateText(true); - var index = 0; - var nextTexture = void 0; - var currentTexture = void 0; - var groupCount = 1; - var textureCount = 0; - var currentGroup = groups[0]; - var vertexData = void 0; - var uvs = void 0; - var blendMode = sprites[0].blendMode; + return _Sprite.prototype.getLocalBounds.call(this, rect); + }; - currentGroup.textureCount = 0; - currentGroup.start = 0; - currentGroup.blend = blendMode; + /** + * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. + */ + + + Text.prototype._calculateBounds = function _calculateBounds() { + this.updateText(true); + this.calculateVertices(); + // if we have already done this on THIS frame. + this._bounds.addQuad(this.vertexData); + }; + + /** + * Method to be called upon a TextStyle change. + * @private + */ + + + Text.prototype._onStyleChange = function _onStyleChange() { + this.dirty = true; + }; + + /** + * Generates the fill style. Can automatically generate a gradient based on the fill style being an array + * + * @private + * @param {object} style - The style. + * @param {string[]} lines - The lines of text. + * @return {string|number|CanvasGradient} The fill style + */ + + + Text.prototype._generateFillStyle = function _generateFillStyle(style, lines) { + if (!Array.isArray(style.fill)) { + return style.fill; + } + + // cocoon on canvas+ cannot generate textures, so use the first colour instead + if (navigator.isCocoonJS) { + return style.fill[0]; + } + + // the gradient will be evenly spaced out according to how large the array is. + // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75 + var gradient = void 0; + var totalIterations = void 0; + var currentIteration = void 0; + var stop = void 0; + + var width = this.canvas.width / this.resolution; + var height = this.canvas.height / this.resolution; - TICK++; + // make a copy of the style settings, so we can manipulate them later + var fill = style.fill.slice(); + var fillGradientStops = style.fillGradientStops.slice(); - var i = void 0; + // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75 + if (!fillGradientStops.length) { + var lengthPlus1 = fill.length + 1; - // copy textures.. - for (i = 0; i < MAX_TEXTURES; ++i) { - boundTextures[i] = rendererBoundTextures[i]; - boundTextures[i]._virtalBoundId = i; + for (var i = 1; i < lengthPlus1; ++i) { + fillGradientStops.push(i / lengthPlus1); + } } - for (i = 0; i < this.currentIndex; ++i) { - // upload the sprite elemetns... - // they have all ready been calculated so we just need to push them into the buffer. - var sprite = sprites[i]; + // stop the bleeding of the last gradient on the line above to the top gradient of the this line + // by hard defining the first gradient colour at point 0, and last gradient colour at point 1 + fill.unshift(style.fill[0]); + fillGradientStops.unshift(0); - nextTexture = sprite._texture.baseTexture; + fill.push(style.fill[style.fill.length - 1]); + fillGradientStops.push(1); - if (blendMode !== sprite.blendMode) { - // finish a group.. - blendMode = sprite.blendMode; + if (style.fillGradientType === _const.TEXT_GRADIENT.LINEAR_VERTICAL) { + // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas + gradient = this.context.createLinearGradient(width / 2, 0, width / 2, height); - // force the batch to break! - currentTexture = null; - textureCount = MAX_TEXTURES; - TICK++; + // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect + // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875 + totalIterations = (fill.length + 1) * lines.length; + currentIteration = 0; + for (var _i2 = 0; _i2 < lines.length; _i2++) { + currentIteration += 1; + for (var j = 0; j < fill.length; j++) { + if (typeof fillGradientStops[j] === 'number') { + stop = fillGradientStops[j] / lines.length + _i2 / lines.length; + } else { + stop = currentIteration / totalIterations; + } + gradient.addColorStop(stop, fill[j]); + currentIteration++; + } } + } else { + // start the gradient at the center left of the canvas, and end at the center right of the canvas + gradient = this.context.createLinearGradient(0, height / 2, width, height / 2); - if (currentTexture !== nextTexture) { - currentTexture = nextTexture; + // can just evenly space out the gradients in this case, as multiple lines makes no difference + // to an even left to right gradient + totalIterations = fill.length + 1; + currentIteration = 1; - if (nextTexture._enabled !== TICK) { - if (textureCount === MAX_TEXTURES) { - TICK++; + for (var _i3 = 0; _i3 < fill.length; _i3++) { + if (typeof fillGradientStops[_i3] === 'number') { + stop = fillGradientStops[_i3]; + } else { + stop = currentIteration / totalIterations; + } + gradient.addColorStop(stop, fill[_i3]); + currentIteration++; + } + } - currentGroup.size = i - currentGroup.start; + return gradient; + }; - textureCount = 0; + /** + * Destroys this text object. + * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as + * the majority of the time the texture will not be shared with any other Sprites. + * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their + * destroy method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well + */ - currentGroup = groups[groupCount++]; - currentGroup.blend = blendMode; - currentGroup.textureCount = 0; - currentGroup.start = i; - } - nextTexture.touched = touch; + Text.prototype.destroy = function destroy(options) { + if (typeof options === 'boolean') { + options = { children: options }; + } - if (nextTexture._virtalBoundId === -1) { - for (var j = 0; j < MAX_TEXTURES; ++j) { - var tIndex = (j + TEXTURE_TICK) % MAX_TEXTURES; + options = Object.assign({}, defaultDestroyOptions, options); - var t = boundTextures[tIndex]; + _Sprite.prototype.destroy.call(this, options); - if (t._enabled !== TICK) { - TEXTURE_TICK++; + // make sure to reset the the context and canvas.. dont want this hanging around in memory! + this.context = null; + this.canvas = null; - t._virtalBoundId = -1; + this._style = null; + }; - nextTexture._virtalBoundId = tIndex; + /** + * The width of the Text, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ - boundTextures[tIndex] = nextTexture; - break; - } - } - } - nextTexture._enabled = TICK; + _createClass(Text, [{ + key: 'width', + get: function get() { + this.updateText(true); - currentGroup.textureCount++; - currentGroup.ids[textureCount] = nextTexture._virtalBoundId; - currentGroup.textures[textureCount++] = nextTexture; - } - } + return Math.abs(this.scale.x) * this._texture.orig.width; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this.updateText(true); - vertexData = sprite.vertexData; + var s = (0, _utils.sign)(this.scale.x) || 1; - // TODO this sum does not need to be set each frame.. - uvs = sprite._texture._uvs.uvsUint32; + this.scale.x = s * value / this._texture.orig.width; + this._width = value; + } - if (this.renderer.roundPixels) { - var resolution = this.renderer.resolution; + /** + * The height of the Text, setting this will actually modify the scale to achieve the value set + * + * @member {number} + */ - // xy - float32View[index] = (vertexData[0] * resolution | 0) / resolution; - float32View[index + 1] = (vertexData[1] * resolution | 0) / resolution; + }, { + key: 'height', + get: function get() { + this.updateText(true); - // xy - float32View[index + 5] = (vertexData[2] * resolution | 0) / resolution; - float32View[index + 6] = (vertexData[3] * resolution | 0) / resolution; + return Math.abs(this.scale.y) * this._texture.orig.height; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this.updateText(true); - // xy - float32View[index + 10] = (vertexData[4] * resolution | 0) / resolution; - float32View[index + 11] = (vertexData[5] * resolution | 0) / resolution; + var s = (0, _utils.sign)(this.scale.y) || 1; - // xy - float32View[index + 15] = (vertexData[6] * resolution | 0) / resolution; - float32View[index + 16] = (vertexData[7] * resolution | 0) / resolution; - } else { - // xy - float32View[index] = vertexData[0]; - float32View[index + 1] = vertexData[1]; + this.scale.y = s * value / this._texture.orig.height; + this._height = value; + } - // xy - float32View[index + 5] = vertexData[2]; - float32View[index + 6] = vertexData[3]; + /** + * Set the style of the text. Set up an event listener to listen for changes on the style + * object and mark the text as dirty. + * + * @member {object|PIXI.TextStyle} + */ - // xy - float32View[index + 10] = vertexData[4]; - float32View[index + 11] = vertexData[5]; + }, { + key: 'style', + get: function get() { + return this._style; + }, + set: function set(style) // eslint-disable-line require-jsdoc + { + style = style || {}; - // xy - float32View[index + 15] = vertexData[6]; - float32View[index + 16] = vertexData[7]; + if (style instanceof _TextStyle2.default) { + this._style = style; + } else { + this._style = new _TextStyle2.default(style); } - uint32View[index + 2] = uvs[0]; - uint32View[index + 7] = uvs[1]; - uint32View[index + 12] = uvs[2]; - uint32View[index + 17] = uvs[3]; + this.localStyleID = -1; + this.dirty = true; + } - /* eslint-disable max-len */ - uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = sprite._tintRGB + (Math.min(sprite.worldAlpha, 1) * 255 << 24); + /** + * Set the copy for the text object. To split a line you can use '\n'. + * + * @member {string} + */ - float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId; - /* eslint-enable max-len */ + }, { + key: 'text', + get: function get() { + return this._text; + }, + set: function set(text) // eslint-disable-line require-jsdoc + { + text = String(text === '' || text === null || text === undefined ? ' ' : text); - index += 20; + if (this._text === text) { + return; + } + this._text = text; + this.dirty = true; } + }]); - currentGroup.size = i - currentGroup.start; + return Text; +}(_Sprite3.default); - if (!_settings2.default.CAN_UPLOAD_SAME_BUFFER) { - // this is still needed for IOS performance.. - // it really does not like uploading to the same buffer in a single frame! - if (this.vaoMax <= this.vertexCount) { - this.vaoMax++; - this.vertexBuffers[this.vertexCount] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW); +exports.default = Text; +//# sourceMappingURL=Text.js.map - /* eslint-disable max-len */ +/***/ }), +/* 553 */ +/***/ (function(module, exports, __webpack_require__) { - // build the vao object that will render.. - this.vaos[this.vertexCount] = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4).addAttribute(this.vertexBuffers[this.vertexCount], this.shader.attributes.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4); +"use strict"; - /* eslint-enable max-len */ - } - this.renderer.bindVao(this.vaos[this.vertexCount]); +exports.__esModule = true; - this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, false); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - this.vertexCount++; - } else { - // lets use the faster option, always use buffer number 0 - this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, true); - } +var _ = __webpack_require__(1); - for (i = 0; i < MAX_TEXTURES; ++i) { - rendererBoundTextures[i]._virtalBoundId = -1; - } +var _utils = __webpack_require__(3); - // render the groups.. - for (i = 0; i < groupCount; ++i) { - var group = groups[i]; - var groupTextureCount = group.textureCount; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - for (var _j = 0; _j < groupTextureCount; _j++) { - currentTexture = group.textures[_j]; +/** + * Utility class for maintaining reference to a collection + * of Textures on a single Spritesheet. + * + * @class + * @memberof PIXI + */ +var Spritesheet = function () { + _createClass(Spritesheet, null, [{ + key: 'BATCH_SIZE', - // reset virtual ids.. - // lets do a quick check.. - if (rendererBoundTextures[group.ids[_j]] !== currentTexture) { - this.renderer.bindTexture(currentTexture, group.ids[_j], true); - } + /** + * The maximum number of Textures to build per process. + * + * @type {number} + * @default 1000 + */ + get: function get() { + return 1000; + } - // reset the virtualId.. - currentTexture._virtalBoundId = -1; - } + /** + * @param {PIXI.BaseTexture} baseTexture Reference to the source BaseTexture object. + * @param {Object} data - Spritesheet image data. + * @param {string} [resolutionFilename] - The filename to consider when determining + * the resolution of the spritesheet. If not provided, the imageUrl will + * be used on the BaseTexture. + */ - // set the blend mode.. - this.renderer.state.setBlendMode(group.blend); + }]); - gl.drawElements(gl.TRIANGLES, group.size * 6, gl.UNSIGNED_SHORT, group.start * 6 * 2); - } + function Spritesheet(baseTexture, data) { + var resolutionFilename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - // reset elements for the next flush - this.currentIndex = 0; - }; + _classCallCheck(this, Spritesheet); - /** - * Starts a new sprite batch. - */ + /** + * Reference to ths source texture + * @type {PIXI.BaseTexture} + */ + this.baseTexture = baseTexture; + /** + * Map of spritesheet textures. + * @type {Object} + */ + this.textures = {}; - SpriteRenderer.prototype.start = function start() { - this.renderer.bindShader(this.shader); + /** + * Reference to the original JSON data. + * @type {Object} + */ + this.data = data; - if (_settings2.default.CAN_UPLOAD_SAME_BUFFER) { - // bind buffer #0, we don't need others - this.renderer.bindVao(this.vaos[this.vertexCount]); + /** + * The resolution of the spritesheet. + * @type {number} + */ + this.resolution = this._updateResolution(resolutionFilename || this.baseTexture.imageUrl); - this.vertexBuffers[this.vertexCount].bind(); - } - }; + /** + * Map of spritesheet frames. + * @type {Object} + * @private + */ + this._frames = this.data.frames; - /** - * Stops and flushes the current batch. - * - */ + /** + * Collection of frame names. + * @type {string[]} + * @private + */ + this._frameKeys = Object.keys(this._frames); + /** + * Current batch index being processed. + * @type {number} + * @private + */ + this._batchIndex = 0; - SpriteRenderer.prototype.stop = function stop() { - this.flush(); - }; + /** + * Callback when parse is completed. + * @type {Function} + * @private + */ + this._callback = null; + } /** - * Destroys the SpriteRenderer. + * Generate the resolution from the filename or fallback + * to the meta.scale field of the JSON data. * + * @private + * @param {string} resolutionFilename - The filename to use for resolving + * the default resolution. + * @return {number} Resolution to use for spritesheet. */ - SpriteRenderer.prototype.destroy = function destroy() { - for (var i = 0; i < this.vaoMax; i++) { - if (this.vertexBuffers[i]) { - this.vertexBuffers[i].destroy(); - } - if (this.vaos[i]) { - this.vaos[i].destroy(); - } - } + Spritesheet.prototype._updateResolution = function _updateResolution(resolutionFilename) { + var scale = this.data.meta.scale; - if (this.indexBuffer) { - this.indexBuffer.destroy(); + // Use a defaultValue of `null` to check if a url-based resolution is set + var resolution = (0, _utils.getResolutionOfUrl)(resolutionFilename, null); + + // No resolution found via URL + if (resolution === null) { + // Use the scale value or default to 1 + resolution = scale !== undefined ? parseFloat(scale) : 1; } - this.renderer.off('prerender', this.onPrerender, this); + // For non-1 resolutions, update baseTexture + if (resolution !== 1) { + this.baseTexture.resolution = resolution; + this.baseTexture.update(); + } - _ObjectRenderer.prototype.destroy.call(this); + return resolution; + }; - if (this.shader) { - this.shader.destroy(); - this.shader = null; - } + /** + * Parser spritesheet from loaded data. This is done asynchronously + * to prevent creating too many Texture within a single process. + * + * @param {Function} callback - Callback when complete returns + * a map of the Textures for this spritesheet. + */ - this.vertexBuffers = null; - this.vaos = null; - this.indexBuffer = null; - this.indices = null; - this.sprites = null; + Spritesheet.prototype.parse = function parse(callback) { + this._batchIndex = 0; + this._callback = callback; - for (var _i = 0; _i < this.buffers.length; ++_i) { - this.buffers[_i].destroy(); + if (this._frameKeys.length <= Spritesheet.BATCH_SIZE) { + this._processFrames(0); + this._parseComplete(); + } else { + this._nextBatch(); } }; - return SpriteRenderer; -}(_ObjectRenderer3.default); - -exports.default = SpriteRenderer; + /** + * Process a batch of frames + * + * @private + * @param {number} initialFrameIndex - The index of frame to start. + */ -_WebGLRenderer2.default.registerPlugin('sprite', SpriteRenderer); -//# sourceMappingURL=SpriteRenderer.js.map + Spritesheet.prototype._processFrames = function _processFrames(initialFrameIndex) { + var frameIndex = initialFrameIndex; + var maxFrames = Spritesheet.BATCH_SIZE; + var sourceScale = this.baseTexture.sourceScale; -/***/ }), -/* 553 */ -/***/ (function(module, exports, __webpack_require__) { + while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) { + var i = this._frameKeys[frameIndex]; + var rect = this._frames[i].frame; -"use strict"; + if (rect) { + var frame = null; + var trim = null; + var orig = new _.Rectangle(0, 0, Math.floor(this._frames[i].sourceSize.w * sourceScale) / this.resolution, Math.floor(this._frames[i].sourceSize.h * sourceScale) / this.resolution); + if (this._frames[i].rotated) { + frame = new _.Rectangle(Math.floor(rect.x * sourceScale) / this.resolution, Math.floor(rect.y * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution); + } else { + frame = new _.Rectangle(Math.floor(rect.x * sourceScale) / this.resolution, Math.floor(rect.y * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution); + } -exports.__esModule = true; -exports.default = generateMultiTextureShader; + // Check to see if the sprite is trimmed + if (this._frames[i].trimmed) { + trim = new _.Rectangle(Math.floor(this._frames[i].spriteSourceSize.x * sourceScale) / this.resolution, Math.floor(this._frames[i].spriteSourceSize.y * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution); + } -var _Shader = __webpack_require__(52); + this.textures[i] = new _.Texture(this.baseTexture, frame, orig, trim, this._frames[i].rotated ? 2 : 0); -var _Shader2 = _interopRequireDefault(_Shader); + // lets also add the frame to pixi's global cache for fromFrame and fromImage functions + _.Texture.addToCache(this.textures[i], i); + } -var _path = __webpack_require__(17); + frameIndex++; + } + }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /** + * The parse has completed. + * + * @private + */ -var fragTemplate = ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'varying float vTextureId;', 'uniform sampler2D uSamplers[%count%];', 'void main(void){', 'vec4 color;', 'float textureId = floor(vTextureId+0.5);', '%forloop%', 'gl_FragColor = color * vColor;', '}'].join('\n'); -function generateMultiTextureShader(gl, maxTextures) { - var vertexSrc = 'precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n'; - var fragmentSrc = fragTemplate; + Spritesheet.prototype._parseComplete = function _parseComplete() { + var callback = this._callback; - fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures); - fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures)); + this._callback = null; + this._batchIndex = 0; + callback.call(this, this.textures); + }; - var shader = new _Shader2.default(gl, vertexSrc, fragmentSrc); + /** + * Begin the next batch of textures. + * + * @private + */ - var sampleValues = []; - for (var i = 0; i < maxTextures; i++) { - sampleValues[i] = i; - } + Spritesheet.prototype._nextBatch = function _nextBatch() { + var _this = this; - shader.bind(); - shader.uniforms.uSamplers = sampleValues; + this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE); + this._batchIndex++; + setTimeout(function () { + if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) { + _this._nextBatch(); + } else { + _this._parseComplete(); + } + }, 0); + }; - return shader; -} + /** + * Destroy Spritesheet and don't use after this. + * + * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well + */ -function generateSampleSrc(maxTextures) { - var src = ''; - src += '\n'; - src += '\n'; + Spritesheet.prototype.destroy = function destroy() { + var destroyBase = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - for (var i = 0; i < maxTextures; i++) { - if (i > 0) { - src += '\nelse '; + for (var i in this.textures) { + this.textures[i].destroy(); } - - if (i < maxTextures - 1) { - src += 'if(textureId == ' + i + '.0)'; + this._frames = null; + this._frameKeys = null; + this.data = null; + this.textures = null; + if (destroyBase) { + this.baseTexture.destroy(); } + this.baseTexture = null; + }; - src += '\n{'; - src += '\n\tcolor = texture2D(uSamplers[' + i + '], vTextureCoord);'; - src += '\n}'; - } - - src += '\n'; - src += '\n'; + return Spritesheet; +}(); - return src; -} -//# sourceMappingURL=generateMultiTextureShader.js.map +exports.default = Spritesheet; +//# sourceMappingURL=Spritesheet.js.map /***/ }), /* 554 */ @@ -59109,820 +62357,654 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _Sprite2 = __webpack_require__(128); - -var _Sprite3 = _interopRequireDefault(_Sprite2); - -var _Texture = __webpack_require__(57); - -var _Texture2 = _interopRequireDefault(_Texture); - -var _math = __webpack_require__(7); - -var _utils = __webpack_require__(5); - -var _const = __webpack_require__(2); - -var _settings = __webpack_require__(10); +var _settings = __webpack_require__(6); var _settings2 = _interopRequireDefault(_settings); -var _TextStyle = __webpack_require__(247); +var _const = __webpack_require__(0); -var _TextStyle2 = _interopRequireDefault(_TextStyle); +var _TickerListener = __webpack_require__(555); + +var _TickerListener2 = _interopRequireDefault(_TickerListener); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint max-depth: [2, 8] */ - - -var defaultDestroyOptions = { - texture: true, - children: false, - baseTexture: true -}; - /** - * A Text Object will create a line or multiple lines of text. To split a line you can use '\n' in your text string, - * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object. - * - * A Text can be created directly from a string and a style object - * - * ```js - * let text = new PIXI.Text('This is a pixi text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'}); - * ``` + * A Ticker class that runs an update loop that other objects listen to. + * This class is composed around listeners + * meant for execution on the next requested animation frame. + * Animation frames are requested only when necessary, + * e.g. When the ticker is started and the emitter has listeners. * * @class - * @extends PIXI.Sprite - * @memberof PIXI + * @memberof PIXI.ticker */ - -var Text = function (_Sprite) { - _inherits(Text, _Sprite); - +var Ticker = function () { /** - * @param {string} text - The string that you would like the text to display - * @param {object|PIXI.TextStyle} [style] - The style parameters - * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text + * */ - function Text(text, style, canvas) { - _classCallCheck(this, Text); + function Ticker() { + var _this = this; - canvas = canvas || document.createElement('canvas'); + _classCallCheck(this, Ticker); - canvas.width = 3; - canvas.height = 3; + /** + * The first listener. All new listeners added are chained on this. + * @private + * @type {TickerListener} + */ + this._head = new _TickerListener2.default(null, null, Infinity); - var texture = _Texture2.default.fromCanvas(canvas); + /** + * Internal current frame request ID + * @private + */ + this._requestId = null; - texture.orig = new _math.Rectangle(); - texture.trim = new _math.Rectangle(); + /** + * Internal value managed by minFPS property setter and getter. + * This is the maximum allowed milliseconds between updates. + * @private + */ + this._maxElapsedMS = 100; /** - * The canvas element that everything is drawn to + * Whether or not this ticker should invoke the method + * {@link PIXI.ticker.Ticker#start} automatically + * when a listener is added. * - * @member {HTMLCanvasElement} + * @member {boolean} + * @default false */ - var _this = _possibleConstructorReturn(this, _Sprite.call(this, texture)); - - _this.canvas = canvas; + this.autoStart = false; /** - * The canvas 2d context that everything is drawn with - * @member {HTMLCanvasElement} + * Scalar time value from last frame to this frame. + * This value is capped by setting {@link PIXI.ticker.Ticker#minFPS} + * and is scaled with {@link PIXI.ticker.Ticker#speed}. + * **Note:** The cap may be exceeded by scaling. + * + * @member {number} + * @default 1 */ - _this.context = _this.canvas.getContext('2d'); + this.deltaTime = 1; /** - * The resolution / device pixel ratio of the canvas. This is set automatically by the renderer. + * Time elapsed in milliseconds from last frame to this frame. + * Opposed to what the scalar {@link PIXI.ticker.Ticker#deltaTime} + * is based, this value is neither capped nor scaled. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. + * Defaults to target frame time + * * @member {number} - * @default 1 + * @default 16.66 */ - _this.resolution = _settings2.default.RESOLUTION; + this.elapsedMS = 1 / _settings2.default.TARGET_FPMS; /** - * Private tracker for the current text. + * The last time {@link PIXI.ticker.Ticker#update} was invoked. + * This value is also reset internally outside of invoking + * update, but only when a new animation frame is requested. + * If the platform supports DOMHighResTimeStamp, + * this value will have a precision of 1 µs. * - * @member {string} - * @private + * @member {number} + * @default -1 */ - _this._text = null; + this.lastTime = -1; /** - * Private tracker for the current style. + * Factor of current {@link PIXI.ticker.Ticker#deltaTime}. + * @example + * // Scales ticker.deltaTime to what would be + * // the equivalent of approximately 120 FPS + * ticker.speed = 2; * - * @member {object} - * @private + * @member {number} + * @default 1 */ - _this._style = null; + this.speed = 1; + /** - * Private listener to track style changes. + * Whether or not this ticker has been started. + * `true` if {@link PIXI.ticker.Ticker#start} has been called. + * `false` if {@link PIXI.ticker.Ticker#stop} has been called. + * While `false`, this value may change to `true` in the + * event of {@link PIXI.ticker.Ticker#autoStart} being `true` + * and a listener is added. * - * @member {Function} - * @private + * @member {boolean} + * @default false */ - _this._styleListener = null; + this.started = false; /** - * Private tracker for the current font. + * Internal tick method bound to ticker instance. + * This is because in early 2015, Function.bind + * is still 60% slower in high performance scenarios. + * Also separating frame requests from update method + * so listeners may be called at any time and with + * any animation API, just invoke ticker.update(time). * - * @member {string} * @private + * @param {number} time - Time since last tick. */ - _this._font = ''; - - _this.text = text; - _this.style = style; + this._tick = function (time) { + _this._requestId = null; - _this.localStyleID = -1; - return _this; + if (_this.started) { + // Invoke listeners now + _this.update(time); + // Listener side effects may have modified ticker state. + if (_this.started && _this._requestId === null && _this._head.next) { + _this._requestId = requestAnimationFrame(_this._tick); + } + } + }; } /** - * Renders text and updates it when needed. + * Conditionally requests a new animation frame. + * If a frame has not already been requested, and if the internal + * emitter has listeners, a new frame is requested. * * @private - * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called. */ - Text.prototype.updateText = function updateText(respectDirty) { - var style = this._style; - - // check if style has changed.. - if (this.localStyleID !== style.styleID) { - this.dirty = true; - this.localStyleID = style.styleID; - } - - if (!this.dirty && respectDirty) { - return; - } - - this._font = Text.getFontStyle(style); - - this.context.font = this._font; - - // word wrap - // preserve original text - var outputText = style.wordWrap ? this.wordWrap(this._text) : this._text; - - // split text into lines - var lines = outputText.split(/(?:\r\n|\r|\n)/); - - // calculate text width - var lineWidths = new Array(lines.length); - var maxLineWidth = 0; - var fontProperties = Text.calculateFontProperties(this._font); - - for (var i = 0; i < lines.length; i++) { - var lineWidth = this.context.measureText(lines[i]).width + (lines[i].length - 1) * style.letterSpacing; - - lineWidths[i] = lineWidth; - maxLineWidth = Math.max(maxLineWidth, lineWidth); - } - - var width = maxLineWidth + style.strokeThickness; - - if (style.dropShadow) { - width += style.dropShadowDistance; - } - - this.canvas.width = Math.ceil((width + style.padding * 2) * this.resolution); - - // calculate text height - var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness; - - var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness) + (lines.length - 1) * lineHeight; - - if (style.dropShadow) { - height += style.dropShadowDistance; - } - - this.canvas.height = Math.ceil((height + style.padding * 2) * this.resolution); - - this.context.scale(this.resolution, this.resolution); - - this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); - - this.context.font = this._font; - this.context.strokeStyle = style.stroke; - this.context.lineWidth = style.strokeThickness; - this.context.textBaseline = style.textBaseline; - this.context.lineJoin = style.lineJoin; - this.context.miterLimit = style.miterLimit; - - var linePositionX = void 0; - var linePositionY = void 0; - - if (style.dropShadow) { - if (style.dropShadowBlur > 0) { - this.context.shadowColor = style.dropShadowColor; - this.context.shadowBlur = style.dropShadowBlur; - } else { - this.context.fillStyle = style.dropShadowColor; - } - - var xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance; - var yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance; - - for (var _i = 0; _i < lines.length; _i++) { - linePositionX = style.strokeThickness / 2; - linePositionY = style.strokeThickness / 2 + _i * lineHeight + fontProperties.ascent; - - if (style.align === 'right') { - linePositionX += maxLineWidth - lineWidths[_i]; - } else if (style.align === 'center') { - linePositionX += (maxLineWidth - lineWidths[_i]) / 2; - } - - if (style.fill) { - this.drawLetterSpacing(lines[_i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding); - - if (style.stroke && style.strokeThickness) { - this.context.strokeStyle = style.dropShadowColor; - this.drawLetterSpacing(lines[_i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding, true); - this.context.strokeStyle = style.stroke; - } - } - } - } - - // set canvas text styles - this.context.fillStyle = this._generateFillStyle(style, lines); - - // draw lines line by line - for (var _i2 = 0; _i2 < lines.length; _i2++) { - linePositionX = style.strokeThickness / 2; - linePositionY = style.strokeThickness / 2 + _i2 * lineHeight + fontProperties.ascent; - - if (style.align === 'right') { - linePositionX += maxLineWidth - lineWidths[_i2]; - } else if (style.align === 'center') { - linePositionX += (maxLineWidth - lineWidths[_i2]) / 2; - } - - if (style.stroke && style.strokeThickness) { - this.drawLetterSpacing(lines[_i2], linePositionX + style.padding, linePositionY + style.padding, true); - } - - if (style.fill) { - this.drawLetterSpacing(lines[_i2], linePositionX + style.padding, linePositionY + style.padding); - } + Ticker.prototype._requestIfNeeded = function _requestIfNeeded() { + if (this._requestId === null && this._head.next) { + // ensure callbacks get correct delta + this.lastTime = performance.now(); + this._requestId = requestAnimationFrame(this._tick); } - - this.updateTexture(); }; /** - * Render the text with letter-spacing. - * @param {string} text - The text to draw - * @param {number} x - Horizontal position to draw the text - * @param {number} y - Vertical position to draw the text - * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the - * text? If not, it's for the inside fill + * Conditionally cancels a pending animation frame. + * * @private */ - Text.prototype.drawLetterSpacing = function drawLetterSpacing(text, x, y) { - var isStroke = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - - var style = this._style; - - // letterSpacing of 0 means normal - var letterSpacing = style.letterSpacing; - - if (letterSpacing === 0) { - if (isStroke) { - this.context.strokeText(text, x, y); - } else { - this.context.fillText(text, x, y); - } - - return; - } - - var characters = String.prototype.split.call(text, ''); - var currentPosition = x; - var index = 0; - var current = ''; - - while (index < text.length) { - current = characters[index++]; - if (isStroke) { - this.context.strokeText(current, currentPosition, y); - } else { - this.context.fillText(current, currentPosition, y); - } - currentPosition += this.context.measureText(current).width + letterSpacing; + Ticker.prototype._cancelIfNeeded = function _cancelIfNeeded() { + if (this._requestId !== null) { + cancelAnimationFrame(this._requestId); + this._requestId = null; } }; /** - * Updates texture size based on canvas size + * Conditionally requests a new animation frame. + * If the ticker has been started it checks if a frame has not already + * been requested, and if the internal emitter has listeners. If these + * conditions are met, a new frame is requested. If the ticker has not + * been started, but autoStart is `true`, then the ticker starts now, + * and continues with the previous conditions to request a new frame. * * @private */ - Text.prototype.updateTexture = function updateTexture() { - var texture = this._texture; - var style = this._style; - - texture.baseTexture.hasLoaded = true; - texture.baseTexture.resolution = this.resolution; - - texture.baseTexture.realWidth = this.canvas.width; - texture.baseTexture.realHeight = this.canvas.height; - texture.baseTexture.width = this.canvas.width / this.resolution; - texture.baseTexture.height = this.canvas.height / this.resolution; - texture.trim.width = texture._frame.width = this.canvas.width / this.resolution; - texture.trim.height = texture._frame.height = this.canvas.height / this.resolution; - - texture.trim.x = -style.padding; - texture.trim.y = -style.padding; - - texture.orig.width = texture._frame.width - style.padding * 2; - texture.orig.height = texture._frame.height - style.padding * 2; - - // call sprite onTextureUpdate to update scale if _width or _height were set - this._onTextureUpdate(); - - texture.baseTexture.emit('update', texture.baseTexture); - - this.dirty = false; + Ticker.prototype._startIfPossible = function _startIfPossible() { + if (this.started) { + this._requestIfNeeded(); + } else if (this.autoStart) { + this.start(); + } }; /** - * Renders the object using the WebGL renderer + * Register a handler for tick events. Calls continuously unless + * it is removed or the ticker is stopped. * - * @param {PIXI.WebGLRenderer} renderer - The renderer + * @param {Function} fn - The listener function to be added for updates + * @param {Function} [context] - The listener context + * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ - Text.prototype.renderWebGL = function renderWebGL(renderer) { - if (this.resolution !== renderer.resolution) { - this.resolution = renderer.resolution; - this.dirty = true; - } - - this.updateText(true); + Ticker.prototype.add = function add(fn, context) { + var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL; - _Sprite.prototype.renderWebGL.call(this, renderer); + return this._addListener(new _TickerListener2.default(fn, context, priority)); }; /** - * Renders the object using the Canvas renderer + * Add a handler for the tick event which is only execute once. * - * @private - * @param {PIXI.CanvasRenderer} renderer - The renderer + * @param {Function} fn - The listener function to be added for one update + * @param {Function} [context] - The listener context + * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ - Text.prototype._renderCanvas = function _renderCanvas(renderer) { - if (this.resolution !== renderer.resolution) { - this.resolution = renderer.resolution; - this.dirty = true; - } - - this.updateText(true); + Ticker.prototype.addOnce = function addOnce(fn, context) { + var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL; - _Sprite.prototype._renderCanvas.call(this, renderer); + return this._addListener(new _TickerListener2.default(fn, context, priority, true)); }; /** - * Applies newlines to a string to have it optimally fit into the horizontal - * bounds set by the Text object's wordWrapWidth property. + * Internally adds the event handler so that it can be sorted by priority. + * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run + * before the rendering. * * @private - * @param {string} text - String to apply word wrapping to - * @return {string} New string with new lines applied where required + * @param {TickerListener} listener - Current listener being added. + * @returns {PIXI.ticker.Ticker} This instance of a ticker */ - Text.prototype.wordWrap = function wordWrap(text) { - // Greedy wrapping algorithm that will wrap words as the line grows longer - // than its horizontal bounds. - var result = ''; - var style = this._style; - var lines = text.split('\n'); - var wordWrapWidth = style.wordWrapWidth; + Ticker.prototype._addListener = function _addListener(listener) { + // For attaching to head + var current = this._head.next; + var previous = this._head; - for (var i = 0; i < lines.length; i++) { - var spaceLeft = wordWrapWidth; - var words = lines[i].split(' '); + // Add the first item + if (!current) { + listener.connect(previous); + } else { + // Go from highest to lowest priority + while (current) { + if (listener.priority > current.priority) { + listener.connect(previous); + break; + } + previous = current; + current = current.next; + } - for (var j = 0; j < words.length; j++) { - var wordWidth = this.context.measureText(words[j]).width; + // Not yet connected + if (!listener.previous) { + listener.connect(previous); + } + } - if (style.breakWords && wordWidth > wordWrapWidth) { - // Word should be split in the middle - var characters = words[j].split(''); + this._startIfPossible(); - for (var c = 0; c < characters.length; c++) { - var characterWidth = this.context.measureText(characters[c]).width; + return this; + }; - if (characterWidth > spaceLeft) { - result += '\n' + characters[c]; - spaceLeft = wordWrapWidth - characterWidth; - } else { - if (c === 0) { - result += ' '; - } + /** + * Removes any handlers matching the function and context parameters. + * If no handlers are left after removing, then it cancels the animation frame. + * + * @param {Function} fn - The listener function to be removed + * @param {Function} [context] - The listener context to be removed + * @returns {PIXI.ticker.Ticker} This instance of a ticker + */ - result += characters[c]; - spaceLeft -= characterWidth; - } - } - } else { - var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width; - if (j === 0 || wordWidthWithSpace > spaceLeft) { - // Skip printing the newline if it's the first word of the line that is - // greater than the word wrap width. - if (j > 0) { - result += '\n'; - } - result += words[j]; - spaceLeft = wordWrapWidth - wordWidth; - } else { - spaceLeft -= wordWidthWithSpace; - result += ' ' + words[j]; - } - } + Ticker.prototype.remove = function remove(fn, context) { + var listener = this._head.next; + + while (listener) { + // We found a match, lets remove it + // no break to delete all possible matches + // incase a listener was added 2+ times + if (listener.match(fn, context)) { + listener = listener.destroy(); + } else { + listener = listener.next; } + } - if (i < lines.length - 1) { - result += '\n'; - } + if (!this._head.next) { + this._cancelIfNeeded(); } - return result; + return this; }; /** - * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. + * Starts the ticker. If the ticker has listeners + * a new animation frame is requested at this point. */ - Text.prototype._calculateBounds = function _calculateBounds() { - this.updateText(true); - this.calculateVertices(); - // if we have already done this on THIS frame. - this._bounds.addQuad(this.vertexData); + Ticker.prototype.start = function start() { + if (!this.started) { + this.started = true; + this._requestIfNeeded(); + } }; /** - * Method to be called upon a TextStyle change. - * @private + * Stops the ticker. If the ticker has requested + * an animation frame it is canceled at this point. */ - Text.prototype._onStyleChange = function _onStyleChange() { - this.dirty = true; + Ticker.prototype.stop = function stop() { + if (this.started) { + this.started = false; + this._cancelIfNeeded(); + } }; /** - * Generates the fill style. Can automatically generate a gradient based on the fill style being an array - * - * @private - * @param {object} style - The style. - * @param {string[]} lines - The lines of text. - * @return {string|number|CanvasGradient} The fill style + * Destroy the ticker and don't use after this. Calling + * this method removes all references to internal events. */ - Text.prototype._generateFillStyle = function _generateFillStyle(style, lines) { - if (!Array.isArray(style.fill)) { - return style.fill; - } + Ticker.prototype.destroy = function destroy() { + this.stop(); - // cocoon on canvas+ cannot generate textures, so use the first colour instead - if (navigator.isCocoonJS) { - return style.fill[0]; + var listener = this._head.next; + + while (listener) { + listener = listener.destroy(true); } - // the gradient will be evenly spaced out according to how large the array is. - // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75 - var gradient = void 0; - var totalIterations = void 0; - var currentIteration = void 0; - var stop = void 0; + this._head.destroy(); + this._head = null; + }; - var width = this.canvas.width / this.resolution; - var height = this.canvas.height / this.resolution; + /** + * Triggers an update. An update entails setting the + * current {@link PIXI.ticker.Ticker#elapsedMS}, + * the current {@link PIXI.ticker.Ticker#deltaTime}, + * invoking all listeners with current deltaTime, + * and then finally setting {@link PIXI.ticker.Ticker#lastTime} + * with the value of currentTime that was provided. + * This method will be called automatically by animation + * frame callbacks if the ticker instance has been started + * and listeners are added. + * + * @param {number} [currentTime=performance.now()] - the current time of execution + */ - if (style.fillGradientType === _const.TEXT_GRADIENT.LINEAR_VERTICAL) { - // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas - gradient = this.context.createLinearGradient(width / 2, 0, width / 2, height); - // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect - // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875 - totalIterations = (style.fill.length + 1) * lines.length; - currentIteration = 0; - for (var i = 0; i < lines.length; i++) { - currentIteration += 1; - for (var j = 0; j < style.fill.length; j++) { - stop = currentIteration / totalIterations; - gradient.addColorStop(stop, style.fill[j]); - currentIteration++; - } - } - } else { - // start the gradient at the center left of the canvas, and end at the center right of the canvas - gradient = this.context.createLinearGradient(0, height / 2, width, height / 2); + Ticker.prototype.update = function update() { + var currentTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now(); - // can just evenly space out the gradients in this case, as multiple lines makes no difference - // to an even left to right gradient - totalIterations = style.fill.length + 1; - currentIteration = 1; + var elapsedMS = void 0; - for (var _i3 = 0; _i3 < style.fill.length; _i3++) { - stop = currentIteration / totalIterations; - gradient.addColorStop(stop, style.fill[_i3]); - currentIteration++; - } - } + // If the difference in time is zero or negative, we ignore most of the work done here. + // If there is no valid difference, then should be no reason to let anyone know about it. + // A zero delta, is exactly that, nothing should update. + // + // The difference in time can be negative, and no this does not mean time traveling. + // This can be the result of a race condition between when an animation frame is requested + // on the current JavaScript engine event loop, and when the ticker's start method is invoked + // (which invokes the internal _requestIfNeeded method). If a frame is requested before + // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests, + // can receive a time argument that can be less than the lastTime value that was set within + // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems. + // + // This check covers this browser engine timing issue, as well as if consumers pass an invalid + // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves. - return gradient; - }; + if (currentTime > this.lastTime) { + // Save uncapped elapsedMS for measurement + elapsedMS = this.elapsedMS = currentTime - this.lastTime; - /** - * Destroys this text object. - * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as - * the majorety of the time the texture will not be shared with any other Sprites. - * - * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options - * have been set to that value - * @param {boolean} [options.children=false] - if set to true, all the children will have their - * destroy method called as well. 'options' will be passed on to those calls. - * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well - * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well - */ + // cap the milliseconds elapsed used for deltaTime + if (elapsedMS > this._maxElapsedMS) { + elapsedMS = this._maxElapsedMS; + } + this.deltaTime = elapsedMS * _settings2.default.TARGET_FPMS * this.speed; - Text.prototype.destroy = function destroy(options) { - if (typeof options === 'boolean') { - options = { children: options }; - } + // Cache a local reference, in-case ticker is destroyed + // during the emit, we can still check for head.next + var head = this._head; - options = Object.assign({}, defaultDestroyOptions, options); + // Invoke listeners added to internal emitter + var listener = head.next; - _Sprite.prototype.destroy.call(this, options); + while (listener) { + listener = listener.emit(this.deltaTime); + } - // make sure to reset the the context and canvas.. dont want this hanging around in memory! - this.context = null; - this.canvas = null; + if (!head.next) { + this._cancelIfNeeded(); + } + } else { + this.deltaTime = this.elapsedMS = 0; + } - this._style = null; + this.lastTime = currentTime; }; /** - * The width of the Text, setting this will actually modify the scale to achieve the value set + * The frames per second at which this ticker is running. + * The default is approximately 60 in most modern browsers. + * **Note:** This does not factor in the value of + * {@link PIXI.ticker.Ticker#speed}, which is specific + * to scaling {@link PIXI.ticker.Ticker#deltaTime}. * * @member {number} + * @readonly */ - /** - * Generates a font style string to use for Text.calculateFontProperties(). Takes the same parameter - * as Text.style. - * - * @static - * @param {object|TextStyle} style - String representing the style of the font - * @return {string} Font style string, for passing to Text.calculateFontProperties() - */ - Text.getFontStyle = function getFontStyle(style) { - style = style || {}; + _createClass(Ticker, [{ + key: 'FPS', + get: function get() { + return 1000 / this.elapsedMS; + } + + /** + * Manages the maximum amount of milliseconds allowed to + * elapse between invoking {@link PIXI.ticker.Ticker#update}. + * This value is used to cap {@link PIXI.ticker.Ticker#deltaTime}, + * but does not effect the measured value of {@link PIXI.ticker.Ticker#FPS}. + * When setting this property it is clamped to a value between + * `0` and `PIXI.settings.TARGET_FPMS * 1000`. + * + * @member {number} + * @default 10 + */ + + }, { + key: 'minFPS', + get: function get() { + return 1000 / this._maxElapsedMS; + }, + set: function set(fps) // eslint-disable-line require-jsdoc + { + // Clamp: 0 to TARGET_FPMS + var minFPMS = Math.min(Math.max(0, fps) / 1000, _settings2.default.TARGET_FPMS); - if (!(style instanceof _TextStyle2.default)) { - style = new _TextStyle2.default(style); + this._maxElapsedMS = 1 / minFPMS; } + }]); - // build canvas api font setting from individual components. Convert a numeric style.fontSize to px - var fontSizeString = typeof style.fontSize === 'number' ? style.fontSize + 'px' : style.fontSize; + return Ticker; +}(); - // Clean-up fontFamily property by quoting each font name - // this will support font names with spaces - var fontFamilies = style.fontFamily; +exports.default = Ticker; +//# sourceMappingURL=Ticker.js.map - if (!Array.isArray(style.fontFamily)) { - fontFamilies = style.fontFamily.split(','); - } +/***/ }), +/* 555 */ +/***/ (function(module, exports, __webpack_require__) { - for (var i = fontFamilies.length - 1; i >= 0; i--) { - // Trim any extra white-space - var fontFamily = fontFamilies[i].trim(); +"use strict"; - // Check if font already contains strings - if (!/([\"\'])[^\'\"]+\1/.test(fontFamily)) { - fontFamily = '"' + fontFamily + '"'; - } - fontFamilies[i] = fontFamily; - } - return style.fontStyle + ' ' + style.fontVariant + ' ' + style.fontWeight + ' ' + fontSizeString + ' ' + fontFamilies.join(','); - }; +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +/** + * Internal class for handling the priority sorting of ticker handlers. + * + * @private + * @class + * @memberof PIXI.ticker + */ +var TickerListener = function () { /** - * Calculates the ascent, descent and fontSize of a given fontStyle + * Constructor * - * @static - * @param {string} fontStyle - String representing the style of the font - * @return {Object} Font properties object + * @param {Function} fn - The listener function to be added for one update + * @param {Function} [context=null] - The listener context + * @param {number} [priority=0] - The priority for emitting + * @param {boolean} [once=false] - If the handler should fire once */ + function TickerListener(fn) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + _classCallCheck(this, TickerListener); - Text.calculateFontProperties = function calculateFontProperties(fontStyle) { - // as this method is used for preparing assets, don't recalculate things if we don't need to - if (Text.fontPropertiesCache[fontStyle]) { - return Text.fontPropertiesCache[fontStyle]; - } + /** + * The handler function to execute. + * @member {Function} + */ + this.fn = fn; - var properties = {}; + /** + * The calling to execute. + * @member {Function} + */ + this.context = context; - var canvas = Text.fontPropertiesCanvas; - var context = Text.fontPropertiesContext; + /** + * The current priority. + * @member {number} + */ + this.priority = priority; - context.font = fontStyle; + /** + * If this should only execute once. + * @member {boolean} + */ + this.once = once; - var width = Math.ceil(context.measureText('|MÉq').width); - var baseline = Math.ceil(context.measureText('M').width); - var height = 2 * baseline; + /** + * The next item in chain. + * @member {TickerListener} + */ + this.next = null; - baseline = baseline * 1.4 | 0; + /** + * The previous item in chain. + * @member {TickerListener} + */ + this.previous = null; - canvas.width = width; - canvas.height = height; + /** + * `true` if this listener has been destroyed already. + * @member {boolean} + * @private + */ + this._destroyed = false; + } - context.fillStyle = '#f00'; - context.fillRect(0, 0, width, height); + /** + * Simple compare function to figure out if a function and context match. + * + * @param {Function} fn - The listener function to be added for one update + * @param {Function} context - The listener context + * @return {boolean} `true` if the listener match the arguments + */ - context.font = fontStyle; - context.textBaseline = 'alphabetic'; - context.fillStyle = '#000'; - context.fillText('|MÉq', 0, baseline); + TickerListener.prototype.match = function match(fn, context) { + context = context || null; - var imagedata = context.getImageData(0, 0, width, height).data; - var pixels = imagedata.length; - var line = width * 4; + return this.fn === fn && this.context === context; + }; - var i = 0; - var idx = 0; - var stop = false; + /** + * Emit by calling the current function. + * @param {number} deltaTime - time since the last emit. + * @return {TickerListener} Next ticker + */ - // ascent. scan from top to bottom until we find a non red pixel - for (i = 0; i < baseline; ++i) { - for (var j = 0; j < line; j += 4) { - if (imagedata[idx + j] !== 255) { - stop = true; - break; - } - } - if (!stop) { - idx += line; + + TickerListener.prototype.emit = function emit(deltaTime) { + if (this.fn) { + if (this.context) { + this.fn.call(this.context, deltaTime); } else { - break; + this.fn(deltaTime); } } - properties.ascent = baseline - i; - - idx = pixels - line; - stop = false; - - // descent. scan from bottom to top until we find a non red pixel - for (i = height; i > baseline; --i) { - for (var _j = 0; _j < line; _j += 4) { - if (imagedata[idx + _j] !== 255) { - stop = true; - break; - } - } + var redirect = this.next; - if (!stop) { - idx -= line; - } else { - break; - } + if (this.once) { + this.destroy(true); } - properties.descent = i - baseline; - properties.fontSize = properties.ascent + properties.descent; - - Text.fontPropertiesCache[fontStyle] = properties; + // Soft-destroying should remove + // the next reference + if (this._destroyed) { + this.next = null; + } - return properties; + return redirect; }; - _createClass(Text, [{ - key: 'width', - get: function get() { - this.updateText(true); - - return Math.abs(this.scale.x) * this._texture.orig.width; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - this.updateText(true); + /** + * Connect to the list. + * @param {TickerListener} previous - Input node, previous listener + */ - var s = (0, _utils.sign)(this.scale.x) || 1; - this.scale.x = s * value / this._texture.orig.width; - this._width = value; + TickerListener.prototype.connect = function connect(previous) { + this.previous = previous; + if (previous.next) { + previous.next.previous = this; } + this.next = previous.next; + previous.next = this; + }; - /** - * The height of the Text, setting this will actually modify the scale to achieve the value set - * - * @member {number} - */ + /** + * Destroy and don't use after this. + * @param {boolean} [hard = false] `true` to remove the `next` reference, this + * is considered a hard destroy. Soft destroy maintains the next reference. + * @return {TickerListener} The listener to redirect while emitting or removing. + */ - }, { - key: 'height', - get: function get() { - this.updateText(true); - return Math.abs(this.scale.y) * this._texture.orig.height; - }, - set: function set(value) // eslint-disable-line require-jsdoc - { - this.updateText(true); + TickerListener.prototype.destroy = function destroy() { + var hard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var s = (0, _utils.sign)(this.scale.y) || 1; + this._destroyed = true; + this.fn = null; + this.context = null; - this.scale.y = s * value / this._texture.orig.height; - this._height = value; + // Disconnect, hook up next and previous + if (this.previous) { + this.previous.next = this.next; } - /** - * Set the style of the text. Set up an event listener to listen for changes on the style - * object and mark the text as dirty. - * - * @member {object|PIXI.TextStyle} - */ - - }, { - key: 'style', - get: function get() { - return this._style; - }, - set: function set(style) // eslint-disable-line require-jsdoc - { - style = style || {}; - - if (style instanceof _TextStyle2.default) { - this._style = style; - } else { - this._style = new _TextStyle2.default(style); - } - - this.localStyleID = -1; - this.dirty = true; + if (this.next) { + this.next.previous = this.previous; } - /** - * Set the copy for the text object. To split a line you can use '\n'. - * - * @member {string} - */ - - }, { - key: 'text', - get: function get() { - return this._text; - }, - set: function set(text) // eslint-disable-line require-jsdoc - { - text = String(text || ' '); - - if (this._text === text) { - return; - } - this._text = text; - this.dirty = true; - } - }]); + // Redirect to the next item + var redirect = this.previous; - return Text; -}(_Sprite3.default); + // Remove references + this.next = hard ? null : redirect; + this.previous = null; -exports.default = Text; + return redirect; + }; + return TickerListener; +}(); -Text.fontPropertiesCache = {}; -Text.fontPropertiesCanvas = document.createElement('canvas'); -Text.fontPropertiesContext = Text.fontPropertiesCanvas.getContext('2d'); -//# sourceMappingURL=Text.js.map +exports.default = TickerListener; +//# sourceMappingURL=TickerListener.js.map /***/ }), -/* 555 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59941,7 +63023,7 @@ function canUploadSameBuffer() { //# sourceMappingURL=canUploadSameBuffer.js.map /***/ }), -/* 556 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59950,7 +63032,7 @@ function canUploadSameBuffer() { exports.__esModule = true; exports.default = determineCrossOrigin; -var _url2 = __webpack_require__(602); +var _url2 = __webpack_require__(271); var _url3 = _interopRequireDefault(_url2); @@ -60002,7 +63084,55 @@ function determineCrossOrigin(url) { //# sourceMappingURL=determineCrossOrigin.js.map /***/ }), -/* 557 */ +/* 558 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.default = mapPremultipliedBlendModes; + +var _const = __webpack_require__(0); + +/** + * Corrects PixiJS blend, takes premultiplied alpha into account + * + * @memberof PIXI + * @function mapPremultipliedBlendModes + * @private + * @param {Array} [array] - The array to output into. + * @return {Array} Mapped modes. + */ + +function mapPremultipliedBlendModes() { + var pm = []; + var npm = []; + + for (var i = 0; i < 32; i++) { + pm[i] = i; + npm[i] = i; + } + + pm[_const.BLEND_MODES.NORMAL_NPM] = _const.BLEND_MODES.NORMAL; + pm[_const.BLEND_MODES.ADD_NPM] = _const.BLEND_MODES.ADD; + pm[_const.BLEND_MODES.SCREEN_NPM] = _const.BLEND_MODES.SCREEN; + + npm[_const.BLEND_MODES.NORMAL] = _const.BLEND_MODES.NORMAL_NPM; + npm[_const.BLEND_MODES.ADD] = _const.BLEND_MODES.ADD_NPM; + npm[_const.BLEND_MODES.SCREEN] = _const.BLEND_MODES.SCREEN_NPM; + + var array = []; + + array.push(npm); + array.push(pm); + + return array; +} +//# sourceMappingURL=mapPremultipliedBlendModes.js.map + +/***/ }), +/* 559 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60011,7 +63141,7 @@ function determineCrossOrigin(url) { exports.__esModule = true; exports.default = maxRecommendedTextures; -var _ismobilejs = __webpack_require__(60); +var _ismobilejs = __webpack_require__(88); var _ismobilejs2 = _interopRequireDefault(_ismobilejs); @@ -60029,7 +63159,74 @@ function maxRecommendedTextures(max) { //# sourceMappingURL=maxRecommendedTextures.js.map /***/ }), -/* 558 */ +/* 560 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.mixin = mixin; +exports.delayMixin = delayMixin; +exports.performMixins = performMixins; +/** + * Mixes all enumerable properties and methods from a source object to a target object. + * + * @memberof PIXI.utils.mixins + * @function mixin + * @param {object} target The prototype or instance that properties and methods should be added to. + * @param {object} source The source of properties and methods to mix in. + */ +function mixin(target, source) { + if (!target || !source) return; + // in ES8/ES2017, this would be really easy: + // Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + + // get all the enumerable property keys + var keys = Object.keys(source); + + // loop through properties + for (var i = 0; i < keys.length; ++i) { + var propertyName = keys[i]; + + // Set the property using the property descriptor - this works for accessors and normal value properties + Object.defineProperty(target, propertyName, Object.getOwnPropertyDescriptor(source, propertyName)); + } +} + +var mixins = []; + +/** + * Queues a mixin to be handled towards the end of the initialization of PIXI, so that deprecation + * can take effect. + * + * @memberof PIXI.utils.mixins + * @function delayMixin + * @private + * @param {object} target The prototype or instance that properties and methods should be added to. + * @param {object} source The source of properties and methods to mix in. + */ +function delayMixin(target, source) { + mixins.push(target, source); +} + +/** + * Handles all mixins queued via delayMixin(). + * + * @memberof PIXI.utils.mixins + * @function performMixins + * @private + */ +function performMixins() { + for (var i = 0; i < mixins.length; i += 2) { + mixin(mixins[i], mixins[i + 1]); + } + mixins.length = 0; +} +//# sourceMappingURL=mixin.js.map + +/***/ }), +/* 561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60100,42 +63297,95 @@ exports.default = { //# sourceMappingURL=pluginTarget.js.map /***/ }), -/* 559 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _core = __webpack_require__(0); - -var core = _interopRequireWildcard(_core); - -var _mesh = __webpack_require__(267); - -var mesh = _interopRequireWildcard(_mesh); +exports.__esModule = true; +exports.default = trimCanvas; +/** + * Trim transparent borders from a canvas + * + * @memberof PIXI + * @function trimCanvas + * @private + * @param {HTMLCanvasElement} canvas - the canvas to trim + * @returns {object} Trim data + */ +function trimCanvas(canvas) { + // https://gist.github.com/remy/784508 -var _particles = __webpack_require__(268); + var width = canvas.width; + var height = canvas.height; -var particles = _interopRequireWildcard(_particles); + var context = canvas.getContext('2d'); + var imageData = context.getImageData(0, 0, width, height); + var pixels = imageData.data; + var len = pixels.length; + + var bound = { + top: null, + left: null, + right: null, + bottom: null + }; + var i = void 0; + var x = void 0; + var y = void 0; + + for (i = 0; i < len; i += 4) { + if (pixels[i + 3] !== 0) { + x = i / 4 % width; + y = ~~(i / 4 / width); + + if (bound.top === null) { + bound.top = y; + } -var _extras = __webpack_require__(132); + if (bound.left === null) { + bound.left = x; + } else if (x < bound.left) { + bound.left = x; + } -var extras = _interopRequireWildcard(_extras); + if (bound.right === null) { + bound.right = x + 1; + } else if (bound.right < x) { + bound.right = x + 1; + } -var _filters = __webpack_require__(259); + if (bound.bottom === null) { + bound.bottom = y; + } else if (bound.bottom < y) { + bound.bottom = y; + } + } + } -var filters = _interopRequireWildcard(_filters); + width = bound.right - bound.left; + height = bound.bottom - bound.top + 1; -var _prepare = __webpack_require__(269); + var data = context.getImageData(bound.left, bound.top, width, height); -var prepare = _interopRequireWildcard(_prepare); + return { + height: height, + width: width, + data: data + }; +} +//# sourceMappingURL=trimCanvas.js.map -var _loaders = __webpack_require__(263); +/***/ }), +/* 563 */ +/***/ (function(module, exports, __webpack_require__) { -var loaders = _interopRequireWildcard(_loaders); +"use strict"; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +exports.__esModule = true; +exports.default = deprecation; // provide method to give a stack track for warnings // useful for tracking-down where deprecated methods/properties/classes // are being used within the code @@ -60164,867 +63414,1072 @@ function warn(msg) { // @endif } -/** - * @class - * @private - * @name SpriteBatch - * @memberof PIXI - * @see PIXI.ParticleContainer - * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. - * @deprecated since version 3.0.0 - */ -core.SpriteBatch = function () { - throw new ReferenceError('SpriteBatch does not exist any more, please use the new ParticleContainer instead.'); -}; +function deprecation(core) { + var mesh = core.mesh, + particles = core.particles, + extras = core.extras, + filters = core.filters, + prepare = core.prepare, + loaders = core.loaders, + interaction = core.interaction; -/** - * @class - * @private - * @name AssetLoader - * @memberof PIXI - * @see PIXI.loaders.Loader - * @throws {ReferenceError} The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class. - * @deprecated since version 3.0.0 - */ -core.AssetLoader = function () { - throw new ReferenceError('The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.'); -}; -Object.defineProperties(core, { + Object.defineProperties(core, { + + /** + * @class + * @private + * @name SpriteBatch + * @memberof PIXI + * @see PIXI.ParticleContainer + * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead. + * @deprecated since version 3.0.0 + */ + SpriteBatch: { + get: function get() { + throw new ReferenceError('SpriteBatch does not exist any more, ' + 'please use the new ParticleContainer instead.'); + } + }, + + /** + * @class + * @private + * @name AssetLoader + * @memberof PIXI + * @see PIXI.loaders.Loader + * @throws {ReferenceError} The loader system was overhauled in PixiJS v3, + * please see the new PIXI.loaders.Loader class. + * @deprecated since version 3.0.0 + */ + AssetLoader: { + get: function get() { + throw new ReferenceError('The loader system was overhauled in PixiJS v3, ' + 'please see the new PIXI.loaders.Loader class.'); + } + }, + + /** + * @class + * @private + * @name Stage + * @memberof PIXI + * @see PIXI.Container + * @deprecated since version 3.0.0 + */ + Stage: { + get: function get() { + warn('You do not need to use a PIXI Stage any more, you can simply render any container.'); + + return core.Container; + } + }, + + /** + * @class + * @private + * @name DisplayObjectContainer + * @memberof PIXI + * @see PIXI.Container + * @deprecated since version 3.0.0 + */ + DisplayObjectContainer: { + get: function get() { + warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.'); + + return core.Container; + } + }, + + /** + * @class + * @private + * @name Strip + * @memberof PIXI + * @see PIXI.mesh.Mesh + * @deprecated since version 3.0.0 + */ + Strip: { + get: function get() { + warn('The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on.'); + + return mesh.Mesh; + } + }, + + /** + * @class + * @private + * @name Rope + * @memberof PIXI + * @see PIXI.mesh.Rope + * @deprecated since version 3.0.0 + */ + Rope: { + get: function get() { + warn('The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on.'); + + return mesh.Rope; + } + }, + + /** + * @class + * @private + * @name ParticleContainer + * @memberof PIXI + * @see PIXI.particles.ParticleContainer + * @deprecated since version 4.0.0 + */ + ParticleContainer: { + get: function get() { + warn('The ParticleContainer class has been moved to particles.ParticleContainer, ' + 'please use particles.ParticleContainer from now on.'); + + return particles.ParticleContainer; + } + }, + + /** + * @class + * @private + * @name MovieClip + * @memberof PIXI + * @see PIXI.extras.MovieClip + * @deprecated since version 3.0.0 + */ + MovieClip: { + get: function get() { + warn('The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite.'); + + return extras.AnimatedSprite; + } + }, + + /** + * @class + * @private + * @name TilingSprite + * @memberof PIXI + * @see PIXI.extras.TilingSprite + * @deprecated since version 3.0.0 + */ + TilingSprite: { + get: function get() { + warn('The TilingSprite class has been moved to extras.TilingSprite, ' + 'please use extras.TilingSprite from now on.'); + + return extras.TilingSprite; + } + }, + + /** + * @class + * @private + * @name BitmapText + * @memberof PIXI + * @see PIXI.extras.BitmapText + * @deprecated since version 3.0.0 + */ + BitmapText: { + get: function get() { + warn('The BitmapText class has been moved to extras.BitmapText, ' + 'please use extras.BitmapText from now on.'); + + return extras.BitmapText; + } + }, + + /** + * @class + * @private + * @name blendModes + * @memberof PIXI + * @see PIXI.BLEND_MODES + * @deprecated since version 3.0.0 + */ + blendModes: { + get: function get() { + warn('The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on.'); + + return core.BLEND_MODES; + } + }, + + /** + * @class + * @private + * @name scaleModes + * @memberof PIXI + * @see PIXI.SCALE_MODES + * @deprecated since version 3.0.0 + */ + scaleModes: { + get: function get() { + warn('The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on.'); + + return core.SCALE_MODES; + } + }, + + /** + * @class + * @private + * @name BaseTextureCache + * @memberof PIXI + * @see PIXI.utils.BaseTextureCache + * @deprecated since version 3.0.0 + */ + BaseTextureCache: { + get: function get() { + warn('The BaseTextureCache class has been moved to utils.BaseTextureCache, ' + 'please use utils.BaseTextureCache from now on.'); + + return core.utils.BaseTextureCache; + } + }, + + /** + * @class + * @private + * @name TextureCache + * @memberof PIXI + * @see PIXI.utils.TextureCache + * @deprecated since version 3.0.0 + */ + TextureCache: { + get: function get() { + warn('The TextureCache class has been moved to utils.TextureCache, ' + 'please use utils.TextureCache from now on.'); + + return core.utils.TextureCache; + } + }, + + /** + * @namespace + * @private + * @name math + * @memberof PIXI + * @see PIXI + * @deprecated since version 3.0.6 + */ + math: { + get: function get() { + warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + + return core; + } + }, + + /** + * @class + * @private + * @name PIXI.AbstractFilter + * @see PIXI.Filter + * @deprecated since version 3.0.6 + */ + AbstractFilter: { + get: function get() { + warn('AstractFilter has been renamed to Filter, please use PIXI.Filter'); + + return core.Filter; + } + }, + + /** + * @class + * @private + * @name PIXI.TransformManual + * @see PIXI.TransformBase + * @deprecated since version 4.0.0 + */ + TransformManual: { + get: function get() { + warn('TransformManual has been renamed to TransformBase, please update your pixi-spine'); + + return core.TransformBase; + } + }, + + /** + * @static + * @constant + * @name PIXI.TARGET_FPMS + * @see PIXI.settings.TARGET_FPMS + * @deprecated since version 4.2.0 + */ + TARGET_FPMS: { + get: function get() { + warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS'); + + return core.settings.TARGET_FPMS; + }, + set: function set(value) { + warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS'); + + core.settings.TARGET_FPMS = value; + } + }, + + /** + * @static + * @constant + * @name PIXI.FILTER_RESOLUTION + * @see PIXI.settings.FILTER_RESOLUTION + * @deprecated since version 4.2.0 + */ + FILTER_RESOLUTION: { + get: function get() { + warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION'); + + return core.settings.FILTER_RESOLUTION; + }, + set: function set(value) { + warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION'); + + core.settings.FILTER_RESOLUTION = value; + } + }, + + /** + * @static + * @constant + * @name PIXI.RESOLUTION + * @see PIXI.settings.RESOLUTION + * @deprecated since version 4.2.0 + */ + RESOLUTION: { + get: function get() { + warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION'); + + return core.settings.RESOLUTION; + }, + set: function set(value) { + warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION'); + + core.settings.RESOLUTION = value; + } + }, + + /** + * @static + * @constant + * @name PIXI.MIPMAP_TEXTURES + * @see PIXI.settings.MIPMAP_TEXTURES + * @deprecated since version 4.2.0 + */ + MIPMAP_TEXTURES: { + get: function get() { + warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES'); + + return core.settings.MIPMAP_TEXTURES; + }, + set: function set(value) { + warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES'); + + core.settings.MIPMAP_TEXTURES = value; + } + }, + + /** + * @static + * @constant + * @name PIXI.SPRITE_BATCH_SIZE + * @see PIXI.settings.SPRITE_BATCH_SIZE + * @deprecated since version 4.2.0 + */ + SPRITE_BATCH_SIZE: { + get: function get() { + warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE'); + + return core.settings.SPRITE_BATCH_SIZE; + }, + set: function set(value) { + warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE'); + + core.settings.SPRITE_BATCH_SIZE = value; + } + }, + + /** + * @static + * @constant + * @name PIXI.SPRITE_MAX_TEXTURES + * @see PIXI.settings.SPRITE_MAX_TEXTURES + * @deprecated since version 4.2.0 + */ + SPRITE_MAX_TEXTURES: { + get: function get() { + warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES'); + + return core.settings.SPRITE_MAX_TEXTURES; + }, + set: function set(value) { + warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES'); + + core.settings.SPRITE_MAX_TEXTURES = value; + } + }, + + /** + * @static + * @constant + * @name PIXI.RETINA_PREFIX + * @see PIXI.settings.RETINA_PREFIX + * @deprecated since version 4.2.0 + */ + RETINA_PREFIX: { + get: function get() { + warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX'); + + return core.settings.RETINA_PREFIX; + }, + set: function set(value) { + warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX'); + + core.settings.RETINA_PREFIX = value; + } + }, - /** - * @class - * @private - * @name Stage - * @memberof PIXI - * @see PIXI.Container - * @deprecated since version 3.0.0 - */ - Stage: { - enumerable: true, - get: function get() { - warn('You do not need to use a PIXI Stage any more, you can simply render any container.'); + /** + * @static + * @constant + * @name PIXI.DEFAULT_RENDER_OPTIONS + * @see PIXI.settings.RENDER_OPTIONS + * @deprecated since version 4.2.0 + */ + DEFAULT_RENDER_OPTIONS: { + get: function get() { + warn('PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS'); - return core.Container; + return core.settings.RENDER_OPTIONS; + } } - }, + }); - /** - * @class - * @private - * @name DisplayObjectContainer - * @memberof PIXI - * @see PIXI.Container - * @deprecated since version 3.0.0 - */ - DisplayObjectContainer: { - enumerable: true, - get: function get() { - warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.'); + // Move the default properties to settings + var defaults = [{ parent: 'TRANSFORM_MODE', target: 'TRANSFORM_MODE' }, { parent: 'GC_MODES', target: 'GC_MODE' }, { parent: 'WRAP_MODES', target: 'WRAP_MODE' }, { parent: 'SCALE_MODES', target: 'SCALE_MODE' }, { parent: 'PRECISION', target: 'PRECISION_FRAGMENT' }]; - return core.Container; - } - }, + var _loop = function _loop(i) { + var deprecation = defaults[i]; - /** - * @class - * @private - * @name Strip - * @memberof PIXI - * @see PIXI.mesh.Mesh - * @deprecated since version 3.0.0 - */ - Strip: { - enumerable: true, - get: function get() { - warn('The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on.'); + Object.defineProperty(core[deprecation.parent], 'DEFAULT', { + get: function get() { + warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, ' + ('please use PIXI.settings.' + deprecation.target)); - return mesh.Mesh; - } - }, + return core.settings[deprecation.target]; + }, + set: function set(value) { + warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, ' + ('please use PIXI.settings.' + deprecation.target)); - /** - * @class - * @private - * @name Rope - * @memberof PIXI - * @see PIXI.mesh.Rope - * @deprecated since version 3.0.0 - */ - Rope: { - enumerable: true, - get: function get() { - warn('The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on.'); + core.settings[deprecation.target] = value; + } + }); + }; - return mesh.Rope; - } - }, + for (var i = 0; i < defaults.length; i++) { + _loop(i); + } - /** - * @class - * @private - * @name ParticleContainer - * @memberof PIXI - * @see PIXI.particles.ParticleContainer - * @deprecated since version 4.0.0 - */ - ParticleContainer: { - enumerable: true, - get: function get() { - warn('The ParticleContainer class has been moved to particles.ParticleContainer, ' + 'please use particles.ParticleContainer from now on.'); + Object.defineProperties(core.settings, { - return particles.ParticleContainer; - } - }, + /** + * @static + * @name PRECISION + * @memberof PIXI.settings + * @see PIXI.PRECISION + * @deprecated since version 4.4.0 + */ + PRECISION: { + get: function get() { + warn('PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT'); - /** - * @class - * @private - * @name MovieClip - * @memberof PIXI - * @see PIXI.extras.MovieClip - * @deprecated since version 3.0.0 - */ - MovieClip: { - enumerable: true, - get: function get() { - warn('The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite.'); + return core.settings.PRECISION_FRAGMENT; + }, + set: function set(value) { + warn('PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT'); - return extras.AnimatedSprite; + core.settings.PRECISION_FRAGMENT = value; + } } - }, + }); - /** - * @class - * @private - * @name TilingSprite - * @memberof PIXI - * @see PIXI.extras.TilingSprite - * @deprecated since version 3.0.0 - */ - TilingSprite: { - enumerable: true, - get: function get() { - warn('The TilingSprite class has been moved to extras.TilingSprite, ' + 'please use extras.TilingSprite from now on.'); + if (extras.AnimatedSprite) { + Object.defineProperties(extras, { - return extras.TilingSprite; - } - }, + /** + * @class + * @name MovieClip + * @memberof PIXI.extras + * @see PIXI.extras.AnimatedSprite + * @deprecated since version 4.2.0 + */ + MovieClip: { + get: function get() { + warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.'); - /** - * @class - * @private - * @name BitmapText - * @memberof PIXI - * @see PIXI.extras.BitmapText - * @deprecated since version 3.0.0 - */ - BitmapText: { - enumerable: true, - get: function get() { - warn('The BitmapText class has been moved to extras.BitmapText, ' + 'please use extras.BitmapText from now on.'); + return extras.AnimatedSprite; + } + } + }); + } - return extras.BitmapText; - } - }, + core.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution) { + warn('generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)'); - /** - * @class - * @private - * @name blendModes - * @memberof PIXI - * @see PIXI.BLEND_MODES - * @deprecated since version 3.0.0 - */ - blendModes: { - enumerable: true, - get: function get() { - warn('The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on.'); + return renderer.generateTexture(this, scaleMode, resolution); + }; - return core.BLEND_MODES; - } - }, + core.Graphics.prototype.generateTexture = function generateTexture(scaleMode, resolution) { + warn('graphics generate texture has moved to the renderer. ' + 'Or to render a graphics to a texture using canvas please use generateCanvasTexture'); - /** - * @class - * @private - * @name scaleModes - * @memberof PIXI - * @see PIXI.SCALE_MODES - * @deprecated since version 3.0.0 - */ - scaleModes: { - enumerable: true, - get: function get() { - warn('The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on.'); + return this.generateCanvasTexture(scaleMode, resolution); + }; - return core.SCALE_MODES; - } - }, + core.RenderTexture.prototype.render = function render(displayObject, matrix, clear, updateTransform) { + this.legacyRenderer.render(displayObject, this, clear, matrix, !updateTransform); + warn('RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)'); + }; - /** - * @class - * @private - * @name BaseTextureCache - * @memberof PIXI - * @see PIXI.utils.BaseTextureCache - * @deprecated since version 3.0.0 - */ - BaseTextureCache: { - enumerable: true, - get: function get() { - warn('The BaseTextureCache class has been moved to utils.BaseTextureCache, ' + 'please use utils.BaseTextureCache from now on.'); + core.RenderTexture.prototype.getImage = function getImage(target) { + warn('RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)'); - return core.utils.BaseTextureCache; - } - }, + return this.legacyRenderer.extract.image(target); + }; - /** - * @class - * @private - * @name TextureCache - * @memberof PIXI - * @see PIXI.utils.TextureCache - * @deprecated since version 3.0.0 - */ - TextureCache: { - enumerable: true, - get: function get() { - warn('The TextureCache class has been moved to utils.TextureCache, ' + 'please use utils.TextureCache from now on.'); + core.RenderTexture.prototype.getBase64 = function getBase64(target) { + warn('RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)'); - return core.utils.TextureCache; - } - }, + return this.legacyRenderer.extract.base64(target); + }; - /** - * @namespace - * @private - * @name math - * @memberof PIXI - * @see PIXI - * @deprecated since version 3.0.6 - */ - math: { - enumerable: true, - get: function get() { - warn('The math namespace is deprecated, please access members already accessible on PIXI.'); + core.RenderTexture.prototype.getCanvas = function getCanvas(target) { + warn('RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)'); - return core; - } - }, + return this.legacyRenderer.extract.canvas(target); + }; - /** - * @class - * @private - * @name PIXI.AbstractFilter - * @see PIXI.Filter - * @deprecated since version 3.0.6 - */ - AbstractFilter: { - enumerable: true, - get: function get() { - warn('AstractFilter has been renamed to Filter, please use PIXI.Filter'); + core.RenderTexture.prototype.getPixels = function getPixels(target) { + warn('RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)'); - return core.Filter; - } - }, + return this.legacyRenderer.pixels(target); + }; /** - * @class + * @method * @private - * @name PIXI.TransformManual - * @see PIXI.TransformBase - * @deprecated since version 4.0.0 + * @name PIXI.Sprite#setTexture + * @see PIXI.Sprite#texture + * @deprecated since version 3.0.0 + * @param {PIXI.Texture} texture - The texture to set to. */ - TransformManual: { - enumerable: true, - get: function get() { - warn('TransformManual has been renamed to TransformBase, please update your pixi-spine'); + core.Sprite.prototype.setTexture = function setTexture(texture) { + this.texture = texture; + warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;'); + }; - return core.TransformBase; - } - }, + if (extras.BitmapText) { + /** + * @method + * @name PIXI.extras.BitmapText#setText + * @see PIXI.extras.BitmapText#text + * @deprecated since version 3.0.0 + * @param {string} text - The text to set to. + */ + extras.BitmapText.prototype.setText = function setText(text) { + this.text = text; + warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \'my text\';'); + }; + } /** - * @static - * @constant - * @name PIXI.TARGET_FPMS - * @see PIXI.settings.TARGET_FPMS - * @deprecated since version 4.2.0 + * @method + * @name PIXI.Text#setText + * @see PIXI.Text#text + * @deprecated since version 3.0.0 + * @param {string} text - The text to set to. */ - TARGET_FPMS: { - enumerable: true, - get: function get() { - warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS'); - - return core.settings.TARGET_FPMS; - }, - set: function set(value) { - warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS'); - - core.settings.TARGET_FPMS = value; - } - }, + core.Text.prototype.setText = function setText(text) { + this.text = text; + warn('setText is now deprecated, please use the text property, e.g : myText.text = \'my text\';'); + }; /** - * @static - * @constant - * @name PIXI.FILTER_RESOLUTION - * @see PIXI.settings.FILTER_RESOLUTION - * @deprecated since version 4.2.0 + * Calculates the ascent, descent and fontSize of a given fontStyle + * + * @name PIXI.Text.calculateFontProperties + * @see PIXI.TextMetrics.measureFont + * @deprecated since version 4.5.0 + * @param {string} font - String representing the style of the font + * @return {Object} Font properties object */ - FILTER_RESOLUTION: { - enumerable: true, - get: function get() { - warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION'); + core.Text.calculateFontProperties = function calculateFontProperties(font) { + warn('Text.calculateFontProperties is now deprecated, please use the TextMetrics.measureFont'); - return core.settings.FILTER_RESOLUTION; - }, - set: function set(value) { - warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION'); + return core.TextMetrics.measureFont(font); + }; - core.settings.FILTER_RESOLUTION = value; - } - }, + Object.defineProperties(core.Text, { + fontPropertiesCache: { + get: function get() { + warn('Text.fontPropertiesCache is deprecated'); - /** - * @static - * @constant - * @name PIXI.RESOLUTION - * @see PIXI.settings.RESOLUTION - * @deprecated since version 4.2.0 - */ - RESOLUTION: { - enumerable: true, - get: function get() { - warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION'); + return core.TextMetrics._fonts; + } + }, + fontPropertiesCanvas: { + get: function get() { + warn('Text.fontPropertiesCanvas is deprecated'); - return core.settings.RESOLUTION; + return core.TextMetrics._canvas; + } }, - set: function set(value) { - warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION'); + fontPropertiesContext: { + get: function get() { + warn('Text.fontPropertiesContext is deprecated'); - core.settings.RESOLUTION = value; + return core.TextMetrics._context; + } } - }, + }); /** - * @static - * @constant - * @name PIXI.MIPMAP_TEXTURES - * @see PIXI.settings.MIPMAP_TEXTURES - * @deprecated since version 4.2.0 + * @method + * @name PIXI.Text#setStyle + * @see PIXI.Text#style + * @deprecated since version 3.0.0 + * @param {*} style - The style to set to. */ - MIPMAP_TEXTURES: { - enumerable: true, - get: function get() { - warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES'); - - return core.settings.MIPMAP_TEXTURES; - }, - set: function set(value) { - warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES'); - - core.settings.MIPMAP_TEXTURES = value; - } - }, + core.Text.prototype.setStyle = function setStyle(style) { + this.style = style; + warn('setStyle is now deprecated, please use the style property, e.g : myText.style = style;'); + }; /** - * @static - * @constant - * @name PIXI.SPRITE_BATCH_SIZE - * @see PIXI.settings.SPRITE_BATCH_SIZE + * @method + * @name PIXI.Text#determineFontProperties + * @see PIXI.Text#measureFontProperties * @deprecated since version 4.2.0 + * @private + * @param {string} fontStyle - String representing the style of the font + * @return {Object} Font properties object */ - SPRITE_BATCH_SIZE: { - enumerable: true, - get: function get() { - warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE'); - - return core.settings.SPRITE_BATCH_SIZE; - }, - set: function set(value) { - warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE'); + core.Text.prototype.determineFontProperties = function determineFontProperties(fontStyle) { + warn('determineFontProperties is now deprecated, please use TextMetrics.measureFont method'); - core.settings.SPRITE_BATCH_SIZE = value; - } - }, + return core.TextMetrics.measureFont(fontStyle); + }; /** - * @static - * @constant - * @name PIXI.SPRITE_MAX_TEXTURES - * @see PIXI.settings.SPRITE_MAX_TEXTURES - * @deprecated since version 4.2.0 + * @method + * @name PIXI.Text.getFontStyle + * @see PIXI.TextMetrics.getFontStyle + * @deprecated since version 4.5.0 + * @param {PIXI.TextStyle} style - The style to use. + * @return {string} Font string */ - SPRITE_MAX_TEXTURES: { - enumerable: true, - get: function get() { - warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES'); + core.Text.getFontStyle = function getFontStyle(style) { + warn('getFontStyle is now deprecated, please use TextStyle.toFontString() instead'); - return core.settings.SPRITE_MAX_TEXTURES; - }, - set: function set(value) { - warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES'); + style = style || {}; - core.settings.SPRITE_MAX_TEXTURES = value; + if (!(style instanceof core.TextStyle)) { + style = new core.TextStyle(style); } - }, - /** - * @static - * @constant - * @name PIXI.RETINA_PREFIX - * @see PIXI.settings.RETINA_PREFIX - * @deprecated since version 4.2.0 - */ - RETINA_PREFIX: { - enumerable: true, - get: function get() { - warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX'); + return style.toFontString(); + }; - return core.settings.RETINA_PREFIX; - }, - set: function set(value) { - warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX'); + Object.defineProperties(core.TextStyle.prototype, { + /** + * Set all properties of a font as a single string + * + * @name PIXI.TextStyle#font + * @deprecated since version 4.0.0 + */ + font: { + get: function get() { + warn('text style property \'font\' is now deprecated, please use the ' + '\'fontFamily\', \'fontSize\', \'fontStyle\', \'fontVariant\' and \'fontWeight\' properties from now on'); - core.settings.RETINA_PREFIX = value; - } - }, + var fontSizeString = typeof this._fontSize === 'number' ? this._fontSize + 'px' : this._fontSize; - /** - * @static - * @constant - * @name PIXI.DEFAULT_RENDER_OPTIONS - * @see PIXI.settings.RENDER_OPTIONS - * @deprecated since version 4.2.0 - */ - DEFAULT_RENDER_OPTIONS: { - enumerable: true, - get: function get() { - warn('PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS'); + return this._fontStyle + ' ' + this._fontVariant + ' ' + this._fontWeight + ' ' + fontSizeString + ' ' + this._fontFamily; + }, + set: function set(font) { + warn('text style property \'font\' is now deprecated, please use the ' + '\'fontFamily\',\'fontSize\',fontStyle\',\'fontVariant\' and \'fontWeight\' properties from now on'); + + // can work out fontStyle from search of whole string + if (font.indexOf('italic') > 1) { + this._fontStyle = 'italic'; + } else if (font.indexOf('oblique') > -1) { + this._fontStyle = 'oblique'; + } else { + this._fontStyle = 'normal'; + } - return core.settings.RENDER_OPTIONS; - } - } -}); + // can work out fontVariant from search of whole string + if (font.indexOf('small-caps') > -1) { + this._fontVariant = 'small-caps'; + } else { + this._fontVariant = 'normal'; + } -// Move the default properties to settings -var defaults = [{ parent: 'TRANSFORM_MODE', target: 'TRANSFORM_MODE' }, { parent: 'GC_MODES', target: 'GC_MODE' }, { parent: 'WRAP_MODES', target: 'WRAP_MODE' }, { parent: 'SCALE_MODES', target: 'SCALE_MODE' }, { parent: 'PRECISION', target: 'PRECISION' }]; + // fontWeight and fontFamily are tricker to find, but it's easier to find the fontSize due to it's units + var splits = font.split(' '); + var fontSizeIndex = -1; -var _loop = function _loop(i) { - var deprecation = defaults[i]; + this._fontSize = 26; + for (var i = 0; i < splits.length; ++i) { + if (splits[i].match(/(px|pt|em|%)/)) { + fontSizeIndex = i; + this._fontSize = splits[i]; + break; + } + } - Object.defineProperty(core[deprecation.parent], 'DEFAULT', { - enumerable: true, - get: function get() { - warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, please use PIXI.settings.' + deprecation.target); + // we can now search for fontWeight as we know it must occur before the fontSize + this._fontWeight = 'normal'; + for (var _i = 0; _i < fontSizeIndex; ++_i) { + if (splits[_i].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)) { + this._fontWeight = splits[_i]; + break; + } + } - return core.settings[deprecation.target]; - }, - set: function set(value) { - warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, please use PIXI.settings.' + deprecation.target); + // and finally join everything together after the fontSize in case the font family has multiple words + if (fontSizeIndex > -1 && fontSizeIndex < splits.length - 1) { + this._fontFamily = ''; + for (var _i2 = fontSizeIndex + 1; _i2 < splits.length; ++_i2) { + this._fontFamily += splits[_i2] + ' '; + } + + this._fontFamily = this._fontFamily.slice(0, -1); + } else { + this._fontFamily = 'Arial'; + } - core.settings[deprecation.target] = value; + this.styleID++; + } } }); -}; - -for (var i = 0; i < defaults.length; i++) { - _loop(i); -} - -Object.defineProperties(extras, { /** - * @class - * @name MovieClip - * @memberof PIXI.extras - * @see PIXI.extras.AnimatedSprite - * @deprecated since version 4.2.0 + * @method + * @name PIXI.Texture#setFrame + * @see PIXI.Texture#setFrame + * @deprecated since version 3.0.0 + * @param {PIXI.Rectangle} frame - The frame to set. */ - MovieClip: { - enumerable: true, - get: function get() { - warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.'); - - return extras.AnimatedSprite; - } - } -}); - -core.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution) { - warn('generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)'); - - return renderer.generateTexture(this, scaleMode, resolution); -}; - -core.Graphics.prototype.generateTexture = function generateTexture(scaleMode, resolution) { - warn('graphics generate texture has moved to the renderer. ' + 'Or to render a graphics to a texture using canvas please use generateCanvasTexture'); - - return this.generateCanvasTexture(scaleMode, resolution); -}; - -core.RenderTexture.prototype.render = function render(displayObject, matrix, clear, updateTransform) { - this.legacyRenderer.render(displayObject, this, clear, matrix, !updateTransform); - warn('RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)'); -}; + core.Texture.prototype.setFrame = function setFrame(frame) { + this.frame = frame; + warn('setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;'); + }; -core.RenderTexture.prototype.getImage = function getImage(target) { - warn('RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)'); + /** + * @static + * @function + * @name PIXI.Texture.addTextureToCache + * @see PIXI.Texture.addToCache + * @deprecated since 4.5.0 + * @param {PIXI.Texture} texture - The Texture to add to the cache. + * @param {string} id - The id that the texture will be stored against. + */ + core.Texture.addTextureToCache = function addTextureToCache(texture, id) { + core.Texture.addToCache(texture, id); + warn('Texture.addTextureToCache is deprecated, please use Texture.addToCache from now on.'); + }; - return this.legacyRenderer.extract.image(target); -}; + /** + * @static + * @function + * @name PIXI.Texture.removeTextureFromCache + * @see PIXI.Texture.removeFromCache + * @deprecated since 4.5.0 + * @param {string} id - The id of the texture to be removed + * @return {PIXI.Texture|null} The texture that was removed + */ + core.Texture.removeTextureFromCache = function removeTextureFromCache(id) { + warn('Texture.removeTextureFromCache is deprecated, please use Texture.removeFromCache from now on. ' + 'Be aware that Texture.removeFromCache does not automatically its BaseTexture from the BaseTextureCache. ' + 'For that, use BaseTexture.removeFromCache'); -core.RenderTexture.prototype.getBase64 = function getBase64(target) { - warn('RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)'); + core.BaseTexture.removeFromCache(id); - return this.legacyRenderer.extract.base64(target); -}; + return core.Texture.removeFromCache(id); + }; -core.RenderTexture.prototype.getCanvas = function getCanvas(target) { - warn('RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)'); + Object.defineProperties(filters, { - return this.legacyRenderer.extract.canvas(target); -}; + /** + * @class + * @private + * @name PIXI.filters.AbstractFilter + * @see PIXI.AbstractFilter + * @deprecated since version 3.0.6 + */ + AbstractFilter: { + get: function get() { + warn('AstractFilter has been renamed to Filter, please use PIXI.Filter'); -core.RenderTexture.prototype.getPixels = function getPixels(target) { - warn('RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)'); + return core.AbstractFilter; + } + }, - return this.legacyRenderer.pixels(target); -}; + /** + * @class + * @private + * @name PIXI.filters.SpriteMaskFilter + * @see PIXI.SpriteMaskFilter + * @deprecated since version 3.0.6 + */ + SpriteMaskFilter: { + get: function get() { + warn('filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on.'); -/** - * @method - * @private - * @name PIXI.Sprite#setTexture - * @see PIXI.Sprite#texture - * @deprecated since version 3.0.0 - * @param {PIXI.Texture} texture - The texture to set to. - */ -core.Sprite.prototype.setTexture = function setTexture(texture) { - this.texture = texture; - warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;'); -}; + return core.SpriteMaskFilter; + } + } + }); -/** - * @method - * @name PIXI.extras.BitmapText#setText - * @see PIXI.extras.BitmapText#text - * @deprecated since version 3.0.0 - * @param {string} text - The text to set to. - */ -extras.BitmapText.prototype.setText = function setText(text) { - this.text = text; - warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \'my text\';'); -}; + /** + * @method + * @name PIXI.utils.uuid + * @see PIXI.utils.uid + * @deprecated since version 3.0.6 + * @return {number} The uid + */ + core.utils.uuid = function () { + warn('utils.uuid() is deprecated, please use utils.uid() from now on.'); -/** - * @method - * @name PIXI.Text#setText - * @see PIXI.Text#text - * @deprecated since version 3.0.0 - * @param {string} text - The text to set to. - */ -core.Text.prototype.setText = function setText(text) { - this.text = text; - warn('setText is now deprecated, please use the text property, e.g : myText.text = \'my text\';'); -}; + return core.utils.uid(); + }; -/** - * @method - * @name PIXI.Text#setStyle - * @see PIXI.Text#style - * @deprecated since version 3.0.0 - * @param {*} style - The style to set to. - */ -core.Text.prototype.setStyle = function setStyle(style) { - this.style = style; - warn('setStyle is now deprecated, please use the style property, e.g : myText.style = style;'); -}; + /** + * @method + * @name PIXI.utils.canUseNewCanvasBlendModes + * @see PIXI.CanvasTinter + * @deprecated + * @return {boolean} Can use blend modes. + */ + core.utils.canUseNewCanvasBlendModes = function () { + warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); -/** - * @method - * @name PIXI.Text#determineFontProperties - * @see PIXI.Text#calculateFontProperties - * @deprecated since version 4.2.0 - * @private - * @param {string} fontStyle - String representing the style of the font - * @return {Object} Font properties object - */ -core.Text.prototype.determineFontProperties = function determineFontProperties(fontStyle) { - warn('determineFontProperties is now deprecated, please use the static calculateFontProperties method, ' + 'e.g : Text.calculateFontProperties(fontStyle);'); + return core.CanvasTinter.canUseMultiply; + }; - return Text.calculateFontProperties(fontStyle); -}; + var saidHello = true; -Object.defineProperties(core.TextStyle.prototype, { /** - * Set all properties of a font as a single string - * - * @name PIXI.TextStyle#font - * @deprecated since version 4.0.0 - */ - font: { + * @name PIXI.utils._saidHello + * @type {boolean} + * @see PIXI.utils.skipHello + * @deprecated since 4.1.0 + */ + Object.defineProperty(core.utils, '_saidHello', { + set: function set(bool) { + if (bool) { + warn('PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()'); + this.skipHello(); + } + saidHello = bool; + }, get: function get() { - warn('text style property \'font\' is now deprecated, please use the ' + '\'fontFamily\', \'fontSize\', \'fontStyle\', \'fontVariant\' and \'fontWeight\' properties from now on'); + return saidHello; + } + }); - var fontSizeString = typeof this._fontSize === 'number' ? this._fontSize + 'px' : this._fontSize; + if (prepare.BasePrepare) { + /** + * @method + * @name PIXI.prepare.BasePrepare#register + * @see PIXI.prepare.BasePrepare#registerFindHook + * @deprecated since version 4.4.2 + * @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array` + * function must return `true` if it was able to add item to the queue. + * @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and + * function must return `true` if it was able to handle upload of item. + * @return {PIXI.BasePrepare} Instance of plugin for chaining. + */ + prepare.BasePrepare.prototype.register = function register(addHook, uploadHook) { + warn('renderer.plugins.prepare.register is now deprecated, ' + 'please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook'); - return this._fontStyle + ' ' + this._fontVariant + ' ' + this._fontWeight + ' ' + fontSizeString + ' ' + this._fontFamily; - }, - set: function set(font) { - warn('text style property \'font\' is now deprecated, please use the ' + '\'fontFamily\',\'fontSize\',fontStyle\',\'fontVariant\' and \'fontWeight\' properties from now on'); - - // can work out fontStyle from search of whole string - if (font.indexOf('italic') > 1) { - this._fontStyle = 'italic'; - } else if (font.indexOf('oblique') > -1) { - this._fontStyle = 'oblique'; - } else { - this._fontStyle = 'normal'; + if (addHook) { + this.registerFindHook(addHook); } - // can work out fontVariant from search of whole string - if (font.indexOf('small-caps') > -1) { - this._fontVariant = 'small-caps'; - } else { - this._fontVariant = 'normal'; + if (uploadHook) { + this.registerUploadHook(uploadHook); } - // fontWeight and fontFamily are tricker to find, but it's easier to find the fontSize due to it's units - var splits = font.split(' '); - var fontSizeIndex = -1; + return this; + }; + } - this._fontSize = 26; - for (var i = 0; i < splits.length; ++i) { - if (splits[i].match(/(px|pt|em|%)/)) { - fontSizeIndex = i; - this._fontSize = splits[i]; - break; - } - } + if (prepare.canvas) { + /** + * The number of graphics or textures to upload to the GPU. + * + * @name PIXI.prepare.canvas.UPLOADS_PER_FRAME + * @static + * @type {number} + * @see PIXI.prepare.BasePrepare.limiter + * @deprecated since 4.2.0 + */ + Object.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', { + set: function set() { + warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer'); + // because we don't have a reference to the renderer, we can't actually set + // the uploads per frame, so we'll have to stick with the warning. + }, + get: function get() { + warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter'); - // we can now search for fontWeight as we know it must occur before the fontSize - this._fontWeight = 'normal'; - for (var _i = 0; _i < fontSizeIndex; ++_i) { - if (splits[_i].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)) { - this._fontWeight = splits[_i]; - break; - } + return NaN; } + }); + } - // and finally join everything together after the fontSize in case the font family has multiple words - if (fontSizeIndex > -1 && fontSizeIndex < splits.length - 1) { - this._fontFamily = ''; - for (var _i2 = fontSizeIndex + 1; _i2 < splits.length; ++_i2) { - this._fontFamily += splits[_i2] + ' '; - } + if (prepare.webgl) { + /** + * The number of graphics or textures to upload to the GPU. + * + * @name PIXI.prepare.webgl.UPLOADS_PER_FRAME + * @static + * @type {number} + * @see PIXI.prepare.BasePrepare.limiter + * @deprecated since 4.2.0 + */ + Object.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', { + set: function set() { + warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer'); + // because we don't have a reference to the renderer, we can't actually set + // the uploads per frame, so we'll have to stick with the warning. + }, + get: function get() { + warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter'); - this._fontFamily = this._fontFamily.slice(0, -1); - } else { - this._fontFamily = 'Arial'; + return NaN; } - - this.styleID++; - } + }); } -}); - -/** - * @method - * @name PIXI.Texture#setFrame - * @see PIXI.Texture#setFrame - * @deprecated since version 3.0.0 - * @param {PIXI.Rectangle} frame - The frame to set. - */ -core.Texture.prototype.setFrame = function setFrame(frame) { - this.frame = frame; - warn('setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;'); -}; - -Object.defineProperties(filters, { - - /** - * @class - * @private - * @name PIXI.filters.AbstractFilter - * @see PIXI.AbstractFilter - * @deprecated since version 3.0.6 - */ - AbstractFilter: { - get: function get() { - warn('AstractFilter has been renamed to Filter, please use PIXI.Filter'); - - return core.AbstractFilter; - } - }, - /** - * @class - * @private - * @name PIXI.filters.SpriteMaskFilter - * @see PIXI.SpriteMaskFilter - * @deprecated since version 3.0.6 - */ - SpriteMaskFilter: { - get: function get() { - warn('filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on.'); + if (loaders.Loader) { + var Resource = loaders.Resource; + var Loader = loaders.Loader; - return core.SpriteMaskFilter; - } - } -}); + Object.defineProperties(Resource.prototype, { + isJson: { + get: function get() { + warn('The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`.'); -/** - * @method - * @name PIXI.utils.uuid - * @see PIXI.utils.uid - * @deprecated since version 3.0.6 - * @return {number} The uid - */ -core.utils.uuid = function () { - warn('utils.uuid() is deprecated, please use utils.uid() from now on.'); + return this.type === Resource.TYPE.JSON; + } + }, + isXml: { + get: function get() { + warn('The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`.'); - return core.utils.uid(); -}; + return this.type === Resource.TYPE.XML; + } + }, + isImage: { + get: function get() { + warn('The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`.'); -/** - * @method - * @name PIXI.utils.canUseNewCanvasBlendModes - * @see PIXI.CanvasTinter - * @deprecated - * @return {boolean} Can use blend modes. - */ -core.utils.canUseNewCanvasBlendModes = function () { - warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on'); + return this.type === Resource.TYPE.IMAGE; + } + }, + isAudio: { + get: function get() { + warn('The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`.'); - return core.CanvasTinter.canUseMultiply; -}; + return this.type === Resource.TYPE.AUDIO; + } + }, + isVideo: { + get: function get() { + warn('The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`.'); -var saidHello = true; + return this.type === Resource.TYPE.VIDEO; + } + } + }); -/** - * @name PIXI.utils._saidHello - * @type {boolean} - * @see PIXI.utils.skipHello - * @deprecated since 4.1.0 - */ -Object.defineProperty(core.utils, '_saidHello', { - set: function set(bool) { - if (bool) { - warn('PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()'); - this.skipHello(); - } - saidHello = bool; - }, - get: function get() { - return saidHello; - } -}); + Object.defineProperties(Loader.prototype, { + before: { + get: function get() { + warn('The before() method is deprecated, please use pre().'); -/** - * The number of graphics or textures to upload to the GPU. - * - * @name PIXI.prepare.canvas.UPLOADS_PER_FRAME - * @static - * @type {number} - * @see PIXI.prepare.BasePrepare.limiter - * @deprecated since 4.2.0 - */ -Object.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', { - set: function set() { - warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer'); - // because we don't have a reference to the renderer, we can't actually set - // the uploads per frame, so we'll have to stick with the warning. - }, - get: function get() { - warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter'); + return this.pre; + } + }, + after: { + get: function get() { + warn('The after() method is deprecated, please use use().'); - return NaN; + return this.use; + } + } + }); } -}); -/** - * The number of graphics or textures to upload to the GPU. - * - * @name PIXI.prepare.webgl.UPLOADS_PER_FRAME - * @static - * @type {number} - * @see PIXI.prepare.BasePrepare.limiter - * @deprecated since 4.2.0 - */ -Object.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', { - set: function set() { - warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer'); - // because we don't have a reference to the renderer, we can't actually set - // the uploads per frame, so we'll have to stick with the warning. - }, - get: function get() { - warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter'); + if (interaction.interactiveTarget) { + /** + * @name PIXI.interaction.interactiveTarget#defaultCursor + * @static + * @type {number} + * @see PIXI.interaction.interactiveTarget#cursor + * @deprecated since 4.3.0 + */ + Object.defineProperty(interaction.interactiveTarget, 'defaultCursor', { + set: function set(value) { + warn('Property defaultCursor has been replaced with \'cursor\'. '); + this.cursor = value; + }, + get: function get() { + warn('Property defaultCursor has been replaced with \'cursor\'. '); - return NaN; + return this.cursor; + } + }); } -}); - -Object.defineProperties(loaders.Resource.prototype, { - isJson: { - get: function get() { - warn('The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`.'); - - return this.type === loaders.Loader.Resource.TYPE.JSON; - } - }, - isXml: { - get: function get() { - warn('The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`.'); - - return this.type === loaders.Loader.Resource.TYPE.XML; - } - }, - isImage: { - get: function get() { - warn('The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`.'); - return this.type === loaders.Loader.Resource.TYPE.IMAGE; - } - }, - isAudio: { - get: function get() { - warn('The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`.'); - - return this.type === loaders.Loader.Resource.TYPE.AUDIO; - } - }, - isVideo: { - get: function get() { - warn('The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`.'); - - return this.type === loaders.Loader.Resource.TYPE.VIDEO; - } - } -}); + if (interaction.InteractionManager) { + /** + * @name PIXI.interaction.InteractionManager#defaultCursorStyle + * @static + * @type {string} + * @see PIXI.interaction.InteractionManager#cursorStyles + * @deprecated since 4.3.0 + */ + Object.defineProperty(interaction.InteractionManager, 'defaultCursorStyle', { + set: function set(value) { + warn('Property defaultCursorStyle has been replaced with \'cursorStyles.default\'. '); + this.cursorStyles.default = value; + }, + get: function get() { + warn('Property defaultCursorStyle has been replaced with \'cursorStyles.default\'. '); -Object.defineProperties(loaders.Loader.prototype, { - before: { - get: function get() { - warn('The before() method is deprecated, please use pre().'); + return this.cursorStyles.default; + } + }); - return this.pre; - } - }, - after: { - get: function get() { - warn('The after() method is deprecated, please use use().'); + /** + * @name PIXI.interaction.InteractionManager#currentCursorStyle + * @static + * @type {string} + * @see PIXI.interaction.InteractionManager#cursorStyles + * @deprecated since 4.3.0 + */ + Object.defineProperty(interaction.InteractionManager, 'currentCursorStyle', { + set: function set(value) { + warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.'); + this.currentCursorMode = value; + }, + get: function get() { + warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.'); - return this.use; - } + return this.currentCursorMode; + } + }); } -}); +} //# sourceMappingURL=deprecation.js.map /***/ }), -/* 560 */ +/* 564 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61032,7 +64487,7 @@ Object.defineProperties(loaders.Loader.prototype, { exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -61048,7 +64503,7 @@ var TEMP_RECT = new core.Rectangle(); * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract * * @class - * @memberof PIXI + * @memberof PIXI.extract */ var CanvasExtract = function () { @@ -61062,9 +64517,9 @@ var CanvasExtract = function () { /** * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture * - * @member {PIXI.CanvasExtract} extract + * @member {PIXI.extract.CanvasExtract} extract * @memberof PIXI.CanvasRenderer# - * @see PIXI.CanvasExtract + * @see PIXI.extract.CanvasExtract */ renderer.extract = this; } @@ -61209,7 +64664,7 @@ core.CanvasRenderer.registerPlugin('extract', CanvasExtract); //# sourceMappingURL=CanvasExtract.js.map /***/ }), -/* 561 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61217,7 +64672,7 @@ core.CanvasRenderer.registerPlugin('extract', CanvasExtract); exports.__esModule = true; -var _WebGLExtract = __webpack_require__(562); +var _WebGLExtract = __webpack_require__(566); Object.defineProperty(exports, 'webgl', { enumerable: true, @@ -61226,7 +64681,7 @@ Object.defineProperty(exports, 'webgl', { } }); -var _CanvasExtract = __webpack_require__(560); +var _CanvasExtract = __webpack_require__(564); Object.defineProperty(exports, 'canvas', { enumerable: true, @@ -61239,7 +64694,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de //# sourceMappingURL=index.js.map /***/ }), -/* 562 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61247,7 +64702,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -61264,7 +64719,7 @@ var BYTES_PER_PIXEL = 4; * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract * * @class - * @memberof PIXI + * @memberof PIXI.extract */ var WebGLExtract = function () { @@ -61278,9 +64733,9 @@ var WebGLExtract = function () { /** * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture * - * @member {PIXI.WebGLExtract} extract + * @member {PIXI.extract.WebGLExtract} extract * @memberof PIXI.WebGLRenderer# - * @see PIXI.WebGLExtract + * @see PIXI.extract.WebGLExtract */ renderer.extract = this; } @@ -61467,7 +64922,7 @@ core.WebGLRenderer.registerPlugin('extract', WebGLExtract); //# sourceMappingURL=WebGLExtract.js.map /***/ }), -/* 563 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61477,7 +64932,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -61522,7 +64977,7 @@ var AnimatedSprite = function (_core$Sprite) { /** * @param {PIXI.Texture[]|FrameObject[]} textures - an array of {@link PIXI.Texture} or frame * objects that make up the animation - * @param {boolean} [autoUpdate=true] - Whether use PIXI.ticker.shared to auto update animation time. + * @param {boolean} [autoUpdate=true] - Whether to use PIXI.ticker.shared to auto update animation time. */ function AnimatedSprite(textures, autoUpdate) { _classCallCheck(this, AnimatedSprite); @@ -61579,6 +65034,13 @@ var AnimatedSprite = function (_core$Sprite) { */ _this.onFrameChange = null; + /** + * Function to call when 'loop' is true, and an AnimatedSprite is played and loops around to start again + * + * @member {Function} + */ + _this.onLoop = null; + /** * Elapsed time since animation has been started, used internally to display current texture * @@ -61627,7 +65089,7 @@ var AnimatedSprite = function (_core$Sprite) { this.playing = true; if (this._autoUpdate) { - core.ticker.shared.add(this.update, this); + core.ticker.shared.add(this.update, this, core.UPDATE_PRIORITY.HIGH); } }; @@ -61718,6 +65180,14 @@ var AnimatedSprite = function (_core$Sprite) { this.onComplete(); } } else if (previousFrame !== this.currentFrame) { + if (this.loop && this.onLoop) { + if (this.animationSpeed > 0 && this.currentFrame < previousFrame) { + this.onLoop(); + } else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) { + this.onLoop(); + } + } + this.updateTexture(); } }; @@ -61732,6 +65202,7 @@ var AnimatedSprite = function (_core$Sprite) { AnimatedSprite.prototype.updateTexture = function updateTexture() { this._texture = this._textures[this.currentFrame]; this._textureID = -1; + this.cachedTint = 0xFFFFFF; if (this.onFrameChange) { this.onFrameChange(this.currentFrame); @@ -61741,12 +65212,18 @@ var AnimatedSprite = function (_core$Sprite) { /** * Stops the AnimatedSprite and destroys it * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - AnimatedSprite.prototype.destroy = function destroy() { + AnimatedSprite.prototype.destroy = function destroy(options) { this.stop(); - _core$Sprite.prototype.destroy.call(this); + _core$Sprite.prototype.destroy.call(this, options); }; /** @@ -61828,6 +65305,8 @@ var AnimatedSprite = function (_core$Sprite) { this._durations.push(value[i].time); } } + this.gotoAndStop(0); + this.updateTexture(); } /** @@ -61857,7 +65336,7 @@ exports.default = AnimatedSprite; //# sourceMappingURL=AnimatedSprite.js.map /***/ }), -/* 564 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61867,14 +65346,18 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _ObservablePoint = __webpack_require__(240); +var _ObservablePoint = __webpack_require__(242); var _ObservablePoint2 = _interopRequireDefault(_ObservablePoint); +var _settings = __webpack_require__(6); + +var _settings2 = _interopRequireDefault(_settings); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -61983,16 +65466,18 @@ var BitmapText = function (_core$Container) { * Disable by setting value to 0 * * @member {number} + * @private */ - _this.maxWidth = 0; + _this._maxWidth = 0; /** * The max line height. This is useful when trying to use the total height of the Text, * ie: when trying to vertically align. * * @member {number} + * @private */ - _this.maxLineHeight = 0; + _this._maxLineHeight = 0; /** * Text anchor. read-only @@ -62035,6 +65520,7 @@ var BitmapText = function (_core$Container) { var line = 0; var lastSpace = -1; var lastSpaceWidth = 0; + var spacesRemoved = 0; var maxLineHeight = 0; for (var i = 0; i < this.text.length; i++) { @@ -62056,10 +65542,11 @@ var BitmapText = function (_core$Container) { continue; } - if (lastSpace !== -1 && this.maxWidth > 0 && pos.x * scale > this.maxWidth) { - core.utils.removeItems(chars, lastSpace, i - lastSpace); + if (lastSpace !== -1 && this._maxWidth > 0 && pos.x * scale > this._maxWidth) { + core.utils.removeItems(chars, lastSpace - spacesRemoved, i - lastSpace); i = lastSpace; lastSpace = -1; + ++spacesRemoved; lineWidths.push(lastSpaceWidth); maxLineWidth = Math.max(maxLineWidth, lastSpaceWidth); @@ -62148,7 +65635,7 @@ var BitmapText = function (_core$Container) { this._glyphs[_i4].y -= this._textHeight * this.anchor.y; } } - this.maxLineHeight = maxLineHeight * scale; + this._maxLineHeight = maxLineHeight * scale; }; /** @@ -62197,6 +65684,65 @@ var BitmapText = function (_core$Container) { */ + /** + * Register a bitmap font with data and a texture. + * + * @static + * @param {XMLDocument} xml - The XML document data. + * @param {PIXI.Texture} texture - Texture with all symbols. + * @return {Object} Result font object with font, size, lineHeight and char fields. + */ + BitmapText.registerFont = function registerFont(xml, texture) { + var data = {}; + var info = xml.getElementsByTagName('info')[0]; + var common = xml.getElementsByTagName('common')[0]; + var res = texture.baseTexture.resolution || _settings2.default.RESOLUTION; + + data.font = info.getAttribute('face'); + data.size = parseInt(info.getAttribute('size'), 10); + data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10) / res; + data.chars = {}; + + // parse letters + var letters = xml.getElementsByTagName('char'); + + for (var i = 0; i < letters.length; i++) { + var letter = letters[i]; + var charCode = parseInt(letter.getAttribute('id'), 10); + + var textureRect = new core.Rectangle(parseInt(letter.getAttribute('x'), 10) / res + texture.frame.x / res, parseInt(letter.getAttribute('y'), 10) / res + texture.frame.y / res, parseInt(letter.getAttribute('width'), 10) / res, parseInt(letter.getAttribute('height'), 10) / res); + + data.chars[charCode] = { + xOffset: parseInt(letter.getAttribute('xoffset'), 10) / res, + yOffset: parseInt(letter.getAttribute('yoffset'), 10) / res, + xAdvance: parseInt(letter.getAttribute('xadvance'), 10) / res, + kerning: {}, + texture: new core.Texture(texture.baseTexture, textureRect) + + }; + } + + // parse kernings + var kernings = xml.getElementsByTagName('kerning'); + + for (var _i5 = 0; _i5 < kernings.length; _i5++) { + var kerning = kernings[_i5]; + var first = parseInt(kerning.getAttribute('first'), 10) / res; + var second = parseInt(kerning.getAttribute('second'), 10) / res; + var amount = parseInt(kerning.getAttribute('amount'), 10) / res; + + if (data.chars[second]) { + data.chars[second].kerning[first] = amount; + } + } + + // I'm leaving this as a temporary fix so we can test the bitmap fonts in v3 + // but it's very likely to change + BitmapText.fonts[data.font] = data; + + return data; + }; + _createClass(BitmapText, [{ key: 'tint', get: function get() { @@ -62302,6 +65848,44 @@ var BitmapText = function (_core$Container) { this.dirty = true; } + /** + * The max width of this bitmap text in pixels. If the text provided is longer than the + * value provided, line breaks will be automatically inserted in the last whitespace. + * Disable by setting value to 0 + * + * @member {number} + */ + + }, { + key: 'maxWidth', + get: function get() { + return this._maxWidth; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + if (this._maxWidth === value) { + return; + } + this._maxWidth = value; + this.dirty = true; + } + + /** + * The max line height. This is useful when trying to use the total height of the Text, + * ie: when trying to vertically align. + * + * @member {number} + * @readonly + */ + + }, { + key: 'maxLineHeight', + get: function get() { + this.validate(); + + return this._maxLineHeight; + } + /** * The width of the overall text, different from fontSize, * which is defined in the style object @@ -62345,7 +65929,7 @@ BitmapText.fonts = {}; //# sourceMappingURL=BitmapText.js.map /***/ }), -/* 565 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -62355,7 +65939,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -62363,7 +65947,7 @@ var _CanvasTinter = __webpack_require__(129); var _CanvasTinter2 = _interopRequireDefault(_CanvasTinter); -var _TextureTransform = __webpack_require__(253); +var _TextureTransform = __webpack_require__(133); var _TextureTransform2 = _interopRequireDefault(_TextureTransform); @@ -62477,6 +66061,7 @@ var TilingSprite = function (_core$Sprite) { if (this.uvTransform) { this.uvTransform.texture = this._texture; } + this.cachedTint = 0xFFFFFF; }; /** @@ -62521,27 +66106,24 @@ var TilingSprite = function (_core$Sprite) { var transform = this.worldTransform; var resolution = renderer.resolution; var baseTexture = texture.baseTexture; - var baseTextureResolution = texture.baseTexture.resolution; - var modX = this.tilePosition.x / this.tileScale.x % texture._frame.width; - var modY = this.tilePosition.y / this.tileScale.y % texture._frame.height; + var baseTextureResolution = baseTexture.resolution; + var modX = this.tilePosition.x / this.tileScale.x % texture._frame.width * baseTextureResolution; + var modY = this.tilePosition.y / this.tileScale.y % texture._frame.height * baseTextureResolution; // create a nice shiny pattern! - // TODO this needs to be refreshed if texture changes.. - if (!this._canvasPattern) { + if (this._textureID !== this._texture._updateID || this.cachedTint !== this.tint) { + this._textureID = this._texture._updateID; // cut an object from a spritesheet.. var tempCanvas = new core.CanvasRenderTarget(texture._frame.width, texture._frame.height, baseTextureResolution); // Tint the tiling sprite if (this.tint !== 0xFFFFFF) { - if (this.cachedTint !== this.tint) { - this.cachedTint = this.tint; - - this.tintedTexture = _CanvasTinter2.default.getTintedTexture(this, this.tint); - } + this.tintedTexture = _CanvasTinter2.default.getTintedTexture(this, this.tint); tempCanvas.context.drawImage(this.tintedTexture, 0, 0); } else { - tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x, -texture._frame.y); + tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x * baseTextureResolution, -texture._frame.y * baseTextureResolution); } + this.cachedTint = this.tint; this._canvasPattern = tempCanvas.context.createPattern(tempCanvas.canvas, 'repeat'); } @@ -62549,16 +66131,26 @@ var TilingSprite = function (_core$Sprite) { context.globalAlpha = this.worldAlpha; context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution); + renderer.setBlendMode(this.blendMode); + + // fill the pattern! + context.fillStyle = this._canvasPattern; + // TODO - this should be rolled into the setTransform above.. context.scale(this.tileScale.x / baseTextureResolution, this.tileScale.y / baseTextureResolution); - context.translate(modX + this.anchor.x * -this._width, modY + this.anchor.y * -this._height); + var anchorX = this.anchor.x * -this._width; + var anchorY = this.anchor.y * -this._height; - renderer.setBlendMode(this.blendMode); + if (this.uvRespectAnchor) { + context.translate(modX, modY); - // fill the pattern! - context.fillStyle = this._canvasPattern; - context.fillRect(-modX, -modY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution); + context.fillRect(-modX + anchorX, -modY + anchorY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution); + } else { + context.translate(modX + anchorX, modY + anchorY); + + context.fillRect(-modX, -modY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution); + } }; /** @@ -62622,10 +66214,10 @@ var TilingSprite = function (_core$Sprite) { var height = this._height; var x1 = -width * this.anchor._x; - if (tempPoint.x > x1 && tempPoint.x < x1 + width) { + if (tempPoint.x >= x1 && tempPoint.x < x1 + width) { var y1 = -height * this.anchor._y; - if (tempPoint.y > y1 && tempPoint.y < y1 + height) { + if (tempPoint.y >= y1 && tempPoint.y < y1 + height) { return true; } } @@ -62634,13 +66226,19 @@ var TilingSprite = function (_core$Sprite) { }; /** - * Destroys this tiling sprite + * Destroys this sprite and optionally its texture and children * + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value + * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy + * method called as well. 'options' will be passed on to those calls. + * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well + * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well */ - TilingSprite.prototype.destroy = function destroy() { - _core$Sprite.prototype.destroy.call(this); + TilingSprite.prototype.destroy = function destroy(options) { + _core$Sprite.prototype.destroy.call(this, options); this.tileTransform = null; this.uvTransform = null; @@ -62786,16 +66384,28 @@ exports.default = TilingSprite; //# sourceMappingURL=TilingSprite.js.map /***/ }), -/* 566 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); +var _Texture = __webpack_require__(37); + +var _Texture2 = _interopRequireDefault(_Texture); + +var _BaseTexture = __webpack_require__(48); + +var _BaseTexture2 = _interopRequireDefault(_BaseTexture); + +var _utils = __webpack_require__(3); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -62821,6 +66431,8 @@ var CacheData = function CacheData() { _classCallCheck(this, CacheData); + this.textureCacheId = null; + this.originalRenderWebGL = null; this.originalRenderCanvas = null; this.originalCalculateBounds = null; @@ -62841,6 +66453,9 @@ Object.defineProperties(DisplayObject.prototype, { * provide a performance benefit for complex static displayObjects. * To remove simply set this property to 'false' * + * IMPORTANT GOTCHA - make sure that all your textures are preloaded BEFORE setting this property to true + * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear. + * * @member {boolean} * @memberof PIXI.DisplayObject# */ @@ -62969,6 +66584,13 @@ DisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayOb var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0); + var textureCacheId = 'cacheAsBitmap_' + (0, _utils.uid)(); + + this._cacheData.textureCacheId = textureCacheId; + + _BaseTexture2.default.addToCache(renderTexture.baseTexture, textureCacheId); + _Texture2.default.addToCache(renderTexture, textureCacheId); + // need to set // var m = _tempMatrix; @@ -63011,7 +66633,13 @@ DisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayOb this.transform._parentID = -1; // restore the transform of the cached sprite to avoid the nasty flicker.. - this.updateTransform(); + if (!this.parent) { + this.parent = renderer._tempDisplayObjectParent; + this.updateTransform(); + this.parent = null; + } else { + this.updateTransform(); + } // map the hit test.. this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite); @@ -63060,6 +66688,13 @@ DisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDis var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0); + var textureCacheId = 'cacheAsBitmap_' + (0, _utils.uid)(); + + this._cacheData.textureCacheId = textureCacheId; + + _BaseTexture2.default.addToCache(renderTexture.baseTexture, textureCacheId); + _Texture2.default.addToCache(renderTexture, textureCacheId); + // need to set // var m = _tempMatrix; @@ -63094,7 +66729,14 @@ DisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDis cachedSprite._bounds = this._bounds; cachedSprite.alpha = cacheAlpha; - this.updateTransform(); + if (!this.parent) { + this.parent = renderer._tempDisplayObjectParent; + this.updateTransform(); + this.parent = null; + } else { + this.updateTransform(); + } + this.updateTransform = this.displayObjectUpdateTransform; this._cacheData.sprite = cachedSprite; @@ -63129,27 +66771,35 @@ DisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() DisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() { this._cacheData.sprite._texture.destroy(true); this._cacheData.sprite = null; + + _BaseTexture2.default.removeFromCache(this._cacheData.textureCacheId); + _Texture2.default.removeFromCache(this._cacheData.textureCacheId); + + this._cacheData.textureCacheId = null; }; /** * Destroys the cached object. * * @private + * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options + * have been set to that value. + * Used when destroying containers, see the Container.destroy method. */ -DisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy() { +DisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) { this.cacheAsBitmap = false; - this.destroy(); + this.destroy(options); }; //# sourceMappingURL=cacheAsBitmap.js.map /***/ }), -/* 567 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -63182,13 +66832,13 @@ core.Container.prototype.getChildByName = function getChildByName(name) { //# sourceMappingURL=getChildByName.js.map /***/ }), -/* 568 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -63220,7 +66870,7 @@ core.DisplayObject.prototype.getGlobalPosition = function getGlobalPosition() { //# sourceMappingURL=getGlobalPosition.js.map /***/ }), -/* 569 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63228,13 +66878,13 @@ core.DisplayObject.prototype.getGlobalPosition = function getGlobalPosition() { exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _const = __webpack_require__(2); +var _const = __webpack_require__(0); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -63245,13 +66895,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var tempMat = new core.Matrix(); -var tempArray = new Float32Array(4); /** * WebGL renderer plugin for tiling sprites * * @class - * @memberof PIXI + * @memberof PIXI.extras * @extends PIXI.ObjectRenderer */ @@ -63284,8 +66933,8 @@ var TilingSpriteRenderer = function (_core$ObjectRenderer) { TilingSpriteRenderer.prototype.onContextChange = function onContextChange() { var gl = this.renderer.gl; - this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n vec4 color = vec4(uColor.rgb * uColor.a, uColor.a);\n\n gl_FragColor = sample * color ;\n}\n'); - this.simpleShader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n vec4 color = vec4(uColor.rgb * uColor.a, uColor.a);\n gl_FragColor = sample * color;\n}\n'); + this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n gl_FragColor = sample * uColor;\n}\n'); + this.simpleShader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n'); this.renderer.bindVao(null); this.quad = new core.Quad(gl, this.renderer.state.attribState); @@ -63360,7 +67009,7 @@ var TilingSpriteRenderer = function (_core$ObjectRenderer) { tempMat.invert(); if (isSimple) { - tempMat.append(uv.mapCoord); + tempMat.prepend(uv.mapCoord); } else { shader.uniforms.uMapCoord = uv.mapCoord.toArray(true); shader.uniforms.uClampFrame = uv.uClampFrame; @@ -63368,17 +67017,12 @@ var TilingSpriteRenderer = function (_core$ObjectRenderer) { } shader.uniforms.uTransform = tempMat.toArray(true); - - var color = tempArray; - - core.utils.hex2rgb(ts.tint, color); - color[3] = ts.worldAlpha; - shader.uniforms.uColor = color; + shader.uniforms.uColor = core.utils.premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.premultipliedAlpha); shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true); shader.uniforms.uSampler = renderer.bindTexture(tex); - renderer.setBlendMode(ts.blendMode); + renderer.setBlendMode(core.utils.correctBlendMode(ts.blendMode, baseTex.premultipliedAlpha)); quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0); }; @@ -63393,7 +67037,7 @@ core.WebGLRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer); //# sourceMappingURL=TilingSpriteRenderer.js.map /***/ }), -/* 570 */ +/* 574 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63403,15 +67047,15 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _BlurXFilter = __webpack_require__(254); +var _BlurXFilter = __webpack_require__(255); var _BlurXFilter2 = _interopRequireDefault(_BlurXFilter); -var _BlurYFilter = __webpack_require__(255); +var _BlurYFilter = __webpack_require__(256); var _BlurYFilter2 = _interopRequireDefault(_BlurYFilter); @@ -63449,10 +67093,9 @@ var BlurFilter = function (_core$Filter) { _this.blurXFilter = new _BlurXFilter2.default(strength, quality, resolution, kernelSize); _this.blurYFilter = new _BlurYFilter2.default(strength, quality, resolution, kernelSize); - _this.resolution = 1; _this.padding = 0; - _this.resolution = resolution || 1; + _this.resolution = resolution || core.settings.RESOLUTION; _this.quality = quality || 4; _this.blur = strength || 8; return _this; @@ -63547,6 +67190,23 @@ var BlurFilter = function (_core$Filter) { this.blurYFilter.blur = value; this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2; } + + /** + * Sets the blendmode of the filter + * + * @member {number} + * @default PIXI.BLEND_MODES.NORMAL + */ + + }, { + key: 'blendMode', + get: function get() { + return this.blurYFilter._blendMode; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this.blurYFilter._blendMode = value; + } }]); return BlurFilter; @@ -63556,7 +67216,7 @@ exports.default = BlurFilter; //# sourceMappingURL=BlurFilter.js.map /***/ }), -/* 571 */ +/* 575 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -63566,11 +67226,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -63608,9 +67268,11 @@ var ColorMatrixFilter = function (_core$Filter) { // vertex shader 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}', // fragment shader - 'varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\n\nvoid main(void)\n{\n\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n gl_FragColor.r = (m[0] * c.r);\n gl_FragColor.r += (m[1] * c.g);\n gl_FragColor.r += (m[2] * c.b);\n gl_FragColor.r += (m[3] * c.a);\n gl_FragColor.r += m[4] * c.a;\n\n gl_FragColor.g = (m[5] * c.r);\n gl_FragColor.g += (m[6] * c.g);\n gl_FragColor.g += (m[7] * c.b);\n gl_FragColor.g += (m[8] * c.a);\n gl_FragColor.g += m[9] * c.a;\n\n gl_FragColor.b = (m[10] * c.r);\n gl_FragColor.b += (m[11] * c.g);\n gl_FragColor.b += (m[12] * c.b);\n gl_FragColor.b += (m[13] * c.a);\n gl_FragColor.b += m[14] * c.a;\n\n gl_FragColor.a = (m[15] * c.r);\n gl_FragColor.a += (m[16] * c.g);\n gl_FragColor.a += (m[17] * c.b);\n gl_FragColor.a += (m[18] * c.a);\n gl_FragColor.a += m[19] * c.a;\n\n// gl_FragColor = vec4(m[0]);\n}\n')); + 'varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n')); _this.uniforms.m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; + + _this.alpha = 1; return _this; } @@ -63654,28 +67316,28 @@ var ColorMatrixFilter = function (_core$Filter) { out[1] = a[0] * b[1] + a[1] * b[6] + a[2] * b[11] + a[3] * b[16]; out[2] = a[0] * b[2] + a[1] * b[7] + a[2] * b[12] + a[3] * b[17]; out[3] = a[0] * b[3] + a[1] * b[8] + a[2] * b[13] + a[3] * b[18]; - out[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19]; + out[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19] + a[4]; // Green Channel out[5] = a[5] * b[0] + a[6] * b[5] + a[7] * b[10] + a[8] * b[15]; out[6] = a[5] * b[1] + a[6] * b[6] + a[7] * b[11] + a[8] * b[16]; out[7] = a[5] * b[2] + a[6] * b[7] + a[7] * b[12] + a[8] * b[17]; out[8] = a[5] * b[3] + a[6] * b[8] + a[7] * b[13] + a[8] * b[18]; - out[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19]; + out[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19] + a[9]; // Blue Channel out[10] = a[10] * b[0] + a[11] * b[5] + a[12] * b[10] + a[13] * b[15]; out[11] = a[10] * b[1] + a[11] * b[6] + a[12] * b[11] + a[13] * b[16]; out[12] = a[10] * b[2] + a[11] * b[7] + a[12] * b[12] + a[13] * b[17]; out[13] = a[10] * b[3] + a[11] * b[8] + a[12] * b[13] + a[13] * b[18]; - out[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19]; + out[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19] + a[14]; // Alpha Channel out[15] = a[15] * b[0] + a[16] * b[5] + a[17] * b[10] + a[18] * b[15]; out[16] = a[15] * b[1] + a[16] * b[6] + a[17] * b[11] + a[18] * b[16]; out[17] = a[15] * b[2] + a[16] * b[7] + a[17] * b[12] + a[18] * b[17]; out[18] = a[15] * b[3] + a[16] * b[8] + a[17] * b[13] + a[18] * b[18]; - out[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19]; + out[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19] + a[19]; return out; }; @@ -63805,7 +67467,7 @@ var ColorMatrixFilter = function (_core$Filter) { ColorMatrixFilter.prototype.contrast = function contrast(amount, multiply) { var v = (amount || 0) + 1; - var o = -128 * (v - 1); + var o = -0.5 * (v - 1); var matrix = [v, 0, 0, 0, o, 0, v, 0, 0, o, 0, 0, v, 0, o, 0, 0, 0, 1, 0]; @@ -64076,6 +67738,27 @@ var ColorMatrixFilter = function (_core$Filter) { { this.uniforms.m = value; } + + /** + * The opacity value to use when mixing the original and resultant colors. + * + * When the value is 0, the original color is used without modification. + * When the value is 1, the result color is used. + * When in the range (0, 1) the color is interpolated between the original and result by this amount. + * + * @member {number} + * @default 1 + */ + + }, { + key: 'alpha', + get: function get() { + return this.uniforms.uAlpha; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this.uniforms.uAlpha = value; + } }]); return ColorMatrixFilter; @@ -64089,7 +67772,7 @@ ColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale; //# sourceMappingURL=ColorMatrixFilter.js.map /***/ }), -/* 572 */ +/* 576 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64099,11 +67782,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -64147,8 +67830,8 @@ var DisplacementFilter = function (_core$Filter) { _this.maskSprite = sprite; _this.maskMatrix = maskMatrix; - _this.uniforms.mapSampler = sprite.texture; - _this.uniforms.filterMatrix = maskMatrix.toArray(true); + _this.uniforms.mapSampler = sprite._texture; + _this.uniforms.filterMatrix = maskMatrix; _this.uniforms.scale = { x: 1, y: 1 }; if (scale === null || scale === undefined) { @@ -64204,7 +67887,7 @@ exports.default = DisplacementFilter; //# sourceMappingURL=DisplacementFilter.js.map /***/ }), -/* 573 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64212,11 +67895,11 @@ exports.default = DisplacementFilter; exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -64263,7 +67946,91 @@ exports.default = FXAAFilter; //# sourceMappingURL=FXAAFilter.js.map /***/ }), -/* 574 */ +/* 578 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _FXAAFilter = __webpack_require__(577); + +Object.defineProperty(exports, 'FXAAFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_FXAAFilter).default; + } +}); + +var _NoiseFilter = __webpack_require__(579); + +Object.defineProperty(exports, 'NoiseFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_NoiseFilter).default; + } +}); + +var _DisplacementFilter = __webpack_require__(576); + +Object.defineProperty(exports, 'DisplacementFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_DisplacementFilter).default; + } +}); + +var _BlurFilter = __webpack_require__(574); + +Object.defineProperty(exports, 'BlurFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BlurFilter).default; + } +}); + +var _BlurXFilter = __webpack_require__(255); + +Object.defineProperty(exports, 'BlurXFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BlurXFilter).default; + } +}); + +var _BlurYFilter = __webpack_require__(256); + +Object.defineProperty(exports, 'BlurYFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BlurYFilter).default; + } +}); + +var _ColorMatrixFilter = __webpack_require__(575); + +Object.defineProperty(exports, 'ColorMatrixFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_ColorMatrixFilter).default; + } +}); + +var _VoidFilter = __webpack_require__(580); + +Object.defineProperty(exports, 'VoidFilter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_VoidFilter).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map + +/***/ }), +/* 579 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64273,11 +68040,11 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -64303,23 +68070,28 @@ var NoiseFilter = function (_core$Filter) { _inherits(NoiseFilter, _core$Filter); /** - * + * @param {number} noise - The noise intensity, should be a normalized value in the range [0, 1]. + * @param {number} seed - A random seed for the noise generation. Default is `Math.random()`. */ function NoiseFilter() { + var noise = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5; + var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Math.random(); + _classCallCheck(this, NoiseFilter); var _this = _possibleConstructorReturn(this, _core$Filter.call(this, // vertex shader 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}', // fragment shader - 'precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float noise;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n float diff = (rand(gl_FragCoord.xy) - 0.5) * noise;\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n gl_FragColor = color;\n}\n')); + 'precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n')); - _this.noise = 0.5; + _this.noise = noise; + _this.seed = seed; return _this; } /** - * The amount of noise to apply. + * The amount of noise to apply, this value should be in the range (0, 1]. * * @member {number} * @default 0.5 @@ -64329,11 +68101,27 @@ var NoiseFilter = function (_core$Filter) { _createClass(NoiseFilter, [{ key: 'noise', get: function get() { - return this.uniforms.noise; + return this.uniforms.uNoise; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this.uniforms.uNoise = value; + } + + /** + * A seed value to apply to the random noise generation. `Math.random()` is a good value to use. + * + * @member {number} + */ + + }, { + key: 'seed', + get: function get() { + return this.uniforms.uSeed; }, set: function set(value) // eslint-disable-line require-jsdoc { - this.uniforms.noise = value; + this.uniforms.uSeed = value; } }]); @@ -64344,7 +68132,7 @@ exports.default = NoiseFilter; //# sourceMappingURL=NoiseFilter.js.map /***/ }), -/* 575 */ +/* 580 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64352,11 +68140,11 @@ exports.default = NoiseFilter; exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -64399,7 +68187,7 @@ exports.default = VoidFilter; //# sourceMappingURL=VoidFilter.js.map /***/ }), -/* 576 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64407,97 +68195,9 @@ exports.default = VoidFilter; exports.__esModule = true; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Event class that mimics native DOM events. - * - * @class - * @memberof PIXI.interaction - */ -var InteractionEvent = function () { - /** - * - */ - function InteractionEvent() { - _classCallCheck(this, InteractionEvent); - - /** - * Whether this event will continue propagating in the tree - * - * @member {boolean} - */ - this.stopped = false; - - /** - * The object which caused this event to be dispatched. - * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}. - * - * @member {PIXI.DisplayObject} - */ - this.target = null; - - /** - * The object whose event listener’s callback is currently being invoked. - * - * @member {PIXI.DisplayObject} - */ - this.currentTarget = null; - - /* - * Type of the event - * - * @member {string} - */ - this.type = null; - - /* - * InteractionData related to this event - * - * @member {PIXI.interaction.InteractionData} - */ - this.data = null; - } - - /** - * Prevents event from reaching any objects other than the current object. - * - */ - - - InteractionEvent.prototype.stopPropagation = function stopPropagation() { - this.stopped = true; - }; - - /** - * Prevents event from reaching any objects other than the current object. - * - * @private - */ - - - InteractionEvent.prototype._reset = function _reset() { - this.stopped = false; - this.currentTarget = null; - this.target = null; - }; - - return InteractionEvent; -}(); - -exports.default = InteractionEvent; -//# sourceMappingURL=InteractionEvent.js.map - -/***/ }), -/* 577 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -64505,21 +68205,21 @@ var _InteractionData = __webpack_require__(260); var _InteractionData2 = _interopRequireDefault(_InteractionData); -var _InteractionEvent = __webpack_require__(576); +var _InteractionEvent = __webpack_require__(261); var _InteractionEvent2 = _interopRequireDefault(_InteractionEvent); -var _eventemitter = __webpack_require__(24); +var _InteractionTrackingData = __webpack_require__(262); -var _eventemitter2 = _interopRequireDefault(_eventemitter); +var _InteractionTrackingData2 = _interopRequireDefault(_InteractionTrackingData); -var _interactiveTarget = __webpack_require__(261); +var _eventemitter = __webpack_require__(30); -var _interactiveTarget2 = _interopRequireDefault(_interactiveTarget); +var _eventemitter2 = _interopRequireDefault(_eventemitter); -var _ismobilejs = __webpack_require__(60); +var _interactiveTarget = __webpack_require__(263); -var _ismobilejs2 = _interopRequireDefault(_ismobilejs); +var _interactiveTarget2 = _interopRequireDefault(_interactiveTarget); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -64531,11 +68231,21 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -// Mix interactiveTarget into core.DisplayObject.prototype -Object.assign(core.DisplayObject.prototype, _interactiveTarget2.default); +// Mix interactiveTarget into core.DisplayObject.prototype, after deprecation has been handled +core.utils.mixins.delayMixin(core.DisplayObject.prototype, _interactiveTarget2.default); + +var MOUSE_POINTER_ID = 'MOUSE'; + +// helpers for hitTest() - only used inside hitTest() +var hitTestEvent = { + target: null, + data: { + global: null + } +}; /** - * The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive + * The interaction manager deals with mouse, touch and pointer events. Any DisplayObject can be interactive * if its interactive parameter is set to true * This manager also supports multitouch. * @@ -64594,35 +68304,35 @@ var InteractionManager = function (_EventEmitter) { * @member {PIXI.interaction.InteractionData} */ _this.mouse = new _InteractionData2.default(); + _this.mouse.identifier = MOUSE_POINTER_ID; // setting the mouse to start off far off screen will mean that mouse over does // not get called before we even move the mouse. _this.mouse.global.set(-999999); /** - * The pointer data + * Actively tracked InteractionData * - * @member {PIXI.interaction.InteractionData} + * @private + * @member {Object.} */ - _this.pointer = new _InteractionData2.default(); - - // setting the pointer to start off far off screen will mean that pointer over does - // not get called before we even move the pointer. - _this.pointer.global.set(-999999); + _this.activeInteractionData = {}; + _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse; /** - * An event data object to handle all the event tracking/dispatching + * Pool of unused InteractionData * - * @member {object} + * @private + * @member {PIXI.interation.InteractionData[]} */ - _this.eventData = new _InteractionEvent2.default(); + _this.interactionDataPool = []; /** - * Tiny little interactiveData pool ! + * An event data object to handle all the event tracking/dispatching * - * @member {PIXI.interaction.InteractionData[]} + * @member {object} */ - _this.interactiveDataPool = []; + _this.eventData = new _InteractionEvent2.default(); /** * The DOM element to bind to. @@ -64637,7 +68347,7 @@ var InteractionManager = function (_EventEmitter) { * is over the object. * Setting to true will make things work more in line with how the DOM verison works. * Setting to false can make things easier for things like dragging - * It is currently set to false as this is how pixi used to work. This will be set to true in + * It is currently set to false as this is how PixiJS used to work. This will be set to true in * future versions of pixi. * * @member {boolean} @@ -64679,68 +68389,21 @@ var InteractionManager = function (_EventEmitter) { */ _this.supportsPointerEvents = !!window.PointerEvent; - /** - * Are touch events being 'normalized' and converted into pointer events if pointer events are not supported - * For example, on a touch screen mobile device, a touchstart would also be emitted as a pointerdown - * - * @private - * @readonly - * @member {boolean} - */ - _this.normalizeTouchEvents = !_this.supportsPointerEvents && _this.supportsTouchEvents; - - /** - * Are mouse events being 'normalized' and converted into pointer events if pointer events are not supported - * For example, on a desktop pc, a mousedown would also be emitted as a pointerdown - * - * @private - * @readonly - * @member {boolean} - */ - _this.normalizeMouseEvents = !_this.supportsPointerEvents && !_ismobilejs2.default.any; - // this will make it so that you don't have to call bind all the time /** * @private * @member {Function} */ - _this.onMouseUp = _this.onMouseUp.bind(_this); - _this.processMouseUp = _this.processMouseUp.bind(_this); - - /** - * @private - * @member {Function} - */ - _this.onMouseDown = _this.onMouseDown.bind(_this); - _this.processMouseDown = _this.processMouseDown.bind(_this); - - /** - * @private - * @member {Function} - */ - _this.onMouseMove = _this.onMouseMove.bind(_this); - _this.processMouseMove = _this.processMouseMove.bind(_this); - - /** - * @private - * @member {Function} - */ - _this.onMouseOut = _this.onMouseOut.bind(_this); - _this.processMouseOverOut = _this.processMouseOverOut.bind(_this); - - /** - * @private - * @member {Function} - */ - _this.onMouseOver = _this.onMouseOver.bind(_this); + _this.onPointerUp = _this.onPointerUp.bind(_this); + _this.processPointerUp = _this.processPointerUp.bind(_this); /** * @private * @member {Function} */ - _this.onPointerUp = _this.onPointerUp.bind(_this); - _this.processPointerUp = _this.processPointerUp.bind(_this); + _this.onPointerCancel = _this.onPointerCancel.bind(_this); + _this.processPointerCancel = _this.processPointerCancel.bind(_this); /** * @private @@ -64770,41 +68433,32 @@ var InteractionManager = function (_EventEmitter) { _this.onPointerOver = _this.onPointerOver.bind(_this); /** - * @private - * @member {Function} - */ - _this.onTouchStart = _this.onTouchStart.bind(_this); - _this.processTouchStart = _this.processTouchStart.bind(_this); - - /** - * @private - * @member {Function} - */ - _this.onTouchEnd = _this.onTouchEnd.bind(_this); - _this.processTouchEnd = _this.processTouchEnd.bind(_this); - - /** - * @private - * @member {Function} + * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor + * values, objects are handled as dictionaries of CSS values for interactionDOMElement, + * and functions are called instead of changing the CSS. + * Default CSS cursor values are provided for 'default' and 'pointer' modes. + * @member {Object.)>} */ - _this.onTouchMove = _this.onTouchMove.bind(_this); - _this.processTouchMove = _this.processTouchMove.bind(_this); + _this.cursorStyles = { + default: 'inherit', + pointer: 'pointer' + }; /** - * Every update cursor will be reset to this value, if some element wont override it in - * its hitTest. + * The mode of the cursor that is being used. + * The value of this is a key from the cursorStyles dictionary. * * @member {string} - * @default 'inherit' */ - _this.defaultCursorStyle = 'inherit'; + _this.currentCursorMode = null; /** - * The css style of the cursor that is being used. + * Internal cached let. * + * @private * @member {string} */ - _this.currentCursorStyle = 'inherit'; + _this.cursor = null; /** * Internal cached let. @@ -64825,60 +68479,60 @@ var InteractionManager = function (_EventEmitter) { _this.setTargetElement(_this.renderer.view, _this.renderer.resolution); /** - * Fired when a pointer device button (usually a mouse button) is pressed on the display + * Fired when a pointer device button (usually a mouse left-button) is pressed on the display * object. * - * @event mousedown - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#mousedown + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device secondary button (usually a mouse right-button) is pressed * on the display object. * - * @event rightdown - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#rightdown + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** - * Fired when a pointer device button (usually a mouse button) is released over the display + * Fired when a pointer device button (usually a mouse left-button) is released over the display * object. * - * @event mouseup - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#mouseup + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device secondary button (usually a mouse right-button) is released * over the display object. * - * @event rightup - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#rightup + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** - * Fired when a pointer device button (usually a mouse button) is pressed and released on + * Fired when a pointer device button (usually a mouse left-button) is pressed and released on * the display object. * - * @event click - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#click + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device secondary button (usually a mouse right-button) is pressed * and released on the display object. * - * @event rightclick - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#rightclick + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** - * Fired when a pointer device button (usually a mouse button) is released outside the + * Fired when a pointer device button (usually a mouse left-button) is released outside the * display object that initially registered a * [mousedown]{@link PIXI.interaction.InteractionManager#event:mousedown}. * - * @event mouseupoutside - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#mouseupoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** @@ -64886,119 +68540,365 @@ var InteractionManager = function (_EventEmitter) { * outside the display object that initially registered a * [rightdown]{@link PIXI.interaction.InteractionManager#event:rightdown}. * - * @event rightupoutside - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#rightupoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device (usually a mouse) is moved while over the display object * - * @event mousemove - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#mousemove + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device (usually a mouse) is moved onto the display object * - * @event mouseover - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#mouseover + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device (usually a mouse) is moved off the display object * - * @event mouseout - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#mouseout + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device button is pressed on the display object. * - * @event pointerdown - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointerdown + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device button is released over the display object. * - * @event pointerup - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointerup + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when the operating system cancels a pointer event + * + * @event PIXI.interaction.InteractionManager#pointercancel + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device button is pressed and released on the display object. * - * @event pointertap - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointertap + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device button is released outside the display object that initially * registered a [pointerdown]{@link PIXI.interaction.InteractionManager#event:pointerdown}. * - * @event pointerupoutside - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointerupoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device is moved while over the display object * - * @event pointermove - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointermove + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device is moved onto the display object * - * @event pointerover - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointerover + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a pointer device is moved off the display object * - * @event pointerout - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#pointerout + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a touch point is placed on the display object. * - * @event touchstart - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#touchstart + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a touch point is removed from the display object. * - * @event touchend - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#touchend + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when the operating system cancels a touch + * + * @event PIXI.interaction.InteractionManager#touchcancel + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a touch point is placed and removed from the display object. * - * @event tap - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#tap + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a touch point is removed outside of the display object that initially * registered a [touchstart]{@link PIXI.interaction.InteractionManager#event:touchstart}. * - * @event touchendoutside - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#touchendoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ /** * Fired when a touch point is moved along the display object. * - * @event touchmove - * @memberof PIXI.interaction.InteractionManager# + * @event PIXI.interaction.InteractionManager#touchmove + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button (usually a mouse left-button) is pressed on the display. + * object. DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#mousedown + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device secondary button (usually a mouse right-button) is pressed + * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#rightdown + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button (usually a mouse left-button) is released over the display + * object. DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#mouseup + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device secondary button (usually a mouse right-button) is released + * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#rightup + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button (usually a mouse left-button) is pressed and released on + * the display object. DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#click + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device secondary button (usually a mouse right-button) is pressed + * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#rightclick + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button (usually a mouse left-button) is released outside the + * display object that initially registered a + * [mousedown]{@link PIXI.DisplayObject#event:mousedown}. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#mouseupoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device secondary button (usually a mouse right-button) is released + * outside the display object that initially registered a + * [rightdown]{@link PIXI.DisplayObject#event:rightdown}. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#rightupoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device (usually a mouse) is moved while over the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#mousemove + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device (usually a mouse) is moved onto the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#mouseover + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device (usually a mouse) is moved off the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#mouseout + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button is pressed on the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointerdown + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button is released over the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointerup + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when the operating system cancels a pointer event. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointercancel + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button is pressed and released on the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointertap + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device button is released outside the display object that initially + * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointerupoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device is moved while over the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointermove + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device is moved onto the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointerover + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a pointer device is moved off the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#pointerout + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a touch point is placed on the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#touchstart + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a touch point is removed from the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#touchend + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when the operating system cancels a touch. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#touchcancel + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a touch point is placed and removed from the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#tap + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a touch point is removed outside of the display object that initially + * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#touchendoutside + * @param {PIXI.interaction.InteractionEvent} event - Interaction event + */ + + /** + * Fired when a touch point is moved along the display object. + * DisplayObject's `interactive` property must be set to `true` to fire event. + * + * @event PIXI.DisplayObject#touchmove + * @param {PIXI.interaction.InteractionEvent} event - Interaction event */ return _this; } + /** + * Hit tests a point against the display tree, returning the first interactive object that is hit. + * + * @param {PIXI.Point} globalPoint - A point to hit test with, in global space. + * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults + * to the last rendered root of the associated renderer. + * @return {PIXI.DisplayObject} The hit display object, if any. + */ + + + InteractionManager.prototype.hitTest = function hitTest(globalPoint, root) { + // clear the target for our hit test + hitTestEvent.target = null; + // assign the global point + hitTestEvent.data.global = globalPoint; + // ensure safety of the root + if (!root) { + root = this.renderer._lastObjectRendered; + } + // run the hit test + this.processInteractive(hitTestEvent, root, null, true); + // return our found object - it'll be null if we didn't hit anything + + return hitTestEvent.target; + }; + /** * Sets the DOM element which will receive mouse/touch events. This is useful for when you have * other DOM elements on top of the renderers Canvas element. With this you'll be bale to deletegate @@ -65034,7 +68934,7 @@ var InteractionManager = function (_EventEmitter) { return; } - core.ticker.shared.add(this.update, this); + core.ticker.shared.add(this.update, this, core.UPDATE_PRIORITY.INTERACTION); if (window.navigator.msPointerEnabled) { this.interactionDOMElement.style['-ms-content-zooming'] = 'none'; @@ -65050,40 +68950,29 @@ var InteractionManager = function (_EventEmitter) { if (this.supportsPointerEvents) { window.document.addEventListener('pointermove', this.onPointerMove, true); this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true); - this.interactionDOMElement.addEventListener('pointerout', this.onPointerOut, true); + // pointerout is fired in addition to pointerup (for touch events) and pointercancel + // we already handle those, so for the purposes of what we do in onPointerOut, we only + // care about the pointerleave event + this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, true); this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true); + window.addEventListener('pointercancel', this.onPointerCancel, true); window.addEventListener('pointerup', this.onPointerUp, true); } else { - /** - * If pointer events aren't available on a device, this will turn either the touch or - * mouse events into pointer events. This allows a developer to just listen for emitted - * pointer events on interactive sprites - */ - if (this.normalizeTouchEvents) { - this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true); - this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true); - this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true); - } - - if (this.normalizeMouseEvents) { - window.document.addEventListener('mousemove', this.onPointerMove, true); - this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true); - this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true); - this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true); - window.addEventListener('mouseup', this.onPointerUp, true); - } + window.document.addEventListener('mousemove', this.onPointerMove, true); + this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true); + this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true); + this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true); + window.addEventListener('mouseup', this.onPointerUp, true); } - window.document.addEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.addEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.addEventListener('mouseout', this.onMouseOut, true); - this.interactionDOMElement.addEventListener('mouseover', this.onMouseOver, true); - window.addEventListener('mouseup', this.onMouseUp, true); - + // always look directly for touch events so that we can provide original data + // In a future version we should change this to being just a fallback and rely solely on + // PointerEvents whenever available if (this.supportsTouchEvents) { - this.interactionDOMElement.addEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.addEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.addEventListener('touchmove', this.onTouchMove, true); + this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true); + this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, true); + this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true); + this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true); } this.eventsAdded = true; @@ -65113,40 +69002,23 @@ var InteractionManager = function (_EventEmitter) { if (this.supportsPointerEvents) { window.document.removeEventListener('pointermove', this.onPointerMove, true); this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true); - this.interactionDOMElement.removeEventListener('pointerout', this.onPointerOut, true); + this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, true); this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true); + window.removeEventListener('pointercancel', this.onPointerCancel, true); window.removeEventListener('pointerup', this.onPointerUp, true); } else { - /** - * If pointer events aren't available on a device, this will turn either the touch or - * mouse events into pointer events. This allows a developer to just listen for emitted - * pointer events on interactive sprites - */ - if (this.normalizeTouchEvents) { - this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true); - this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true); - } - - if (this.normalizeMouseEvents) { - window.document.removeEventListener('mousemove', this.onPointerMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true); - this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true); - window.removeEventListener('mouseup', this.onPointerUp, true); - } + window.document.removeEventListener('mousemove', this.onPointerMove, true); + this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true); + this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true); + this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true); + window.removeEventListener('mouseup', this.onPointerUp, true); } - window.document.removeEventListener('mousemove', this.onMouseMove, true); - this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true); - this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true); - this.interactionDOMElement.removeEventListener('mouseover', this.onMouseOver, true); - window.removeEventListener('mouseup', this.onMouseUp, true); - if (this.supportsTouchEvents) { - this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true); - this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true); - this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true); + this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true); + this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, true); + this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true); + this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true); } this.interactionDOMElement = null; @@ -65175,30 +69047,76 @@ var InteractionManager = function (_EventEmitter) { return; } - // if the user move the mouse this check has already been dfone using the mouse move! + // if the user move the mouse this check has already been done using the mouse move! if (this.didMove) { this.didMove = false; return; } - this.cursor = this.defaultCursorStyle; + this.cursor = null; // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind, // but there was a scenario of a display object moving under a static mouse cursor. // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function - this.eventData._reset(); + for (var k in this.activeInteractionData) { + // eslint-disable-next-line no-prototype-builtins + if (this.activeInteractionData.hasOwnProperty(k)) { + var interactionData = this.activeInteractionData[k]; - this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, true); + if (interactionData.originalEvent && interactionData.pointerType !== 'touch') { + var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData); - if (this.currentCursorStyle !== this.cursor) { - this.currentCursorStyle = this.cursor; - this.interactionDOMElement.style.cursor = this.cursor; + this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerOverOut, true); + } + } } + this.setCursorMode(this.cursor); + // TODO }; + /** + * Sets the current cursor mode, handling any callbacks or CSS style changes. + * + * @param {string} mode - cursor mode, a key from the cursorStyles dictionary + */ + + + InteractionManager.prototype.setCursorMode = function setCursorMode(mode) { + mode = mode || 'default'; + // if the mode didn't actually change, bail early + if (this.currentCursorMode === mode) { + return; + } + this.currentCursorMode = mode; + var style = this.cursorStyles[mode]; + + // only do things if there is a cursor style for it + if (style) { + switch (typeof style === 'undefined' ? 'undefined' : _typeof(style)) { + case 'string': + // string styles are handled as cursor CSS + this.interactionDOMElement.style.cursor = style; + break; + case 'function': + // functions are just called, and passed the cursor mode + style(mode); + break; + case 'object': + // if it is an object, assume that it is a dictionary of CSS styles, + // apply it to the interactionDOMElement + Object.assign(this.interactionDOMElement.style, style); + break; + } + } else if (typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) { + // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry + // for the mode, then assume that the dev wants it to be CSS for the cursor. + this.interactionDOMElement.style.cursor = mode; + } + }; + /** * Dispatches an event on the display object that was interacted with * @@ -65223,7 +69141,7 @@ var InteractionManager = function (_EventEmitter) { }; /** - * Maps x and y coords from a DOM object and maps them correctly to the pixi view. The + * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The * resulting value is stored in the point. This takes into account the fact that the DOM * element could be scaled and positioned anywhere on the screen. * @@ -65254,22 +69172,26 @@ var InteractionManager = function (_EventEmitter) { * specified function on all interactive objects it finds. It will also take care of hit * testing the interactive objects and passes the hit across in the function. * - * @param {PIXI.Point} point - the point that is tested for collision + * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - event containing the point that + * is tested for collision * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the displayObject * that will be hit test (recursively crawls its children) * @param {Function} [func] - the function that will be called on each interactive object. The - * displayObject and hit will be passed to the function + * interactionEvent, displayObject and hit will be passed to the function * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point * @param {boolean} [interactive] - Whether the displayObject is interactive * @return {boolean} returns true if the displayObject hit the point */ - InteractionManager.prototype.processInteractive = function processInteractive(point, displayObject, func, hitTest, interactive) { + InteractionManager.prototype.processInteractive = function processInteractive(interactionEvent, displayObject, func, hitTest, interactive) { if (!displayObject || !displayObject.visible) { return false; } + var point = interactionEvent.data.global; + // Took a little while to rework this function correctly! But now it is done and nice and optimised. ^_^ // // This function will now loop through all objects and then only hit test the objects it HAS @@ -65292,24 +69214,16 @@ var InteractionManager = function (_EventEmitter) { if (displayObject.hitArea) { interactiveParent = false; } - - // it has a mask! Then lets hit test that before continuing.. - if (hitTest && displayObject._mask) { - if (!displayObject._mask.containsPoint(point)) { - hitTest = false; - } - } - - // it has a filterArea! Same as mask but easier, its a rectangle - if (hitTest && displayObject.filterArea) { - if (!displayObject.filterArea.contains(point.x, point.y)) { - hitTest = false; + // it has a mask! Then lets hit test that before continuing + else if (hitTest && displayObject._mask) { + if (!displayObject._mask.containsPoint(point)) { + hitTest = false; + } } - } // ** FREE TIP **! If an object is not interactive or has no buttons in it // (such as a game scene!) set interactiveChildren to false for that displayObject. - // This will allow pixi to completely ignore and bypass checking the displayObjects children. + // This will allow PixiJS to completely ignore and bypass checking the displayObjects children. if (displayObject.interactiveChildren && displayObject.children) { var children = displayObject.children; @@ -65317,15 +69231,15 @@ var InteractionManager = function (_EventEmitter) { var child = children[i]; // time to get recursive.. if this function will return if something is hit.. - if (this.processInteractive(point, child, func, hitTest, interactiveParent)) { + var childHit = this.processInteractive(interactionEvent, child, func, hitTest, interactiveParent); + + if (childHit) { // its a good idea to check if a child has lost its parent. // this means it has been removed whilst looping so its best if (!child.parent) { continue; } - hit = true; - // we no longer need to hit test any more objects in this container as we we // now know the parent has been hit interactiveParent = false; @@ -65335,11 +69249,12 @@ var InteractionManager = function (_EventEmitter) { // This means we no longer need to hit test anything else. We still need to run // through all objects, but we don't need to perform any hit tests. - // { - hitTest = false; - // } - - // we can break now as we have hit an object. + if (childHit) { + if (interactionEvent.target) { + hitTest = false; + } + hit = true; + } } } } @@ -65348,24 +69263,29 @@ var InteractionManager = function (_EventEmitter) { if (interactive) { // if we are hit testing (as in we have no hit any objects yet) // We also don't need to worry about hit testing if once of the displayObjects children - // has already been hit! - if (hitTest && !hit) { + // has already been hit - but only if it was interactive, otherwise we need to keep + // looking for an interactive child, just in case we hit one + if (hitTest && !interactionEvent.target) { if (displayObject.hitArea) { displayObject.worldTransform.applyInverse(point, this._tempPoint); - hit = displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y); + if (displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) { + hit = true; + } } else if (displayObject.containsPoint) { - hit = displayObject.containsPoint(point); + if (displayObject.containsPoint(point)) { + hit = true; + } } } if (displayObject.interactive) { - if (hit && !this.eventData.target) { - this.eventData.target = displayObject; - this.mouse.target = displayObject; - this.pointer.target = displayObject; + if (hit && !interactionEvent.target) { + interactionEvent.target = displayObject; } - func(displayObject, hit); + if (func) { + func(interactionEvent, displayObject, !!hit); + } } } @@ -65373,267 +69293,173 @@ var InteractionManager = function (_EventEmitter) { }; /** - * Is called when the mouse button is pressed down on the renderer element + * Is called when the pointer button is pressed down on the renderer element * * @private - * @param {MouseEvent} event - The DOM event of a mouse button being pressed down + * @param {PointerEvent} originalEvent - The DOM event of a pointer button being pressed down */ - InteractionManager.prototype.onMouseDown = function onMouseDown(event) { - this.mouse.originalEvent = event; - this.eventData.data = this.mouse; - this.eventData._reset(); - - // Update internal mouse reference - this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY); - - if (this.autoPreventDefault) { - this.mouse.originalEvent.preventDefault(); - } - - this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseDown, true); - - var isRightButton = event.button === 2 || event.which === 3; - - this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData); - }; - - /** - * Processes the result of the mouse down check and dispatches the event if need be - * - * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object - */ + InteractionManager.prototype.onPointerDown = function onPointerDown(originalEvent) { + // if we support touch events, then only use those for touch events, not pointer events + if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return; + var events = this.normalizeToPointerData(originalEvent); - InteractionManager.prototype.processMouseDown = function processMouseDown(displayObject, hit) { - var e = this.mouse.originalEvent; + /** + * No need to prevent default on natural pointer events, as there are no side effects + * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser, + * so still need to be prevented. + */ - var isRightButton = e.button === 2 || e.which === 3; + // Guaranteed that there will be at least one event in events, and all events must have the same pointer type - if (hit) { - displayObject[isRightButton ? '_isRightDown' : '_isLeftDown'] = true; - this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', this.eventData); + if (this.autoPreventDefault && events[0].isNormalized) { + originalEvent.preventDefault(); } - }; - /** - * Is called when the mouse button is released on the renderer element - * - * @private - * @param {MouseEvent} event - The DOM event of a mouse button being released - */ + var eventLen = events.length; + for (var i = 0; i < eventLen; i++) { + var event = events[i]; - InteractionManager.prototype.onMouseUp = function onMouseUp(event) { - this.mouse.originalEvent = event; - this.eventData.data = this.mouse; - this.eventData._reset(); + var interactionData = this.getInteractionDataForPointerId(event); - // Update internal mouse reference - this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY); + var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData); - this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseUp, true); + interactionEvent.data.originalEvent = originalEvent; - var isRightButton = event.button === 2 || event.which === 3; + this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerDown, true); - this.emit(isRightButton ? 'rightup' : 'mouseup', this.eventData); + this.emit('pointerdown', interactionEvent); + if (event.pointerType === 'touch') { + this.emit('touchstart', interactionEvent); + } + // emit a mouse event for "pen" pointers, the way a browser would emit a fallback event + else if (event.pointerType === 'mouse' || event.pointerType === 'pen') { + var isRightButton = event.button === 2; + + this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData); + } + } }; /** - * Processes the result of the mouse up check and dispatches the event if need be + * Processes the result of the pointer down check and dispatches the event if need be * * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested * @param {boolean} hit - the result of the hit test on the display object */ - InteractionManager.prototype.processMouseUp = function processMouseUp(displayObject, hit) { - var e = this.mouse.originalEvent; - - var isRightButton = e.button === 2 || e.which === 3; - var isDown = isRightButton ? '_isRightDown' : '_isLeftDown'; + InteractionManager.prototype.processPointerDown = function processPointerDown(interactionEvent, displayObject, hit) { + var data = interactionEvent.data; + var id = interactionEvent.data.identifier; if (hit) { - this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', this.eventData); - - if (displayObject[isDown]) { - displayObject[isDown] = false; - this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', this.eventData); + if (!displayObject.trackedPointers[id]) { + displayObject.trackedPointers[id] = new _InteractionTrackingData2.default(id); } - } else if (displayObject[isDown]) { - displayObject[isDown] = false; - this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', this.eventData); - } - }; - - /** - * Is called when the mouse moves across the renderer element - * - * @private - * @param {MouseEvent} event - The DOM event of the mouse moving - */ - - - InteractionManager.prototype.onMouseMove = function onMouseMove(event) { - this.mouse.originalEvent = event; - this.eventData.data = this.mouse; - this.eventData._reset(); - - this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY); - - this.didMove = true; - - this.cursor = this.defaultCursorStyle; - - this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseMove, true); - - this.emit('mousemove', this.eventData); - - if (this.currentCursorStyle !== this.cursor) { - this.currentCursorStyle = this.cursor; - this.interactionDOMElement.style.cursor = this.cursor; - } - - // TODO BUG for parents interactive object (border order issue) - }; - - /** - * Processes the result of the mouse move check and dispatches the event if need be - * - * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object - */ + this.dispatchEvent(displayObject, 'pointerdown', interactionEvent); + if (data.pointerType === 'touch') { + this.dispatchEvent(displayObject, 'touchstart', interactionEvent); + } else if (data.pointerType === 'mouse' || data.pointerType === 'pen') { + var isRightButton = data.button === 2; - InteractionManager.prototype.processMouseMove = function processMouseMove(displayObject, hit) { - this.processMouseOverOut(displayObject, hit); + if (isRightButton) { + displayObject.trackedPointers[id].rightDown = true; + } else { + displayObject.trackedPointers[id].leftDown = true; + } - // only display on mouse over - if (!this.moveWhenInside || hit) { - this.dispatchEvent(displayObject, 'mousemove', this.eventData); + this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent); + } } }; /** - * Is called when the mouse is moved out of the renderer element + * Is called when the pointer button is released on the renderer element * * @private - * @param {MouseEvent} event - The DOM event of the mouse being moved out + * @param {PointerEvent} originalEvent - The DOM event of a pointer button being released + * @param {boolean} cancelled - true if the pointer is cancelled + * @param {Function} func - Function passed to {@link processInteractive} */ - InteractionManager.prototype.onMouseOut = function onMouseOut(event) { - this.mouseOverRenderer = false; + InteractionManager.prototype.onPointerComplete = function onPointerComplete(originalEvent, cancelled, func) { + var events = this.normalizeToPointerData(originalEvent); - this.mouse.originalEvent = event; - this.eventData.data = this.mouse; - this.eventData._reset(); + var eventLen = events.length; - // Update internal mouse reference - this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY); + // if the event wasn't targeting our canvas, then consider it to be pointerupoutside + // in all cases (unless it was a pointercancel) + var eventAppend = originalEvent.target !== this.interactionDOMElement ? 'outside' : ''; - this.interactionDOMElement.style.cursor = this.defaultCursorStyle; + for (var i = 0; i < eventLen; i++) { + var event = events[i]; - // TODO optimize by not check EVERY TIME! maybe half as often? // - this.mapPositionToPoint(this.mouse.global, event.clientX, event.clientY); + var interactionData = this.getInteractionDataForPointerId(event); - this.processInteractive(this.mouse.global, this.renderer._lastObjectRendered, this.processMouseOverOut, false); + var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData); - this.emit('mouseout', this.eventData); - }; + interactionEvent.data.originalEvent = originalEvent; - /** - * Processes the result of the mouse over/out check and dispatches the event if need be - * - * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object - */ + // perform hit testing for events targeting our canvas or cancel events + this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, func, cancelled || !eventAppend); + this.emit(cancelled ? 'pointercancel' : 'pointerup' + eventAppend, interactionEvent); - InteractionManager.prototype.processMouseOverOut = function processMouseOverOut(displayObject, hit) { - if (hit && this.mouseOverRenderer) { - if (!displayObject._mouseOver) { - displayObject._mouseOver = true; - this.dispatchEvent(displayObject, 'mouseover', this.eventData); - } + if (event.pointerType === 'mouse' || event.pointerType === 'pen') { + var isRightButton = event.button === 2; - if (displayObject.buttonMode) { - this.cursor = displayObject.defaultCursor; + this.emit(isRightButton ? 'rightup' + eventAppend : 'mouseup' + eventAppend, interactionEvent); + } else if (event.pointerType === 'touch') { + this.emit(cancelled ? 'touchcancel' : 'touchend' + eventAppend, interactionEvent); + this.releaseInteractionDataForPointerId(event.pointerId, interactionData); } - } else if (displayObject._mouseOver) { - displayObject._mouseOver = false; - this.dispatchEvent(displayObject, 'mouseout', this.eventData); } }; /** - * Is called when the mouse enters the renderer element area + * Is called when the pointer button is cancelled * * @private - * @param {MouseEvent} event - The DOM event of the mouse moving into the renderer view + * @param {PointerEvent} event - The DOM event of a pointer button being released */ - InteractionManager.prototype.onMouseOver = function onMouseOver(event) { - this.mouseOverRenderer = true; - - this.mouse.originalEvent = event; - this.eventData.data = this.mouse; - this.eventData._reset(); + InteractionManager.prototype.onPointerCancel = function onPointerCancel(event) { + // if we support touch events, then only use those for touch events, not pointer events + if (this.supportsTouchEvents && event.pointerType === 'touch') return; - this.emit('mouseover', this.eventData); + this.onPointerComplete(event, true, this.processPointerCancel); }; /** - * Is called when the pointer button is pressed down on the renderer element + * Processes the result of the pointer cancel check and dispatches the event if need be * * @private - * @param {PointerEvent} event - The DOM event of a pointer button being pressed down + * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event + * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested */ - InteractionManager.prototype.onPointerDown = function onPointerDown(event) { - this.normalizeToPointerData(event); - this.pointer.originalEvent = event; - this.eventData.data = this.pointer; - this.eventData._reset(); - - // Update internal pointer reference - this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY); - - /** - * No need to prevent default on natural pointer events, as there are no side effects - * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser, - * so still need to be prevented. - */ - if (this.autoPreventDefault && (this.normalizeMouseEvents || this.normalizeTouchEvents)) { - this.pointer.originalEvent.preventDefault(); - } - - this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerDown, true); - - this.emit('pointerdown', this.eventData); - }; + InteractionManager.prototype.processPointerCancel = function processPointerCancel(interactionEvent, displayObject) { + var data = interactionEvent.data; - /** - * Processes the result of the pointer down check and dispatches the event if need be - * - * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object - */ + var id = interactionEvent.data.identifier; + if (displayObject.trackedPointers[id] !== undefined) { + delete displayObject.trackedPointers[id]; + this.dispatchEvent(displayObject, 'pointercancel', interactionEvent); - InteractionManager.prototype.processPointerDown = function processPointerDown(displayObject, hit) { - if (hit) { - displayObject._pointerDown = true; - this.dispatchEvent(displayObject, 'pointerdown', this.eventData); + if (data.pointerType === 'touch') { + this.dispatchEvent(displayObject, 'touchcancel', interactionEvent); + } } }; @@ -65646,376 +69472,434 @@ var InteractionManager = function (_EventEmitter) { InteractionManager.prototype.onPointerUp = function onPointerUp(event) { - this.normalizeToPointerData(event); - this.pointer.originalEvent = event; - this.eventData.data = this.pointer; - this.eventData._reset(); - - // Update internal pointer reference - this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY); + // if we support touch events, then only use those for touch events, not pointer events + if (this.supportsTouchEvents && event.pointerType === 'touch') return; - this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerUp, true); - - this.emit('pointerup', this.eventData); + this.onPointerComplete(event, false, this.processPointerUp); }; /** * Processes the result of the pointer up check and dispatches the event if need be * * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested * @param {boolean} hit - the result of the hit test on the display object */ - InteractionManager.prototype.processPointerUp = function processPointerUp(displayObject, hit) { - if (hit) { - this.dispatchEvent(displayObject, 'pointerup', this.eventData); + InteractionManager.prototype.processPointerUp = function processPointerUp(interactionEvent, displayObject, hit) { + var data = interactionEvent.data; - if (displayObject._pointerDown) { - displayObject._pointerDown = false; - this.dispatchEvent(displayObject, 'pointertap', this.eventData); - } - } else if (displayObject._pointerDown) { - displayObject._pointerDown = false; - this.dispatchEvent(displayObject, 'pointerupoutside', this.eventData); - } - }; + var id = interactionEvent.data.identifier; - /** - * Is called when the pointer moves across the renderer element - * - * @private - * @param {PointerEvent} event - The DOM event of a pointer moving - */ + var trackingData = displayObject.trackedPointers[id]; + var isTouch = data.pointerType === 'touch'; - InteractionManager.prototype.onPointerMove = function onPointerMove(event) { - this.normalizeToPointerData(event); - this.pointer.originalEvent = event; - this.eventData.data = this.pointer; - this.eventData._reset(); + var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen'; - this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY); + // Mouse only + if (isMouse) { + var isRightButton = data.button === 2; - this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerMove, true); + var flags = _InteractionTrackingData2.default.FLAGS; - this.emit('pointermove', this.eventData); - }; + var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN; - /** - * Processes the result of the pointer move check and dispatches the event if need be - * - * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object - */ + var isDown = trackingData !== undefined && trackingData.flags & test; + if (hit) { + this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent); - InteractionManager.prototype.processPointerMove = function processPointerMove(displayObject, hit) { - if (!this.pointer.originalEvent.changedTouches) { - this.processPointerOverOut(displayObject, hit); + if (isDown) { + this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent); + } + } else if (isDown) { + this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent); + } + // update the down state of the tracking data + if (trackingData) { + if (isRightButton) { + trackingData.rightDown = false; + } else { + trackingData.leftDown = false; + } + } } - if (!this.moveWhenInside || hit) { - this.dispatchEvent(displayObject, 'pointermove', this.eventData); + // Pointers and Touches, and Mouse + if (hit) { + this.dispatchEvent(displayObject, 'pointerup', interactionEvent); + if (isTouch) this.dispatchEvent(displayObject, 'touchend', interactionEvent); + + if (trackingData) { + this.dispatchEvent(displayObject, 'pointertap', interactionEvent); + if (isTouch) { + this.dispatchEvent(displayObject, 'tap', interactionEvent); + // touches are no longer over (if they ever were) when we get the touchend + // so we should ensure that we don't keep pretending that they are + trackingData.over = false; + } + } + } else if (trackingData) { + this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent); + if (isTouch) this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent); + } + // Only remove the tracking data if there is no over/down state still associated with it + if (trackingData && trackingData.none) { + delete displayObject.trackedPointers[id]; } }; /** - * Is called when the pointer is moved out of the renderer element + * Is called when the pointer moves across the renderer element * * @private - * @param {PointerEvent} event - The DOM event of a pointer being moved out + * @param {PointerEvent} originalEvent - The DOM event of a pointer moving */ - InteractionManager.prototype.onPointerOut = function onPointerOut(event) { - this.normalizeToPointerData(event); - this.pointer.originalEvent = event; - this.eventData.data = this.pointer; - this.eventData._reset(); - - // Update internal pointer reference - this.mapPositionToPoint(this.pointer.global, event.clientX, event.clientY); - - this.processInteractive(this.pointer.global, this.renderer._lastObjectRendered, this.processPointerOverOut, false); - - this.emit('pointerout', this.eventData); - }; + InteractionManager.prototype.onPointerMove = function onPointerMove(originalEvent) { + // if we support touch events, then only use those for touch events, not pointer events + if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return; - /** - * Processes the result of the pointer over/out check and dispatches the event if need be - * - * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object - */ + var events = this.normalizeToPointerData(originalEvent); + if (events[0].pointerType === 'mouse') { + this.didMove = true; - InteractionManager.prototype.processPointerOverOut = function processPointerOverOut(displayObject, hit) { - if (hit && this.mouseOverRenderer) { - if (!displayObject._pointerOver) { - displayObject._pointerOver = true; - this.dispatchEvent(displayObject, 'pointerover', this.eventData); - } - } else if (displayObject._pointerOver) { - displayObject._pointerOver = false; - this.dispatchEvent(displayObject, 'pointerout', this.eventData); + this.cursor = null; } - }; - /** - * Is called when the pointer is moved into the renderer element - * - * @private - * @param {PointerEvent} event - The DOM event of a pointer button being moved into the renderer view - */ + var eventLen = events.length; + for (var i = 0; i < eventLen; i++) { + var event = events[i]; - InteractionManager.prototype.onPointerOver = function onPointerOver(event) { - this.pointer.originalEvent = event; - this.eventData.data = this.pointer; - this.eventData._reset(); + var interactionData = this.getInteractionDataForPointerId(event); - this.emit('pointerover', this.eventData); - }; + var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData); - /** - * Is called when a touch is started on the renderer element - * - * @private - * @param {TouchEvent} event - The DOM event of a touch starting on the renderer view - */ + interactionEvent.data.originalEvent = originalEvent; + var interactive = event.pointerType === 'touch' ? this.moveWhenInside : true; - InteractionManager.prototype.onTouchStart = function onTouchStart(event) { - if (this.autoPreventDefault) { - event.preventDefault(); + this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerMove, interactive); + this.emit('pointermove', interactionEvent); + if (event.pointerType === 'touch') this.emit('touchmove', interactionEvent); + if (event.pointerType === 'mouse' || event.pointerType === 'pen') this.emit('mousemove', interactionEvent); } - var changedTouches = event.changedTouches; - var cLength = changedTouches.length; - - for (var i = 0; i < cLength; i++) { - var touch = changedTouches[i]; - var touchData = this.getTouchData(touch); - - touchData.originalEvent = event; - - this.eventData.data = touchData; - this.eventData._reset(); + if (events[0].pointerType === 'mouse') { + this.setCursorMode(this.cursor); - this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchStart, true); - - this.emit('touchstart', this.eventData); - - this.returnTouchData(touchData); + // TODO BUG for parents interactive object (border order issue) } }; /** - * Processes the result of a touch check and dispatches the event if need be + * Processes the result of the pointer move check and dispatches the event if need be * * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested * @param {boolean} hit - the result of the hit test on the display object */ - InteractionManager.prototype.processTouchStart = function processTouchStart(displayObject, hit) { - if (hit) { - displayObject._touchDown = true; - this.dispatchEvent(displayObject, 'touchstart', this.eventData); + InteractionManager.prototype.processPointerMove = function processPointerMove(interactionEvent, displayObject, hit) { + var data = interactionEvent.data; + + var isTouch = data.pointerType === 'touch'; + + var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen'; + + if (isMouse) { + this.processPointerOverOut(interactionEvent, displayObject, hit); + } + + if (!this.moveWhenInside || hit) { + this.dispatchEvent(displayObject, 'pointermove', interactionEvent); + if (isTouch) this.dispatchEvent(displayObject, 'touchmove', interactionEvent); + if (isMouse) this.dispatchEvent(displayObject, 'mousemove', interactionEvent); } }; /** - * Is called when a touch ends on the renderer element + * Is called when the pointer is moved out of the renderer element * * @private - * @param {TouchEvent} event - The DOM event of a touch ending on the renderer view + * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out */ - InteractionManager.prototype.onTouchEnd = function onTouchEnd(event) { - if (this.autoPreventDefault) { - event.preventDefault(); - } + InteractionManager.prototype.onPointerOut = function onPointerOut(originalEvent) { + // if we support touch events, then only use those for touch events, not pointer events + if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return; - var changedTouches = event.changedTouches; - var cLength = changedTouches.length; + var events = this.normalizeToPointerData(originalEvent); - for (var i = 0; i < cLength; i++) { - var touchEvent = changedTouches[i]; + // Only mouse and pointer can call onPointerOut, so events will always be length 1 + var event = events[0]; - var touchData = this.getTouchData(touchEvent); + if (event.pointerType === 'mouse') { + this.mouseOverRenderer = false; + this.setCursorMode(null); + } - touchData.originalEvent = event; + var interactionData = this.getInteractionDataForPointerId(event); - // TODO this should be passed along.. no set - this.eventData.data = touchData; - this.eventData._reset(); + var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData); - this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchEnd, true); + interactionEvent.data.originalEvent = event; - this.emit('touchend', this.eventData); + this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerOverOut, false); - this.returnTouchData(touchData); + this.emit('pointerout', interactionEvent); + if (event.pointerType === 'mouse' || event.pointerType === 'pen') { + this.emit('mouseout', interactionEvent); + } else { + // we can get touchleave events after touchend, so we want to make sure we don't + // introduce memory leaks + this.releaseInteractionDataForPointerId(interactionData.identifier); } }; /** - * Processes the result of the end of a touch and dispatches the event if need be + * Processes the result of the pointer over/out check and dispatches the event if need be * * @private + * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested * @param {boolean} hit - the result of the hit test on the display object */ - InteractionManager.prototype.processTouchEnd = function processTouchEnd(displayObject, hit) { - if (hit) { - this.dispatchEvent(displayObject, 'touchend', this.eventData); + InteractionManager.prototype.processPointerOverOut = function processPointerOverOut(interactionEvent, displayObject, hit) { + var data = interactionEvent.data; + + var id = interactionEvent.data.identifier; + + var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen'; + + var trackingData = displayObject.trackedPointers[id]; + + // if we just moused over the display object, then we need to track that state + if (hit && !trackingData) { + trackingData = displayObject.trackedPointers[id] = new _InteractionTrackingData2.default(id); + } + + if (trackingData === undefined) return; + + if (hit && this.mouseOverRenderer) { + if (!trackingData.over) { + trackingData.over = true; + this.dispatchEvent(displayObject, 'pointerover', interactionEvent); + if (isMouse) { + this.dispatchEvent(displayObject, 'mouseover', interactionEvent); + } + } - if (displayObject._touchDown) { - displayObject._touchDown = false; - this.dispatchEvent(displayObject, 'tap', this.eventData); + // only change the cursor if it has not already been changed (by something deeper in the + // display tree) + if (isMouse && this.cursor === null) { + this.cursor = displayObject.cursor; + } + } else if (trackingData.over) { + trackingData.over = false; + this.dispatchEvent(displayObject, 'pointerout', this.eventData); + if (isMouse) { + this.dispatchEvent(displayObject, 'mouseout', interactionEvent); + } + // if there is no mouse down information for the pointer, then it is safe to delete + if (trackingData.none) { + delete displayObject.trackedPointers[id]; } - } else if (displayObject._touchDown) { - displayObject._touchDown = false; - this.dispatchEvent(displayObject, 'touchendoutside', this.eventData); } }; /** - * Is called when a touch is moved across the renderer element + * Is called when the pointer is moved into the renderer element * * @private - * @param {TouchEvent} event - The DOM event of a touch moving accross the renderer view + * @param {PointerEvent} originalEvent - The DOM event of a pointer button being moved into the renderer view */ - InteractionManager.prototype.onTouchMove = function onTouchMove(event) { - if (this.autoPreventDefault) { - event.preventDefault(); - } - - var changedTouches = event.changedTouches; - var cLength = changedTouches.length; - - for (var i = 0; i < cLength; i++) { - var touchEvent = changedTouches[i]; + InteractionManager.prototype.onPointerOver = function onPointerOver(originalEvent) { + var events = this.normalizeToPointerData(originalEvent); - var touchData = this.getTouchData(touchEvent); + // Only mouse and pointer can call onPointerOver, so events will always be length 1 + var event = events[0]; - touchData.originalEvent = event; + var interactionData = this.getInteractionDataForPointerId(event); - this.eventData.data = touchData; - this.eventData._reset(); + var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData); - this.processInteractive(touchData.global, this.renderer._lastObjectRendered, this.processTouchMove, this.moveWhenInside); + interactionEvent.data.originalEvent = event; - this.emit('touchmove', this.eventData); + if (event.pointerType === 'mouse') { + this.mouseOverRenderer = true; + } - this.returnTouchData(touchData); + this.emit('pointerover', interactionEvent); + if (event.pointerType === 'mouse' || event.pointerType === 'pen') { + this.emit('mouseover', interactionEvent); } }; /** - * Processes the result of a touch move check and dispatches the event if need be + * Get InteractionData for a given pointerId. Store that data as well * * @private - * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested - * @param {boolean} hit - the result of the hit test on the display object + * @param {PointerEvent} event - Normalized pointer event, output from normalizeToPointerData + * @return {PIXI.interaction.InteractionData} - Interaction data for the given pointer identifier */ - InteractionManager.prototype.processTouchMove = function processTouchMove(displayObject, hit) { - if (!this.moveWhenInside || hit) { - this.dispatchEvent(displayObject, 'touchmove', this.eventData); + InteractionManager.prototype.getInteractionDataForPointerId = function getInteractionDataForPointerId(event) { + var pointerId = event.pointerId; + + var interactionData = void 0; + + if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') { + interactionData = this.mouse; + } else if (this.activeInteractionData[pointerId]) { + interactionData = this.activeInteractionData[pointerId]; + } else { + interactionData = this.interactionDataPool.pop() || new _InteractionData2.default(); + interactionData.identifier = pointerId; + this.activeInteractionData[pointerId] = interactionData; } + // copy properties from the event, so that we can make sure that touch/pointer specific + // data is available + interactionData._copyEvent(event); + + return interactionData; }; /** - * Grabs an interaction data object from the internal pool + * Return unused InteractionData to the pool, for a given pointerId * * @private - * @param {Touch} touch - The touch data we need to pair with an interactionData object - * @return {PIXI.interaction.InteractionData} The built data object. + * @param {number} pointerId - Identifier from a pointer event */ - InteractionManager.prototype.getTouchData = function getTouchData(touch) { - var touchData = this.interactiveDataPool.pop() || new _InteractionData2.default(); - - touchData.identifier = touch.identifier; - this.mapPositionToPoint(touchData.global, touch.clientX, touch.clientY); + InteractionManager.prototype.releaseInteractionDataForPointerId = function releaseInteractionDataForPointerId(pointerId) { + var interactionData = this.activeInteractionData[pointerId]; - if (navigator.isCocoonJS) { - touchData.global.x = touchData.global.x / this.resolution; - touchData.global.y = touchData.global.y / this.resolution; + if (interactionData) { + delete this.activeInteractionData[pointerId]; + interactionData._reset(); + this.interactionDataPool.push(interactionData); } - - touch.globalX = touchData.global.x; - touch.globalY = touchData.global.y; - - return touchData; }; /** - * Returns an interaction data object to the internal pool + * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData * * @private - * @param {PIXI.interaction.InteractionData} touchData - The touch data object we want to return to the pool + * @param {PIXI.interaction.InteractionEvent} interactionEvent - The event to be configured + * @param {PointerEvent} pointerEvent - The DOM event that will be paired with the InteractionEvent + * @param {PIXI.interaction.InteractionData} interactionData - The InteractionData that will be paired + * with the InteractionEvent + * @return {PIXI.interaction.InteractionEvent} the interaction event that was passed in */ - InteractionManager.prototype.returnTouchData = function returnTouchData(touchData) { - this.interactiveDataPool.push(touchData); + InteractionManager.prototype.configureInteractionEventForDOMEvent = function configureInteractionEventForDOMEvent(interactionEvent, pointerEvent, interactionData) { + interactionEvent.data = interactionData; + + this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY); + + // This is the way InteractionManager processed touch events before the refactoring, so I've kept + // it here. But it doesn't make that much sense to me, since mapPositionToPoint already factors + // in this.resolution, so this just divides by this.resolution twice for touch events... + if (navigator.isCocoonJS && pointerEvent.pointerType === 'touch') { + interactionData.global.x = interactionData.global.x / this.resolution; + interactionData.global.y = interactionData.global.y / this.resolution; + } + + // Not really sure why this is happening, but it's how a previous version handled things + if (pointerEvent.pointerType === 'touch') { + pointerEvent.globalX = interactionData.global.x; + pointerEvent.globalY = interactionData.global.y; + } + + interactionData.originalEvent = pointerEvent; + interactionEvent._reset(); + + return interactionEvent; }; /** * Ensures that the original event object contains all data that a regular pointer event would have * * @private - * @param {TouchEvent|MouseEvent} event - The original event data from a touch or mouse event + * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event + * @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer + * or mouse event, or a multiple normalized pointer events if there are multiple changed touches */ InteractionManager.prototype.normalizeToPointerData = function normalizeToPointerData(event) { - if (this.normalizeTouchEvents && event.changedTouches) { - if (typeof event.button === 'undefined') event.button = event.touches.length ? 1 : 0; - if (typeof event.buttons === 'undefined') event.buttons = event.touches.length ? 1 : 0; - if (typeof event.isPrimary === 'undefined') event.isPrimary = event.touches.length === 1; - if (typeof event.width === 'undefined') event.width = event.changedTouches[0].radiusX || 1; - if (typeof event.height === 'undefined') event.height = event.changedTouches[0].radiusY || 1; - if (typeof event.tiltX === 'undefined') event.tiltX = 0; - if (typeof event.tiltY === 'undefined') event.tiltY = 0; - if (typeof event.pointerType === 'undefined') event.pointerType = 'touch'; - if (typeof event.pointerId === 'undefined') event.pointerId = event.changedTouches[0].identifier || 0; - if (typeof event.pressure === 'undefined') event.pressure = event.changedTouches[0].force || 0.5; - if (typeof event.rotation === 'undefined') event.rotation = event.changedTouches[0].rotationAngle || 0; - - if (typeof event.clientX === 'undefined') event.clientX = event.changedTouches[0].clientX; - if (typeof event.clientY === 'undefined') event.clientY = event.changedTouches[0].clientY; - if (typeof event.pageX === 'undefined') event.pageX = event.changedTouches[0].pageX; - if (typeof event.pageY === 'undefined') event.pageY = event.changedTouches[0].pageY; - if (typeof event.screenX === 'undefined') event.screenX = event.changedTouches[0].screenX; - if (typeof event.screenY === 'undefined') event.screenY = event.changedTouches[0].screenY; - if (typeof event.layerX === 'undefined') event.layerX = event.offsetX = event.clientX; - if (typeof event.layerY === 'undefined') event.layerY = event.offsetY = event.clientY; - } else if (this.normalizeMouseEvents) { - if (typeof event.isPrimary === 'undefined') event.isPrimary = true; - if (typeof event.width === 'undefined') event.width = 1; - if (typeof event.height === 'undefined') event.height = 1; - if (typeof event.tiltX === 'undefined') event.tiltX = 0; - if (typeof event.tiltY === 'undefined') event.tiltY = 0; - if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse'; - if (typeof event.pointerId === 'undefined') event.pointerId = 1; - if (typeof event.pressure === 'undefined') event.pressure = 0.5; - if (typeof event.rotation === 'undefined') event.rotation = 0; + var normalizedEvents = []; + + if (this.supportsTouchEvents && event instanceof TouchEvent) { + for (var i = 0, li = event.changedTouches.length; i < li; i++) { + var touch = event.changedTouches[i]; + + if (typeof touch.button === 'undefined') touch.button = event.touches.length ? 1 : 0; + if (typeof touch.buttons === 'undefined') touch.buttons = event.touches.length ? 1 : 0; + if (typeof touch.isPrimary === 'undefined') { + touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart'; + } + if (typeof touch.width === 'undefined') touch.width = touch.radiusX || 1; + if (typeof touch.height === 'undefined') touch.height = touch.radiusY || 1; + if (typeof touch.tiltX === 'undefined') touch.tiltX = 0; + if (typeof touch.tiltY === 'undefined') touch.tiltY = 0; + if (typeof touch.pointerType === 'undefined') touch.pointerType = 'touch'; + if (typeof touch.pointerId === 'undefined') touch.pointerId = touch.identifier || 0; + if (typeof touch.pressure === 'undefined') touch.pressure = touch.force || 0.5; + touch.twist = 0; + touch.tangentialPressure = 0; + // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven + // support, and the fill ins are not quite the same + // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top + // left is not 0,0 on the page + if (typeof touch.layerX === 'undefined') touch.layerX = touch.offsetX = touch.clientX; + if (typeof touch.layerY === 'undefined') touch.layerY = touch.offsetY = touch.clientY; + + // mark the touch as normalized, just so that we know we did it + touch.isNormalized = true; + + normalizedEvents.push(touch); + } } + // apparently PointerEvent subclasses MouseEvent, so yay + else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent))) { + if (typeof event.isPrimary === 'undefined') event.isPrimary = true; + if (typeof event.width === 'undefined') event.width = 1; + if (typeof event.height === 'undefined') event.height = 1; + if (typeof event.tiltX === 'undefined') event.tiltX = 0; + if (typeof event.tiltY === 'undefined') event.tiltY = 0; + if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse'; + if (typeof event.pointerId === 'undefined') event.pointerId = MOUSE_POINTER_ID; + if (typeof event.pressure === 'undefined') event.pressure = 0.5; + event.twist = 0; + event.tangentialPressure = 0; + + // mark the mouse event as normalized, just so that we know we did it + event.isNormalized = true; + + normalizedEvents.push(event); + } else { + normalizedEvents.push(event); + } + + return normalizedEvents; }; /** @@ -66035,30 +69919,17 @@ var InteractionManager = function (_EventEmitter) { this.eventData = null; - this.interactiveDataPool = null; - this.interactionDOMElement = null; - this.onMouseDown = null; - this.processMouseDown = null; - - this.onMouseUp = null; - this.processMouseUp = null; - - this.onMouseMove = null; - this.processMouseMove = null; - - this.onMouseOut = null; - this.processMouseOverOut = null; - - this.onMouseOver = null; - this.onPointerDown = null; this.processPointerDown = null; this.onPointerUp = null; this.processPointerUp = null; + this.onPointerCancel = null; + this.processPointerCancel = null; + this.onPointerMove = null; this.processPointerMove = null; @@ -66067,15 +69938,6 @@ var InteractionManager = function (_EventEmitter) { this.onPointerOver = null; - this.onTouchStart = null; - this.processTouchStart = null; - - this.onTouchEnd = null; - this.processTouchEnd = null; - - this.onTouchMove = null; - this.processTouchMove = null; - this._tempPoint = null; }; @@ -66090,7 +69952,7 @@ core.CanvasRenderer.registerPlugin('interaction', InteractionManager); //# sourceMappingURL=InteractionManager.js.map /***/ }), -/* 578 */ +/* 582 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66107,7 +69969,7 @@ Object.defineProperty(exports, 'InteractionData', { } }); -var _InteractionManager = __webpack_require__(577); +var _InteractionManager = __webpack_require__(581); Object.defineProperty(exports, 'InteractionManager', { enumerable: true, @@ -66116,7 +69978,7 @@ Object.defineProperty(exports, 'InteractionManager', { } }); -var _interactiveTarget = __webpack_require__(261); +var _interactiveTarget = __webpack_require__(263); Object.defineProperty(exports, 'interactiveTarget', { enumerable: true, @@ -66125,11 +69987,162 @@ Object.defineProperty(exports, 'interactiveTarget', { } }); +var _InteractionTrackingData = __webpack_require__(262); + +Object.defineProperty(exports, 'InteractionTrackingData', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_InteractionTrackingData).default; + } +}); + +var _InteractionEvent = __webpack_require__(261); + +Object.defineProperty(exports, 'InteractionEvent', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_InteractionEvent).default; + } +}); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=index.js.map /***/ }), -/* 579 */ +/* 583 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; +exports.shared = exports.Resource = exports.textureParser = exports.getResourcePath = exports.spritesheetParser = exports.parseBitmapFontData = exports.bitmapFontParser = exports.Loader = undefined; + +var _bitmapFontParser = __webpack_require__(264); + +Object.defineProperty(exports, 'bitmapFontParser', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_bitmapFontParser).default; + } +}); +Object.defineProperty(exports, 'parseBitmapFontData', { + enumerable: true, + get: function get() { + return _bitmapFontParser.parse; + } +}); + +var _spritesheetParser = __webpack_require__(265); + +Object.defineProperty(exports, 'spritesheetParser', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_spritesheetParser).default; + } +}); +Object.defineProperty(exports, 'getResourcePath', { + enumerable: true, + get: function get() { + return _spritesheetParser.getResourcePath; + } +}); + +var _textureParser = __webpack_require__(266); + +Object.defineProperty(exports, 'textureParser', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_textureParser).default; + } +}); + +var _resourceLoader = __webpack_require__(59); + +Object.defineProperty(exports, 'Resource', { + enumerable: true, + get: function get() { + return _resourceLoader.Resource; + } +}); + +var _Application = __webpack_require__(235); + +var _Application2 = _interopRequireDefault(_Application); + +var _loader = __webpack_require__(584); + +var _loader2 = _interopRequireDefault(_loader); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This namespace contains APIs which extends the {@link https://github.com/englercj/resource-loader resource-loader} module + * for loading assets, data, and other resources dynamically. + * @example + * const loader = new PIXI.loaders.Loader(); + * loader.add('bunny', 'data/bunny.png') + * .add('spaceship', 'assets/spritesheet.json'); + * loader.load((loader, resources) => { + * // resources.bunny + * // resources.spaceship + * }); + * @namespace PIXI.loaders + */ +exports.Loader = _loader2.default; + + +/** + * A premade instance of the loader that can be used to load resources. + * @name shared + * @memberof PIXI.loaders + * @type {PIXI.loaders.Loader} + */ +var shared = new _loader2.default(); + +shared.destroy = function () { + // protect destroying shared loader +}; + +exports.shared = shared; + +// Mixin the loader construction + +var AppPrototype = _Application2.default.prototype; + +AppPrototype._loader = null; + +/** + * Loader instance to help with asset loading. + * @name PIXI.Application#loader + * @type {PIXI.loaders.Loader} + */ +Object.defineProperty(AppPrototype, 'loader', { + get: function get() { + if (!this._loader) { + var sharedLoader = this._options.sharedLoader; + + this._loader = sharedLoader ? shared : new _loader2.default(); + } + + return this._loader; + } +}); + +// Override the destroy function +// making sure to destroy the current Loader +AppPrototype._parentDestroy = AppPrototype.destroy; +AppPrototype.destroy = function destroy(removeView) { + if (this._loader) { + this._loader.destroy(); + this._loader = null; + } + this._parentDestroy(removeView); +}; +//# sourceMappingURL=index.js.map + +/***/ }), +/* 584 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66141,21 +70154,21 @@ var _resourceLoader = __webpack_require__(59); var _resourceLoader2 = _interopRequireDefault(_resourceLoader); -var _blob = __webpack_require__(600); +var _blob = __webpack_require__(609); -var _eventemitter = __webpack_require__(24); +var _eventemitter = __webpack_require__(30); var _eventemitter2 = _interopRequireDefault(_eventemitter); -var _textureParser = __webpack_require__(265); +var _textureParser = __webpack_require__(266); var _textureParser2 = _interopRequireDefault(_textureParser); -var _spritesheetParser = __webpack_require__(264); +var _spritesheetParser = __webpack_require__(265); var _spritesheetParser2 = _interopRequireDefault(_spritesheetParser); -var _bitmapFontParser = __webpack_require__(262); +var _bitmapFontParser = __webpack_require__(264); var _bitmapFontParser2 = _interopRequireDefault(_bitmapFontParser); @@ -66169,20 +70182,47 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" /** * - * The new loader, extends Resource Loader by Chad Engler : https://github.com/englercj/resource-loader + * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader * * ```js - * let loader = PIXI.loader; // pixi exposes a premade instance for you to use. + * const loader = PIXI.loader; // PixiJS exposes a premade instance for you to use. * //or - * let loader = new PIXI.loaders.Loader(); // you can also create your own if you want + * const loader = new PIXI.loaders.Loader(); // you can also create your own if you want + * + * const sprites = {}; * - * loader.add('bunny', 'data/bunny.png'); - * loader.add('spaceship', 'assets/spritesheet.json'); + * // Chainable `add` to enqueue a resource + * loader.add('bunny', 'data/bunny.png') + * .add('spaceship', 'assets/spritesheet.json'); * loader.add('scoreFont', 'assets/score.fnt'); * - * loader.once('complete',onAssetsLoaded); + * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource. + * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc). + * loader.pre(cachingMiddleware); + * + * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource. + * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc). + * loader.use(parsingMiddleware); + * + * // The `load` method loads the queue of resources, and calls the passed in callback called once all + * // resources have loaded. + * loader.load((loader, resources) => { + * // resources is an object where the key is the name of the resource loaded and the value is the resource object. + * // They have a couple default properties: + * // - `url`: The URL that the resource was loaded from + * // - `error`: The error that happened when trying to load (if any) + * // - `data`: The raw data that was loaded + * // also may contain other properties based on the middleware that runs. + * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture); + * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture); + * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture); + * }); * - * loader.load(); + * // throughout the process multiple signals can be dispatched. + * loader.onProgress.add(() => {}); // called once per loaded/errored file + * loader.onError.add(() => {}); // called once per errored file + * loader.onLoad.add(() => {}); // called once per loaded file + * loader.onComplete.add(() => {}); // called once when the queued resources all load. * ``` * * @see https://github.com/englercj/resource-loader @@ -66229,7 +70269,7 @@ var Loader = function (_ResourceLoader) { } /** - * Adds a default middleware to the pixi loader. + * Adds a default middleware to the PixiJS loader. * * @static * @param {Function} fn - The middleware to add. @@ -66240,6 +70280,16 @@ var Loader = function (_ResourceLoader) { Loader._pixiMiddleware.push(fn); }; + /** + * Destroy the loader, removes references. + */ + + + Loader.prototype.destroy = function destroy() { + this.removeAllListeners(); + this.reset(); + }; + return Loader; }(_resourceLoader2.default); @@ -66268,7 +70318,7 @@ Resource.setExtensionXhrType('fnt', Resource.XHR_RESPONSE_TYPE.DOCUMENT); //# sourceMappingURL=loader.js.map /***/ }), -/* 580 */ +/* 585 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66278,7 +70328,7 @@ exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -var _Plane2 = __webpack_require__(266); +var _Plane2 = __webpack_require__(267); var _Plane3 = _interopRequireDefault(_Plane2); @@ -66339,16 +70389,8 @@ var NineSlicePlane = function (_Plane) { var _this = _possibleConstructorReturn(this, _Plane.call(this, texture, 4, 4)); - var uvs = _this.uvs; - - // right and bottom uv's are always 1 - uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1; - uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1; - - _this._origWidth = texture.width; - _this._origHeight = texture.height; - _this._uvw = 1 / _this._origWidth; - _this._uvh = 1 / _this._origHeight; + _this._origWidth = texture.orig.width; + _this._origHeight = texture.orig.height; /** * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane @@ -66357,7 +70399,7 @@ var NineSlicePlane = function (_Plane) { * @memberof PIXI.NineSlicePlane# * @override */ - _this.width = texture.width; + _this._width = _this._origWidth; /** * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane @@ -66366,12 +70408,7 @@ var NineSlicePlane = function (_Plane) { * @memberof PIXI.NineSlicePlane# * @override */ - _this.height = texture.height; - - uvs[2] = uvs[10] = uvs[18] = uvs[26] = _this._uvw * leftWidth; - uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - _this._uvw * rightWidth; - uvs[9] = uvs[11] = uvs[13] = uvs[15] = _this._uvh * topHeight; - uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - _this._uvh * bottomHeight; + _this._height = _this._origHeight; /** * The width of the left column (a) @@ -66408,6 +70445,8 @@ var NineSlicePlane = function (_Plane) { * @override */ _this.bottomHeight = typeof bottomHeight !== 'undefined' ? bottomHeight : DEFAULT_BORDER_SIZE; + + _this.refresh(true); return _this; } @@ -66533,6 +70572,39 @@ var NineSlicePlane = function (_Plane) { */ + /** + * Refreshes NineSlicePlane coords. All of them. + */ + NineSlicePlane.prototype._refresh = function _refresh() { + _Plane.prototype._refresh.call(this); + + var uvs = this.uvs; + var texture = this._texture; + + this._origWidth = texture.orig.width; + this._origHeight = texture.orig.height; + + var _uvw = 1.0 / this._origWidth; + var _uvh = 1.0 / this._origHeight; + + uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0; + uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0; + uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1; + uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1; + + uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth; + uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - _uvw * this._rightWidth; + uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight; + uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - _uvh * this._bottomHeight; + + this.updateHorizontalVertices(); + this.updateVerticalVertices(); + + this.dirty++; + + this.multiplyUvs(); + }; + _createClass(NineSlicePlane, [{ key: 'width', get: function get() { @@ -66541,7 +70613,7 @@ var NineSlicePlane = function (_Plane) { set: function set(value) // eslint-disable-line require-jsdoc { this._width = value; - this.updateVerticalVertices(); + this._refresh(); } /** @@ -66558,7 +70630,7 @@ var NineSlicePlane = function (_Plane) { set: function set(value) // eslint-disable-line require-jsdoc { this._height = value; - this.updateHorizontalVertices(); + this._refresh(); } /** @@ -66575,14 +70647,7 @@ var NineSlicePlane = function (_Plane) { set: function set(value) // eslint-disable-line require-jsdoc { this._leftWidth = value; - - var uvs = this.uvs; - var vertices = this.vertices; - - uvs[2] = uvs[10] = uvs[18] = uvs[26] = this._uvw * value; - vertices[2] = vertices[10] = vertices[18] = vertices[26] = value; - - this.dirty = true; + this._refresh(); } /** @@ -66599,14 +70664,7 @@ var NineSlicePlane = function (_Plane) { set: function set(value) // eslint-disable-line require-jsdoc { this._rightWidth = value; - - var uvs = this.uvs; - var vertices = this.vertices; - - uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - this._uvw * value; - vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - value; - - this.dirty = true; + this._refresh(); } /** @@ -66623,14 +70681,7 @@ var NineSlicePlane = function (_Plane) { set: function set(value) // eslint-disable-line require-jsdoc { this._topHeight = value; - - var uvs = this.uvs; - var vertices = this.vertices; - - uvs[9] = uvs[11] = uvs[13] = uvs[15] = this._uvh * value; - vertices[9] = vertices[11] = vertices[13] = vertices[15] = value; - - this.dirty = true; + this._refresh(); } /** @@ -66647,14 +70698,7 @@ var NineSlicePlane = function (_Plane) { set: function set(value) // eslint-disable-line require-jsdoc { this._bottomHeight = value; - - var uvs = this.uvs; - var vertices = this.vertices; - - uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - this._uvh * value; - vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - value; - - this.dirty = true; + this._refresh(); } }]); @@ -66665,7 +70709,7 @@ exports.default = NineSlicePlane; //# sourceMappingURL=NineSlicePlane.js.map /***/ }), -/* 581 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66677,12 +70721,6 @@ var _Mesh2 = __webpack_require__(58); var _Mesh3 = _interopRequireDefault(_Mesh2); -var _core = __webpack_require__(0); - -var core = _interopRequireWildcard(_core); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -66716,41 +70754,49 @@ var Rope = function (_Mesh) { function Rope(texture, points) { _classCallCheck(this, Rope); - /* - * @member {PIXI.Point[]} An array of points that determine the rope + /** + * An array of points that determine the rope + * + * @member {PIXI.Point[]} */ var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture)); _this.points = points; - /* - * @member {Float32Array} An array of vertices used to construct this rope. + /** + * An array of vertices used to construct this rope. + * + * @member {Float32Array} */ _this.vertices = new Float32Array(points.length * 4); - /* - * @member {Float32Array} The WebGL Uvs of the rope. + /** + * The WebGL Uvs of the rope. + * + * @member {Float32Array} */ _this.uvs = new Float32Array(points.length * 4); - /* - * @member {Float32Array} An array containing the color components + /** + * An array containing the color components + * + * @member {Float32Array} */ _this.colors = new Float32Array(points.length * 2); - /* - * @member {Uint16Array} An array containing the indices of the vertices + /** + * An array containing the indices of the vertices + * + * @member {Uint16Array} */ _this.indices = new Uint16Array(points.length * 2); /** - * Tracker for if the rope is ready to be drawn. Needed because Mesh ctor can - * call _onTextureUpdated which could call refresh too early. - * + * refreshes vertices on every updateTransform * @member {boolean} - * @private + * @default true */ - _this._ready = true; + _this.autoUpdate = true; _this.refresh(); return _this; @@ -66762,7 +70808,7 @@ var Rope = function (_Mesh) { */ - Rope.prototype.refresh = function refresh() { + Rope.prototype._refresh = function _refresh() { var points = this.points; // if too little points, or texture hasn't got UVs set yet just move on. @@ -66783,14 +70829,10 @@ var Rope = function (_Mesh) { var indices = this.indices; var colors = this.colors; - var textureUvs = this._texture._uvs; - var offset = new core.Point(textureUvs.x0, textureUvs.y0); - var factor = new core.Point(textureUvs.x2 - textureUvs.x0, Number(textureUvs.y2 - textureUvs.y0)); - - uvs[0] = 0 + offset.x; - uvs[1] = 0 + offset.y; - uvs[2] = 0 + offset.x; - uvs[3] = factor.y + offset.y; + uvs[0] = 0; + uvs[1] = 0; + uvs[2] = 0; + uvs[3] = 1; colors[0] = 1; colors[1] = 1; @@ -66805,11 +70847,11 @@ var Rope = function (_Mesh) { var index = i * 4; var amount = i / (total - 1); - uvs[index] = amount * factor.x + offset.x; - uvs[index + 1] = 0 + offset.y; + uvs[index] = amount; + uvs[index + 1] = 0; - uvs[index + 2] = amount * factor.x + offset.x; - uvs[index + 3] = factor.y + offset.y; + uvs[index + 2] = amount; + uvs[index + 3] = 1; index = i * 2; colors[index] = 1; @@ -66823,32 +70865,17 @@ var Rope = function (_Mesh) { // ensure that the changes are uploaded this.dirty++; this.indexDirty++; - }; - - /** - * Clear texture UVs when new texture is set - * - * @private - */ - - - Rope.prototype._onTextureUpdate = function _onTextureUpdate() { - _Mesh.prototype._onTextureUpdate.call(this); - // wait for the Rope ctor to finish before calling refresh - if (this._ready) { - this.refresh(); - } + this.multiplyUvs(); + this.refreshVertices(); }; /** - * Updates the object transform for rendering - * - * @private + * refreshes vertices of Rope mesh */ - Rope.prototype.updateTransform = function updateTransform() { + Rope.prototype.refreshVertices = function refreshVertices() { var points = this.points; if (points.length < 1) { @@ -66900,7 +70927,19 @@ var Rope = function (_Mesh) { lastPoint = point; } + }; + + /** + * Updates the object transform for rendering + * + * @private + */ + + Rope.prototype.updateTransform = function updateTransform() { + if (this.autoUpdate) { + this.refreshVertices(); + } this.containerUpdateTransform(); }; @@ -66911,7 +70950,7 @@ exports.default = Rope; //# sourceMappingURL=Rope.js.map /***/ }), -/* 582 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66919,7 +70958,7 @@ exports.default = Rope; exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -67048,12 +71087,30 @@ var MeshSpriteRenderer = function () { var textureWidth = base.width; var textureHeight = base.height; - var u0 = uvs[index0] * base.width; - var u1 = uvs[index1] * base.width; - var u2 = uvs[index2] * base.width; - var v0 = uvs[index0 + 1] * base.height; - var v1 = uvs[index1 + 1] * base.height; - var v2 = uvs[index2 + 1] * base.height; + var u0 = void 0; + var u1 = void 0; + var u2 = void 0; + var v0 = void 0; + var v1 = void 0; + var v2 = void 0; + + if (mesh.uploadUvTransform) { + var ut = mesh._uvTransform.mapCoord; + + u0 = (uvs[index0] * ut.a + uvs[index0 + 1] * ut.c + ut.tx) * base.width; + u1 = (uvs[index1] * ut.a + uvs[index1 + 1] * ut.c + ut.tx) * base.width; + u2 = (uvs[index2] * ut.a + uvs[index2 + 1] * ut.c + ut.tx) * base.width; + v0 = (uvs[index0] * ut.b + uvs[index0 + 1] * ut.d + ut.ty) * base.height; + v1 = (uvs[index1] * ut.b + uvs[index1 + 1] * ut.d + ut.ty) * base.height; + v2 = (uvs[index2] * ut.b + uvs[index2 + 1] * ut.d + ut.ty) * base.height; + } else { + u0 = uvs[index0] * base.width; + u1 = uvs[index1] * base.width; + u2 = uvs[index2] * base.width; + v0 = uvs[index0 + 1] * base.height; + v1 = uvs[index1 + 1] * base.height; + v2 = uvs[index2 + 1] * base.height; + } var x0 = vertices[index0]; var x1 = vertices[index1]; @@ -67118,6 +71175,7 @@ var MeshSpriteRenderer = function () { context.drawImage(textureSource, 0, 0, textureWidth * base.resolution, textureHeight * base.resolution, 0, 0, textureWidth, textureHeight); context.restore(); + this.renderer.invalidateBlendMode(); }; /** @@ -67180,7 +71238,7 @@ core.CanvasRenderer.registerPlugin('mesh', MeshSpriteRenderer); //# sourceMappingURL=CanvasMeshRenderer.js.map /***/ }), -/* 583 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67188,7 +71246,73 @@ core.CanvasRenderer.registerPlugin('mesh', MeshSpriteRenderer); exports.__esModule = true; -var _core = __webpack_require__(0); +var _Mesh = __webpack_require__(58); + +Object.defineProperty(exports, 'Mesh', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Mesh).default; + } +}); + +var _MeshRenderer = __webpack_require__(589); + +Object.defineProperty(exports, 'MeshRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_MeshRenderer).default; + } +}); + +var _CanvasMeshRenderer = __webpack_require__(587); + +Object.defineProperty(exports, 'CanvasMeshRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CanvasMeshRenderer).default; + } +}); + +var _Plane = __webpack_require__(267); + +Object.defineProperty(exports, 'Plane', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Plane).default; + } +}); + +var _NineSlicePlane = __webpack_require__(585); + +Object.defineProperty(exports, 'NineSlicePlane', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_NineSlicePlane).default; + } +}); + +var _Rope = __webpack_require__(586); + +Object.defineProperty(exports, 'Rope', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_Rope).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map + +/***/ }), +/* 589 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); @@ -67200,7 +71324,7 @@ var _Mesh = __webpack_require__(58); var _Mesh2 = _interopRequireDefault(_Mesh); -var _path = __webpack_require__(17); +var _path = __webpack_require__(21); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -67212,6 +71336,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +var matrixIdentity = core.Matrix.IDENTITY; + /** * WebGL renderer plugin for tiling sprites * @@ -67219,6 +71345,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * @memberof PIXI * @extends PIXI.ObjectRenderer */ + var MeshRenderer = function (_core$ObjectRenderer) { _inherits(MeshRenderer, _core$ObjectRenderer); @@ -67246,7 +71373,7 @@ var MeshRenderer = function (_core$ObjectRenderer) { MeshRenderer.prototype.onContextChange = function onContextChange() { var gl = this.renderer.gl; - this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 translationMatrix;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n}\n', 'varying vec2 vTextureCoord;\nuniform float alpha;\nuniform vec3 tint;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vec4(tint * alpha, alpha);\n}\n'); + this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n'); }; /** @@ -67305,11 +71432,18 @@ var MeshRenderer = function (_core$ObjectRenderer) { glData.shader.uniforms.uSampler = renderer.bindTexture(texture); - renderer.state.setBlendMode(mesh.blendMode); + renderer.state.setBlendMode(core.utils.correctBlendMode(mesh.blendMode, texture.baseTexture.premultipliedAlpha)); + if (glData.shader.uniforms.uTransform) { + if (mesh.uploadUvTransform) { + glData.shader.uniforms.uTransform = mesh._uvTransform.mapCoord.toArray(true); + } else { + glData.shader.uniforms.uTransform = matrixIdentity.toArray(true); + } + } glData.shader.uniforms.translationMatrix = mesh.worldTransform.toArray(true); - glData.shader.uniforms.alpha = mesh.worldAlpha; - glData.shader.uniforms.tint = mesh.tintRgb; + + glData.shader.uniforms.uColor = core.utils.premultiplyRgba(mesh.tintRgb, mesh.worldAlpha, glData.shader.uniforms.uColor, texture.baseTexture.premultipliedAlpha); var drawMode = mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH ? gl.TRIANGLE_STRIP : gl.TRIANGLES; @@ -67326,7 +71460,7 @@ core.WebGLRenderer.registerPlugin('mesh', MeshRenderer); //# sourceMappingURL=MeshRenderer.js.map /***/ }), -/* 584 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67334,10 +71468,14 @@ core.WebGLRenderer.registerPlugin('mesh', MeshRenderer); exports.__esModule = true; -var _core = __webpack_require__(0); +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); +var _utils = __webpack_require__(3); + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -67364,7 +71502,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * } * ``` * - * And here you have a hundred sprites that will be renderer at the speed of light. + * And here you have a hundred sprites that will be rendered at the speed of light. * * @class * @extends PIXI.Container @@ -67374,19 +71512,23 @@ var ParticleContainer = function (_core$Container) { _inherits(ParticleContainer, _core$Container); /** - * @param {number} [maxSize=15000] - The maximum number of particles that can be renderer by the container. + * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container. + * Affects size of allocated buffers. * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied. * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied. * @param {boolean} [properties.position=true] - When true, position be uploaded and applied. * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied. * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied. - * @param {boolean} [properties.alpha=false] - When true, alpha be uploaded and applied. - * @param {number} [batchSize=15000] - Number of particles per batch. + * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied. + * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead. + * @param {boolean} [autoResize=true] If true, container allocates more batches in case + * there are more than `maxSize` particles. */ function ParticleContainer() { var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1500; var properties = arguments[1]; var batchSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16384; + var autoResize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; _classCallCheck(this, ParticleContainer); @@ -67453,6 +71595,13 @@ var ParticleContainer = function (_core$Container) { */ _this.blendMode = core.BLEND_MODES.NORMAL; + /** + * If true, container allocates more batches in case there are more than `maxSize` particles. + * @member {boolean} + * @default false + */ + _this.autoResize = autoResize; + /** * Used for canvas renderering. If true then the elements will be positioned at the * nearest pixel. This provides a nice speed boost. @@ -67471,6 +71620,18 @@ var ParticleContainer = function (_core$Container) { _this.baseTexture = null; _this.setProperties(properties); + + /** + * The tint applied to the container. + * This is a hex value. A value of 0xFFFFFF will remove any tint effect. + * + * @private + * @member {number} + * @default 0xFFFFFF + */ + _this._tint = 0; + _this.tintRgb = new Float32Array(4); + _this.tint = 0xFFFFFF; return _this; } @@ -67487,7 +71648,7 @@ var ParticleContainer = function (_core$Container) { this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1]; this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2]; this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3]; - this._properties[4] = 'alpha' in properties ? !!properties.alpha : this._properties[4]; + this._properties[4] = 'alpha' in properties || 'tint' in properties ? !!properties.alpha || !!properties.tint : this._properties[4]; } }; @@ -67504,14 +71665,21 @@ var ParticleContainer = function (_core$Container) { // PIXI.Container.prototype.updateTransform.call( this ); }; + /** + * The tint applied to the container. This is a hex value. + * A value of 0xFFFFFF will remove any tint effect. + ** IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. + * @member {number} + * @default 0xFFFFFF + */ + + /** * Renders the container using the WebGL renderer * * @private * @param {PIXI.WebGLRenderer} renderer - The webgl renderer */ - - ParticleContainer.prototype.renderWebGL = function renderWebGL(renderer) { var _this2 = this; @@ -67571,11 +71739,7 @@ var ParticleContainer = function (_core$Container) { var finalWidth = 0; var finalHeight = 0; - var compositeOperation = renderer.blendModes[this.blendMode]; - - if (compositeOperation !== context.globalCompositeOperation) { - context.globalCompositeOperation = compositeOperation; - } + renderer.setBlendMode(this.blendMode); context.globalAlpha = this.worldAlpha; @@ -67629,7 +71793,7 @@ var ParticleContainer = function (_core$Container) { var resolution = child._texture.baseTexture.resolution; - context.drawImage(child._texture.baseTexture.source, frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * resolution, positionY * resolution, finalWidth * resolution, finalHeight * resolution); + context.drawImage(child._texture.baseTexture.source, frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * renderer.resolution, positionY * renderer.resolution, finalWidth * renderer.resolution, finalHeight * renderer.resolution); } }; @@ -67660,6 +71824,18 @@ var ParticleContainer = function (_core$Container) { this._buffers = null; }; + _createClass(ParticleContainer, [{ + key: 'tint', + get: function get() { + return this._tint; + }, + set: function set(value) // eslint-disable-line require-jsdoc + { + this._tint = value; + (0, _utils.hex2rgb)(value, this.tintRgb); + } + }]); + return ParticleContainer; }(core.Container); @@ -67667,7 +71843,37 @@ exports.default = ParticleContainer; //# sourceMappingURL=ParticleContainer.js.map /***/ }), -/* 585 */ +/* 591 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _ParticleContainer = __webpack_require__(590); + +Object.defineProperty(exports, 'ParticleContainer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_ParticleContainer).default; + } +}); + +var _ParticleRenderer = __webpack_require__(593); + +Object.defineProperty(exports, 'ParticleRenderer', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_ParticleRenderer).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map + +/***/ }), +/* 592 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67679,7 +71885,7 @@ var _pixiGlCore = __webpack_require__(15); var _pixiGlCore2 = _interopRequireDefault(_pixiGlCore); -var _createIndicesForQuads = __webpack_require__(131); +var _createIndicesForQuads = __webpack_require__(132); var _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads); @@ -67691,7 +71897,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons * @author Mat Groves * * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! + * for creating the original PixiJS version! * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that * they now share 4 bytes on the vertex buffer * @@ -67723,20 +71929,6 @@ var ParticleBuffer = function () { */ this.gl = gl; - /** - * Size of a single vertex. - * - * @member {number} - */ - this.vertSize = 2; - - /** - * Size of a single vertex in bytes. - * - * @member {number} - */ - this.vertByteSize = this.vertSize * 4; - /** * The number of particles the buffer can hold * @@ -67767,6 +71959,7 @@ var ParticleBuffer = function () { attribute: property.attribute, size: property.size, uploadFunction: property.uploadFunction, + unsignedByte: property.unsignedByte, offset: property.offset }; @@ -67780,10 +71973,12 @@ var ParticleBuffer = function () { this.staticStride = 0; this.staticBuffer = null; this.staticData = null; + this.staticDataUint32 = null; this.dynamicStride = 0; this.dynamicBuffer = null; this.dynamicData = null; + this.dynamicDataUint32 = null; this.initBuffers(); } @@ -67817,8 +72012,11 @@ var ParticleBuffer = function () { this.dynamicStride += property.size; } - this.dynamicData = new Float32Array(this.size * this.dynamicStride * 4); - this.dynamicBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.dynamicData, gl.STREAM_DRAW); + var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4); + + this.dynamicData = new Float32Array(dynBuffer); + this.dynamicDataUint32 = new Uint32Array(dynBuffer); + this.dynamicBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, dynBuffer, gl.STREAM_DRAW); // static // var staticOffset = 0; @@ -67833,21 +72031,32 @@ var ParticleBuffer = function () { this.staticStride += _property.size; } - this.staticData = new Float32Array(this.size * this.staticStride * 4); - this.staticBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.staticData, gl.STATIC_DRAW); + var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4); + + this.staticData = new Float32Array(statBuffer); + this.staticDataUint32 = new Uint32Array(statBuffer); + this.staticBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, statBuffer, gl.STATIC_DRAW); this.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(this.indexBuffer); for (var _i2 = 0; _i2 < this.dynamicProperties.length; ++_i2) { var _property2 = this.dynamicProperties[_i2]; - this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.FLOAT, false, this.dynamicStride * 4, _property2.offset * 4); + if (_property2.unsignedByte) { + this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.UNSIGNED_BYTE, true, this.dynamicStride * 4, _property2.offset * 4); + } else { + this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.FLOAT, false, this.dynamicStride * 4, _property2.offset * 4); + } } for (var _i3 = 0; _i3 < this.staticProperties.length; ++_i3) { var _property3 = this.staticProperties[_i3]; - this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.FLOAT, false, this.staticStride * 4, _property3.offset * 4); + if (_property3.unsignedByte) { + this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.UNSIGNED_BYTE, true, this.staticStride * 4, _property3.offset * 4); + } else { + this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.FLOAT, false, this.staticStride * 4, _property3.offset * 4); + } } }; @@ -67864,7 +72073,7 @@ var ParticleBuffer = function () { for (var i = 0; i < this.dynamicProperties.length; i++) { var property = this.dynamicProperties[i]; - property.uploadFunction(children, startIndex, amount, this.dynamicData, this.dynamicStride, property.offset); + property.uploadFunction(children, startIndex, amount, property.unsignedByte ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset); } this.dynamicBuffer.upload(); @@ -67883,7 +72092,7 @@ var ParticleBuffer = function () { for (var i = 0; i < this.staticProperties.length; i++) { var property = this.staticProperties[i]; - property.uploadFunction(children, startIndex, amount, this.staticData, this.staticStride, property.offset); + property.uploadFunction(children, startIndex, amount, property.unsignedByte ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset); } this.staticBuffer.upload(); @@ -67912,7 +72121,7 @@ exports.default = ParticleBuffer; //# sourceMappingURL=ParticleBuffer.js.map /***/ }), -/* 586 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67920,18 +72129,20 @@ exports.default = ParticleBuffer; exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _ParticleShader = __webpack_require__(587); +var _ParticleShader = __webpack_require__(594); var _ParticleShader2 = _interopRequireDefault(_ParticleShader); -var _ParticleBuffer = __webpack_require__(585); +var _ParticleBuffer = __webpack_require__(592); var _ParticleBuffer2 = _interopRequireDefault(_ParticleBuffer); +var _utils = __webpack_require__(3); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -67946,7 +72157,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * @author Mat Groves * * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ - * for creating the original pixi version! + * for creating the original PixiJS version! * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now * share 4 bytes on the vertex buffer * @@ -68038,11 +72249,12 @@ var ParticleRenderer = function (_core$ObjectRenderer) { uploadFunction: this.uploadUvs, offset: 0 }, - // alphaData + // tintData { attribute: this.shader.attributes.aColor, size: 1, - uploadFunction: this.uploadAlpha, + unsignedByte: true, + uploadFunction: this.uploadTint, offset: 0 }]; }; @@ -68083,8 +72295,10 @@ var ParticleRenderer = function (_core$ObjectRenderer) { buffers = container._glBuffers[renderer.CONTEXT_UID] = this.generateBuffers(container); } + var baseTexture = children[0]._texture.baseTexture; + // if the uvs have not updated then no point rendering just yet! - this.renderer.setBlendMode(container.blendMode); + this.renderer.setBlendMode(core.utils.correctBlendMode(container.blendMode, baseTexture.premultipliedAlpha)); var gl = renderer.gl; @@ -68093,11 +72307,10 @@ var ParticleRenderer = function (_core$ObjectRenderer) { m.prepend(renderer._activeRenderTarget.projectionMatrix); this.shader.uniforms.projectionMatrix = m.toArray(true); - this.shader.uniforms.uAlpha = container.worldAlpha; - // make sure the texture is bound.. - var baseTexture = children[0]._texture.baseTexture; + this.shader.uniforms.uColor = core.utils.premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultipliedAlpha); + // make sure the texture is bound.. this.shader.uniforms.uSampler = renderer.bindTexture(baseTexture); // now lets upload and render the buffers.. @@ -68108,6 +72321,13 @@ var ParticleRenderer = function (_core$ObjectRenderer) { amount = batchSize; } + if (j >= buffers.length) { + if (!container.autoResize) { + break; + } + buffers.push(this._generateOneMoreBuffer(container)); + } + var buffer = buffers[j]; // we always upload the dynamic @@ -68147,6 +72367,23 @@ var ParticleRenderer = function (_core$ObjectRenderer) { return buffers; }; + /** + * Creates one more particle buffer, because container has autoResize feature + * + * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer + * @return {PIXI.ParticleBuffer} generated buffer + * @private + */ + + + ParticleRenderer.prototype._generateOneMoreBuffer = function _generateOneMoreBuffer(container) { + var gl = this.renderer.gl; + var batchSize = container._batchSize; + var dynamicPropertyFlags = container._properties; + + return new _ParticleBuffer2.default(gl, this.properties, dynamicPropertyFlags, batchSize); + }; + /** * Uploads the verticies. * @@ -68319,14 +72556,18 @@ var ParticleRenderer = function (_core$ObjectRenderer) { */ - ParticleRenderer.prototype.uploadAlpha = function uploadAlpha(children, startIndex, amount, array, stride, offset) { - for (var i = 0; i < amount; i++) { - var spriteAlpha = children[startIndex + i].alpha; + ParticleRenderer.prototype.uploadTint = function uploadTint(children, startIndex, amount, array, stride, offset) { + for (var i = 0; i < amount; ++i) { + var sprite = children[startIndex + i]; + var premultiplied = sprite._texture.baseTexture.premultipliedAlpha; + var alpha = sprite.alpha; + // we dont call extra function if alpha is 1.0, that's faster + var argb = alpha < 1.0 && premultiplied ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24); - array[offset] = spriteAlpha; - array[offset + stride] = spriteAlpha; - array[offset + stride * 2] = spriteAlpha; - array[offset + stride * 3] = spriteAlpha; + array[offset] = argb; + array[offset + stride] = argb; + array[offset + stride * 2] = argb; + array[offset + stride * 3] = argb; offset += stride * 4; } @@ -68361,7 +72602,7 @@ core.WebGLRenderer.registerPlugin('particle', ParticleRenderer); //# sourceMappingURL=ParticleRenderer.js.map /***/ }), -/* 587 */ +/* 594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68369,7 +72610,7 @@ core.WebGLRenderer.registerPlugin('particle', ParticleRenderer); exports.__esModule = true; -var _Shader2 = __webpack_require__(52); +var _Shader2 = __webpack_require__(54); var _Shader3 = _interopRequireDefault(_Shader2); @@ -68397,9 +72638,9 @@ var ParticleShader = function (_Shader) { return _possibleConstructorReturn(this, _Shader.call(this, gl, // vertex shader - ['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'), + ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', 'attribute vec2 aPositionCoord;', 'attribute vec2 aScale;', 'attribute float aRotation;', 'uniform mat3 projectionMatrix;', 'uniform vec4 uColor;', 'varying vec2 vTextureCoord;', 'varying vec4 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 * uColor;', '}'].join('\n'), // hello - ['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'))); + ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'uniform sampler2D uSampler;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor;', ' if (color.a == 0.0) discard;', ' gl_FragColor = color;', '}'].join('\n'))); } return ParticleShader; @@ -68409,7 +72650,7 @@ exports.default = ParticleShader; //# sourceMappingURL=ParticleShader.js.map /***/ }), -/* 588 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68432,13 +72673,13 @@ if (!Math.sign) { //# sourceMappingURL=Math.sign.js.map /***/ }), -/* 589 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _objectAssign = __webpack_require__(512); +var _objectAssign = __webpack_require__(511); var _objectAssign2 = _interopRequireDefault(_objectAssign); @@ -68452,17 +72693,17 @@ if (!Object.assign) { //# sourceMappingURL=Object.assign.js.map /***/ }), -/* 590 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -__webpack_require__(589); +__webpack_require__(596); -__webpack_require__(591); +__webpack_require__(598); -__webpack_require__(588); +__webpack_require__(595); if (!window.ArrayBuffer) { window.ArrayBuffer = Array; @@ -68482,7 +72723,7 @@ if (!window.Uint16Array) { //# sourceMappingURL=index.js.map /***/ }), -/* 591 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68510,17 +72751,15 @@ if (!(Date.now && Date.prototype.getTime)) { // performance.now if (!(global.performance && global.performance.now)) { - (function () { - var startTime = Date.now(); + var startTime = Date.now(); - if (!global.performance) { - global.performance = {}; - } + if (!global.performance) { + global.performance = {}; + } - global.performance.now = function () { - return Date.now() - startTime; - }; - })(); + global.performance.now = function () { + return Date.now() - startTime; + }; } // requestAnimationFrame @@ -68562,10 +72801,10 @@ if (!global.cancelAnimationFrame) { }; } //# sourceMappingURL=requestAnimationFrame.js.map -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(29))) /***/ }), -/* 592 */ +/* 599 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68573,11 +72812,11 @@ if (!global.cancelAnimationFrame) { exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _BasePrepare2 = __webpack_require__(133); +var _BasePrepare2 = __webpack_require__(134); var _BasePrepare3 = _interopRequireDefault(_BasePrepare2); @@ -68602,7 +72841,8 @@ var CANVAS_START_SIZE = 16; * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare * * @class - * @memberof PIXI + * @extends PIXI.prepare.BasePrepare + * @memberof PIXI.prepare */ var CanvasPrepare = function (_BasePrepare) { @@ -68635,7 +72875,7 @@ var CanvasPrepare = function (_BasePrepare) { _this.ctx = _this.canvas.getContext('2d'); // Add textures to upload - _this.register(findBaseTextures, uploadBaseTextures); + _this.registerUploadHook(uploadBaseTextures); return _this; } @@ -68685,40 +72925,68 @@ function uploadBaseTextures(prepare, item) { return false; } -/** - * Built-in hook to find textures from Sprites. - * - * @private - * @param {PIXI.DisplayObject} item -Display object to check - * @param {Array<*>} queue - Collection of items to upload - * @return {boolean} if a PIXI.Texture object was found. - */ -function findBaseTextures(item, queue) { - // Objects with textures, like Sprites/Text - if (item instanceof core.BaseTexture) { - if (queue.indexOf(item) === -1) { - queue.push(item); - } +core.CanvasRenderer.registerPlugin('prepare', CanvasPrepare); +//# sourceMappingURL=CanvasPrepare.js.map - return true; - } else if (item._texture && item._texture instanceof core.Texture) { - var texture = item._texture.baseTexture; +/***/ }), +/* 600 */ +/***/ (function(module, exports, __webpack_require__) { - if (queue.indexOf(texture) === -1) { - queue.push(texture); - } +"use strict"; - return true; - } - return false; -} +exports.__esModule = true; -core.CanvasRenderer.registerPlugin('prepare', CanvasPrepare); -//# sourceMappingURL=CanvasPrepare.js.map +var _WebGLPrepare = __webpack_require__(602); + +Object.defineProperty(exports, 'webgl', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_WebGLPrepare).default; + } +}); + +var _CanvasPrepare = __webpack_require__(599); + +Object.defineProperty(exports, 'canvas', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CanvasPrepare).default; + } +}); + +var _BasePrepare = __webpack_require__(134); + +Object.defineProperty(exports, 'BasePrepare', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_BasePrepare).default; + } +}); + +var _CountLimiter = __webpack_require__(268); + +Object.defineProperty(exports, 'CountLimiter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_CountLimiter).default; + } +}); + +var _TimeLimiter = __webpack_require__(601); + +Object.defineProperty(exports, 'TimeLimiter', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_TimeLimiter).default; + } +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +//# sourceMappingURL=index.js.map /***/ }), -/* 593 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68781,7 +73049,7 @@ exports.default = TimeLimiter; //# sourceMappingURL=TimeLimiter.js.map /***/ }), -/* 594 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68789,11 +73057,11 @@ exports.default = TimeLimiter; exports.__esModule = true; -var _core = __webpack_require__(0); +var _core = __webpack_require__(1); var core = _interopRequireWildcard(_core); -var _BasePrepare2 = __webpack_require__(133); +var _BasePrepare2 = __webpack_require__(134); var _BasePrepare3 = _interopRequireDefault(_BasePrepare2); @@ -68813,7 +73081,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare * * @class - * @memberof PIXI + * @extends PIXI.prepare.BasePrepare + * @memberof PIXI.prepare */ var WebGLPrepare = function (_BasePrepare) { _inherits(WebGLPrepare, _BasePrepare); @@ -68829,13 +73098,14 @@ var WebGLPrepare = function (_BasePrepare) { _this.uploadHookHelper = _this.renderer; // Add textures and graphics to upload - _this.register(findBaseTextures, uploadBaseTextures).register(findGraphics, uploadGraphics); + _this.registerFindHook(findGraphics); + _this.registerUploadHook(uploadBaseTextures); + _this.registerUploadHook(uploadGraphics); return _this; } return WebGLPrepare; }(_BasePrepare3.default); - /** * Built-in hook to upload PIXI.Texture objects to the GPU. * @@ -68884,35 +73154,6 @@ function uploadGraphics(renderer, item) { return false; } -/** - * Built-in hook to find textures from Sprites. - * - * @private - * @param {PIXI.DisplayObject} item - Display object to check - * @param {Array<*>} queue - Collection of items to upload - * @return {boolean} if a PIXI.Texture object was found. - */ -function findBaseTextures(item, queue) { - // Objects with textures, like Sprites/Text - if (item instanceof core.BaseTexture) { - if (queue.indexOf(item) === -1) { - queue.push(item); - } - - return true; - } else if (item._texture && item._texture instanceof core.Texture) { - var texture = item._texture.baseTexture; - - if (queue.indexOf(texture) === -1) { - queue.push(texture); - } - - return true; - } - - return false; -} - /** * Built-in hook to find graphics. * @@ -68935,7 +73176,7 @@ core.WebGLRenderer.registerPlugin('prepare', WebGLPrepare); //# sourceMappingURL=WebGLPrepare.js.map /***/ }), -/* 595 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ @@ -69471,10 +73712,10 @@ core.WebGLRenderer.registerPlugin('prepare', WebGLPrepare); }(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(86)(module), __webpack_require__(30))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(85)(module), __webpack_require__(29))) /***/ }), -/* 596 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69565,7 +73806,7 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 597 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69657,18 +73898,53 @@ var objectKeys = Object.keys || function (obj) { /***/ }), -/* 598 */ +/* 606 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -exports.decode = exports.parse = __webpack_require__(596); -exports.encode = exports.stringify = __webpack_require__(597); +exports.decode = exports.parse = __webpack_require__(604); +exports.encode = exports.stringify = __webpack_require__(605); /***/ }), -/* 599 */ +/* 607 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Remove a range of items from an array + * + * @function removeItems + * @param {Array<*>} arr The target array + * @param {number} startIdx The index to begin removing from (inclusive) + * @param {number} removeCount How many items to remove + */ +module.exports = function removeItems(arr, startIdx, removeCount) +{ + var i, length = arr.length + + if (startIdx >= length || removeCount === 0) { + return + } + + removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount) + + var len = length - removeCount + + for (i = startIdx; i < len; ++i) { + arr[i] = arr[i + removeCount] + } + + arr.length = len +} + + +/***/ }), +/* 608 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -69678,19 +73954,19 @@ exports.__esModule = true; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; -var _miniSignals = __webpack_require__(222); +var _miniSignals = __webpack_require__(223); var _miniSignals2 = _interopRequireDefault(_miniSignals); -var _parseUri = __webpack_require__(223); +var _parseUri = __webpack_require__(224); var _parseUri2 = _interopRequireDefault(_parseUri); -var _async = __webpack_require__(271); +var _async = __webpack_require__(269); var async = _interopRequireWildcard(_async); -var _Resource = __webpack_require__(135); +var _Resource = __webpack_require__(136); var _Resource2 = _interopRequireDefault(_Resource); @@ -69752,8 +74028,6 @@ var Loader = function () { * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property. * * @example - * - * ```js * const loader = new Loader(); * * loader.defaultQueryString = 'user=me&password=secret'; @@ -69765,7 +74039,6 @@ var Loader = function () { * * // This will request 'image.png?v=1&user=me&password=secret' * loader.add('iamge.png?v=1').load(); - * ``` */ this.defaultQueryString = ''; @@ -70046,6 +74319,8 @@ var Loader = function () { for (var _i2 = 0; _i2 < incompleteChildren.length; ++_i2) { incompleteChildren[_i2].progressChunk = eachChunk; } + + this.resources[name].progressChunk = eachChunk; } // add the resource to the queue @@ -70136,1188 +74411,508 @@ var Loader = function () { // if the queue has already started we are done here if (this.loading) { return this; - } - - // distribute progress chunks - var chunk = 100 / this._queue._tasks.length; - - for (var i = 0; i < this._queue._tasks.length; ++i) { - this._queue._tasks[i].data.progressChunk = chunk; - } - - // update loading state - this.loading = true; - - // notify of start - this.onStart.dispatch(this); - - // start loading - this._queue.resume(); - - return this; - }; - - /** - * Prepares a url for usage based on the configuration of this object - * - * @private - * @param {string} url - The url to prepare. - * @return {string} The prepared url. - */ - - - Loader.prototype._prepareUrl = function _prepareUrl(url) { - var parsedUrl = (0, _parseUri2.default)(url, { strictMode: true }); - var result = void 0; - - // absolute url, just use it as is. - if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) { - result = url; - } - // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween - else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') { - result = this.baseUrl + '/' + url; - } else { - result = this.baseUrl + url; - } - - // if we need to add a default querystring, there is a bit more work - if (this.defaultQueryString) { - var hash = rgxExtractUrlHash.exec(result)[0]; - - result = result.substr(0, result.length - hash.length); - - if (result.indexOf('?') !== -1) { - result += '&' + this.defaultQueryString; - } else { - result += '?' + this.defaultQueryString; - } - - result += hash; - } - - return result; - }; - - /** - * Loads a single resource. - * - * @private - * @param {Resource} resource - The resource to load. - * @param {function} dequeue - The function to call when we need to dequeue this item. - */ - - - Loader.prototype._loadResource = function _loadResource(resource, dequeue) { - var _this2 = this; - - resource._dequeue = dequeue; - - // run before middleware - async.eachSeries(this._beforeMiddleware, function (fn, next) { - fn.call(_this2, resource, function () { - // if the before middleware marks the resource as complete, - // break and don't process any more before middleware - next(resource.isComplete ? {} : null); - }); - }, function () { - if (resource.isComplete) { - _this2._onLoad(resource); - } else { - resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2); - resource.load(); - } - }); - }; - - /** - * Called once each resource has loaded. - * - * @private - */ - - - Loader.prototype._onComplete = function _onComplete() { - this.loading = false; - - this.onComplete.dispatch(this, this.resources); - }; - - /** - * Called each time a resources is loaded. - * - * @private - * @param {Resource} resource - The resource that was loaded - */ - - - Loader.prototype._onLoad = function _onLoad(resource) { - var _this3 = this; - - resource._onLoadBinding = null; - - // remove this resource from the async queue, and add it to our list of resources that are being parsed - resource._dequeue(); - this._resourcesParsing.push(resource); - - // run middleware, this *must* happen before dequeue so sub-assets get added properly - async.eachSeries(this._afterMiddleware, function (fn, next) { - fn.call(_this3, resource, next); - }, function () { - resource.onAfterMiddleware.dispatch(resource); - - _this3.progress += resource.progressChunk; - _this3.onProgress.dispatch(_this3, resource); - - if (resource.error) { - _this3.onError.dispatch(resource.error, _this3, resource); - } else { - _this3.onLoad.dispatch(_this3, resource); - } - - _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1); - - // do completion check - if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) { - _this3.progress = MAX_PROGRESS; - _this3._onComplete(); - } - }); - }; - - return Loader; -}(); - -exports.default = Loader; -//# sourceMappingURL=Loader.js.map - -/***/ }), -/* 600 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports.blobMiddlewareFactory = blobMiddlewareFactory; - -var _Resource = __webpack_require__(135); - -var _Resource2 = _interopRequireDefault(_Resource); - -var _b = __webpack_require__(272); - -var _b2 = _interopRequireDefault(_b); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Url = window.URL || window.webkitURL; - -// a middleware for transforming XHR loaded Blobs into more useful objects -function blobMiddlewareFactory() { - return function blobMiddleware(resource, next) { - if (!resource.data) { - next(); - - return; - } - - // if this was an XHR load of a blob - if (resource.xhr && resource.xhrType === _Resource2.default.XHR_RESPONSE_TYPE.BLOB) { - // if there is no blob support we probably got a binary string back - if (!window.Blob || typeof resource.data === 'string') { - var type = resource.xhr.getResponseHeader('content-type'); - - // this is an image, convert the binary string into a data url - if (type && type.indexOf('image') === 0) { - resource.data = new Image(); - resource.data.src = 'data:' + type + ';base64,' + _b2.default.encodeBinary(resource.xhr.responseText); - - resource.type = _Resource2.default.TYPE.IMAGE; - - // wait until the image loads and then callback - resource.data.onload = function () { - resource.data.onload = null; - - next(); - }; - - // next will be called on load - return; - } - } - // if content type says this is an image, then we should transform the blob into an Image object - else if (resource.data.type.indexOf('image') === 0) { - var _ret = function () { - var src = Url.createObjectURL(resource.data); - - resource.blob = resource.data; - resource.data = new Image(); - resource.data.src = src; - - resource.type = _Resource2.default.TYPE.IMAGE; - - // cleanup the no longer used blob after the image loads - // TODO: Is this correct? Will the image be invalid after revoking? - resource.data.onload = function () { - Url.revokeObjectURL(src); - resource.data.onload = null; - - next(); - }; - - // next will be called on load. - return { - v: void 0 - }; - }(); - - if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; - } - } - - next(); - }; -} -//# sourceMappingURL=blob.js.map - -/***/ }), -/* 601 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { - "use strict"; - - if (global.setImmediate) { - return; - } - - var nextHandle = 1; // Spec says greater than zero - var tasksByHandle = {}; - var currentlyRunningATask = false; - var doc = global.document; - var registerImmediate; - - function setImmediate(callback) { - // Callback can either be a function or a string - if (typeof callback !== "function") { - callback = new Function("" + callback); - } - // Copy function arguments - var args = new Array(arguments.length - 1); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i + 1]; - } - // Store and register the task - var task = { callback: callback, args: args }; - tasksByHandle[nextHandle] = task; - registerImmediate(nextHandle); - return nextHandle++; - } - - function clearImmediate(handle) { - delete tasksByHandle[handle]; - } - - function run(task) { - var callback = task.callback; - var args = task.args; - switch (args.length) { - case 0: - callback(); - break; - case 1: - callback(args[0]); - break; - case 2: - callback(args[0], args[1]); - break; - case 3: - callback(args[0], args[1], args[2]); - break; - default: - callback.apply(undefined, args); - break; - } - } - - function runIfPresent(handle) { - // From the spec: "Wait until any invocations of this algorithm started before this one have completed." - // So if we're currently running a task, we'll need to delay this invocation. - if (currentlyRunningATask) { - // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a - // "too much recursion" error. - setTimeout(runIfPresent, 0, handle); - } else { - var task = tasksByHandle[handle]; - if (task) { - currentlyRunningATask = true; - try { - run(task); - } finally { - clearImmediate(handle); - currentlyRunningATask = false; - } - } - } - } - - function installNextTickImplementation() { - registerImmediate = function(handle) { - process.nextTick(function () { runIfPresent(handle); }); - }; - } - - function canUsePostMessage() { - // The test against `importScripts` prevents this implementation from being installed inside a web worker, - // where `global.postMessage` means something completely different and can't be used for this purpose. - if (global.postMessage && !global.importScripts) { - var postMessageIsAsynchronous = true; - var oldOnMessage = global.onmessage; - global.onmessage = function() { - postMessageIsAsynchronous = false; - }; - global.postMessage("", "*"); - global.onmessage = oldOnMessage; - return postMessageIsAsynchronous; - } - } - - function installPostMessageImplementation() { - // Installs an event handler on `global` for the `message` event: see - // * https://developer.mozilla.org/en/DOM/window.postMessage - // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages - - var messagePrefix = "setImmediate$" + Math.random() + "$"; - var onGlobalMessage = function(event) { - if (event.source === global && - typeof event.data === "string" && - event.data.indexOf(messagePrefix) === 0) { - runIfPresent(+event.data.slice(messagePrefix.length)); - } - }; - - if (global.addEventListener) { - global.addEventListener("message", onGlobalMessage, false); - } else { - global.attachEvent("onmessage", onGlobalMessage); - } - - registerImmediate = function(handle) { - global.postMessage(messagePrefix + handle, "*"); - }; - } - - function installMessageChannelImplementation() { - var channel = new MessageChannel(); - channel.port1.onmessage = function(event) { - var handle = event.data; - runIfPresent(handle); - }; - - registerImmediate = function(handle) { - channel.port2.postMessage(handle); - }; - } - - function installReadyStateChangeImplementation() { - var html = doc.documentElement; - registerImmediate = function(handle) { - // Create a \n\t\t\t * \n\t\t\t * \n\t\t\t * \n\t\t\t * \n\t\t\t *\n\t\t\t * @param {!string} ns The namespace of the class definition, leaving off \"com.greensock.\" as that's assumed. For example, \"TweenLite\" or \"plugins.CSSPlugin\" or \"easing.Back\".\n\t\t\t * @param {!Array.} dependencies An array of dependencies (described as their namespaces minus \"com.greensock.\" prefix). For example [\"TweenLite\",\"plugins.TweenPlugin\",\"core.Animation\"]\n\t\t\t * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition.\n\t\t\t * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object)\n\t\t\t */\n\t\t\tDefinition = function(ns, dependencies, func, global) {\n\t\t\t\tthis.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses\n\t\t\t\t_defLookup[ns] = this;\n\t\t\t\tthis.gsClass = null;\n\t\t\t\tthis.func = func;\n\t\t\t\tvar _classes = [];\n\t\t\t\tthis.check = function(init) {\n\t\t\t\t\tvar i = dependencies.length,\n\t\t\t\t\t\tmissing = i,\n\t\t\t\t\t\tcur, a, n, cl, hasModule;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tif ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {\n\t\t\t\t\t\t\t_classes[i] = cur.gsClass;\n\t\t\t\t\t\t\tmissing--;\n\t\t\t\t\t\t} else if (init) {\n\t\t\t\t\t\t\tcur.sc.push(this);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (missing === 0 && func) {\n\t\t\t\t\t\ta = (\"com.greensock.\" + ns).split(\".\");\n\t\t\t\t\t\tn = a.pop();\n\t\t\t\t\t\tcl = _namespace(a.join(\".\"))[n] = this.gsClass = func.apply(func, _classes);\n\n\t\t\t\t\t\t//exports to multiple environments\n\t\t\t\t\t\tif (global) {\n\t\t\t\t\t\t\t_globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)\n\t\t\t\t\t\t\thasModule = (typeof(module) !== \"undefined\" && module.exports);\n\t\t\t\t\t\t\tif (!hasModule && typeof(define) === \"function\" && define.amd){ //AMD\n\t\t\t\t\t\t\t\tdefine((window.GreenSockAMDPath ? window.GreenSockAMDPath + \"/\" : \"\") + ns.split(\".\").pop(), [], function() { return cl; });\n\t\t\t\t\t\t\t} else if (hasModule){ //node\n\t\t\t\t\t\t\t\tif (ns === moduleName) {\n\t\t\t\t\t\t\t\t\tmodule.exports = _exports[moduleName] = cl;\n\t\t\t\t\t\t\t\t\tfor (i in _exports) {\n\t\t\t\t\t\t\t\t\t\tcl[i] = _exports[i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if (_exports[moduleName]) {\n\t\t\t\t\t\t\t\t\t_exports[moduleName][n] = cl;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (i = 0; i < this.sc.length; i++) {\n\t\t\t\t\t\t\tthis.sc[i].check();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tthis.check(true);\n\t\t\t},\n\n\t\t\t//used to create Definition instances (which basically registers a class that has dependencies).\n\t\t\t_gsDefine = window._gsDefine = function(ns, dependencies, func, global) {\n\t\t\t\treturn new Definition(ns, dependencies, func, global);\n\t\t\t},\n\n\t\t\t//a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class).\n\t\t\t_class = gs._class = function(ns, func, global) {\n\t\t\t\tfunc = func || function() {};\n\t\t\t\t_gsDefine(ns, [], function(){ return func; }, global);\n\t\t\t\treturn func;\n\t\t\t};\n\n\t\t_gsDefine.globals = _globals;\n\n\n\n/*\n * ----------------------------------------------------------------\n * Ease\n * ----------------------------------------------------------------\n */\n\t\tvar _baseParams = [0, 0, 1, 1],\n\t\t\t_blankArray = [],\n\t\t\tEase = _class(\"easing.Ease\", function(func, extraParams, type, power) {\n\t\t\t\tthis._func = func;\n\t\t\t\tthis._type = type || 0;\n\t\t\t\tthis._power = power || 0;\n\t\t\t\tthis._params = extraParams ? _baseParams.concat(extraParams) : _baseParams;\n\t\t\t}, true),\n\t\t\t_easeMap = Ease.map = {},\n\t\t\t_easeReg = Ease.register = function(ease, names, types, create) {\n\t\t\t\tvar na = names.split(\",\"),\n\t\t\t\t\ti = na.length,\n\t\t\t\t\tta = (types || \"easeIn,easeOut,easeInOut\").split(\",\"),\n\t\t\t\t\te, name, j, type;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tname = na[i];\n\t\t\t\t\te = create ? _class(\"easing.\"+name, null, true) : gs.easing[name] || {};\n\t\t\t\t\tj = ta.length;\n\t\t\t\t\twhile (--j > -1) {\n\t\t\t\t\t\ttype = ta[j];\n\t\t\t\t\t\t_easeMap[name + \".\" + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\tp = Ease.prototype;\n\t\tp._calcEnd = false;\n\t\tp.getRatio = function(p) {\n\t\t\tif (this._func) {\n\t\t\t\tthis._params[0] = p;\n\t\t\t\treturn this._func.apply(null, this._params);\n\t\t\t}\n\t\t\tvar t = this._type,\n\t\t\t\tpw = this._power,\n\t\t\t\tr = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2;\n\t\t\tif (pw === 1) {\n\t\t\t\tr *= r;\n\t\t\t} else if (pw === 2) {\n\t\t\t\tr *= r * r;\n\t\t\t} else if (pw === 3) {\n\t\t\t\tr *= r * r * r;\n\t\t\t} else if (pw === 4) {\n\t\t\t\tr *= r * r * r * r;\n\t\t\t}\n\t\t\treturn (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2);\n\t\t};\n\n\t\t//create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut)\n\t\ta = [\"Linear\",\"Quad\",\"Cubic\",\"Quart\",\"Quint,Strong\"];\n\t\ti = a.length;\n\t\twhile (--i > -1) {\n\t\t\tp = a[i]+\",Power\"+i;\n\t\t\t_easeReg(new Ease(null,null,1,i), p, \"easeOut\", true);\n\t\t\t_easeReg(new Ease(null,null,2,i), p, \"easeIn\" + ((i === 0) ? \",easeNone\" : \"\"));\n\t\t\t_easeReg(new Ease(null,null,3,i), p, \"easeInOut\");\n\t\t}\n\t\t_easeMap.linear = gs.easing.Linear.easeIn;\n\t\t_easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks\n\n\n/*\n * ----------------------------------------------------------------\n * EventDispatcher\n * ----------------------------------------------------------------\n */\n\t\tvar EventDispatcher = _class(\"events.EventDispatcher\", function(target) {\n\t\t\tthis._listeners = {};\n\t\t\tthis._eventTarget = target || this;\n\t\t});\n\t\tp = EventDispatcher.prototype;\n\n\t\tp.addEventListener = function(type, callback, scope, useParam, priority) {\n\t\t\tpriority = priority || 0;\n\t\t\tvar list = this._listeners[type],\n\t\t\t\tindex = 0,\n\t\t\t\tlistener, i;\n\t\t\tif (this === _ticker && !_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tif (list == null) {\n\t\t\t\tthis._listeners[type] = list = [];\n\t\t\t}\n\t\t\ti = list.length;\n\t\t\twhile (--i > -1) {\n\t\t\t\tlistener = list[i];\n\t\t\t\tif (listener.c === callback && listener.s === scope) {\n\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t} else if (index === 0 && listener.pr < priority) {\n\t\t\t\t\tindex = i + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority});\n\t\t};\n\n\t\tp.removeEventListener = function(type, callback) {\n\t\t\tvar list = this._listeners[type], i;\n\t\t\tif (list) {\n\t\t\t\ti = list.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (list[i].c === callback) {\n\t\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tp.dispatchEvent = function(type) {\n\t\t\tvar list = this._listeners[type],\n\t\t\t\ti, t, listener;\n\t\t\tif (list) {\n\t\t\t\ti = list.length;\n\t\t\t\tif (i > 1) {\n\t\t\t\t\tlist = list.slice(0); //in case addEventListener() is called from within a listener/callback (otherwise the index could change, resulting in a skip)\n\t\t\t\t}\n\t\t\t\tt = this._eventTarget;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tlistener = list[i];\n\t\t\t\t\tif (listener) {\n\t\t\t\t\t\tif (listener.up) {\n\t\t\t\t\t\t\tlistener.c.call(listener.s || t, {type:type, target:t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlistener.c.call(listener.s || t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\n/*\n * ----------------------------------------------------------------\n * Ticker\n * ----------------------------------------------------------------\n */\n \t\tvar _reqAnimFrame = window.requestAnimationFrame,\n\t\t\t_cancelAnimFrame = window.cancelAnimationFrame,\n\t\t\t_getTime = Date.now || function() {return new Date().getTime();},\n\t\t\t_lastUpdate = _getTime();\n\n\t\t//now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill.\n\t\ta = [\"ms\",\"moz\",\"webkit\",\"o\"];\n\t\ti = a.length;\n\t\twhile (--i > -1 && !_reqAnimFrame) {\n\t\t\t_reqAnimFrame = window[a[i] + \"RequestAnimationFrame\"];\n\t\t\t_cancelAnimFrame = window[a[i] + \"CancelAnimationFrame\"] || window[a[i] + \"CancelRequestAnimationFrame\"];\n\t\t}\n\n\t\t_class(\"Ticker\", function(fps, useRAF) {\n\t\t\tvar _self = this,\n\t\t\t\t_startTime = _getTime(),\n\t\t\t\t_useRAF = (useRAF !== false && _reqAnimFrame) ? \"auto\" : false,\n\t\t\t\t_lagThreshold = 500,\n\t\t\t\t_adjustedLag = 33,\n\t\t\t\t_tickWord = \"tick\", //helps reduce gc burden\n\t\t\t\t_fps, _req, _id, _gap, _nextTime,\n\t\t\t\t_tick = function(manual) {\n\t\t\t\t\tvar elapsed = _getTime() - _lastUpdate,\n\t\t\t\t\t\toverlap, dispatch;\n\t\t\t\t\tif (elapsed > _lagThreshold) {\n\t\t\t\t\t\t_startTime += elapsed - _adjustedLag;\n\t\t\t\t\t}\n\t\t\t\t\t_lastUpdate += elapsed;\n\t\t\t\t\t_self.time = (_lastUpdate - _startTime) / 1000;\n\t\t\t\t\toverlap = _self.time - _nextTime;\n\t\t\t\t\tif (!_fps || overlap > 0 || manual === true) {\n\t\t\t\t\t\t_self.frame++;\n\t\t\t\t\t\t_nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap);\n\t\t\t\t\t\tdispatch = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (manual !== true) { //make sure the request is made before we dispatch the \"tick\" event so that timing is maintained. Otherwise, if processing the \"tick\" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.\n\t\t\t\t\t\t_id = _req(_tick);\n\t\t\t\t\t}\n\t\t\t\t\tif (dispatch) {\n\t\t\t\t\t\t_self.dispatchEvent(_tickWord);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\tEventDispatcher.call(_self);\n\t\t\t_self.time = _self.frame = 0;\n\t\t\t_self.tick = function() {\n\t\t\t\t_tick(true);\n\t\t\t};\n\n\t\t\t_self.lagSmoothing = function(threshold, adjustedLag) {\n\t\t\t\t_lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited\n\t\t\t\t_adjustedLag = Math.min(adjustedLag, _lagThreshold, 0);\n\t\t\t};\n\n\t\t\t_self.sleep = function() {\n\t\t\t\tif (_id == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!_useRAF || !_cancelAnimFrame) {\n\t\t\t\t\tclearTimeout(_id);\n\t\t\t\t} else {\n\t\t\t\t\t_cancelAnimFrame(_id);\n\t\t\t\t}\n\t\t\t\t_req = _emptyFunc;\n\t\t\t\t_id = null;\n\t\t\t\tif (_self === _ticker) {\n\t\t\t\t\t_tickerActive = false;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t_self.wake = function(seamless) {\n\t\t\t\tif (_id !== null) {\n\t\t\t\t\t_self.sleep();\n\t\t\t\t} else if (seamless) {\n\t\t\t\t\t_startTime += -_lastUpdate + (_lastUpdate = _getTime());\n\t\t\t\t} else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout().\n\t\t\t\t\t_lastUpdate = _getTime() - _lagThreshold + 5;\n\t\t\t\t}\n\t\t\t\t_req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame;\n\t\t\t\tif (_self === _ticker) {\n\t\t\t\t\t_tickerActive = true;\n\t\t\t\t}\n\t\t\t\t_tick(2);\n\t\t\t};\n\n\t\t\t_self.fps = function(value) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn _fps;\n\t\t\t\t}\n\t\t\t\t_fps = value;\n\t\t\t\t_gap = 1 / (_fps || 60);\n\t\t\t\t_nextTime = this.time + _gap;\n\t\t\t\t_self.wake();\n\t\t\t};\n\n\t\t\t_self.useRAF = function(value) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn _useRAF;\n\t\t\t\t}\n\t\t\t\t_self.sleep();\n\t\t\t\t_useRAF = value;\n\t\t\t\t_self.fps(_fps);\n\t\t\t};\n\t\t\t_self.fps(fps);\n\n\t\t\t//a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition.\n\t\t\tsetTimeout(function() {\n\t\t\t\tif (_useRAF === \"auto\" && _self.frame < 5 && _doc.visibilityState !== \"hidden\") {\n\t\t\t\t\t_self.useRAF(false);\n\t\t\t\t}\n\t\t\t}, 1500);\n\t\t});\n\n\t\tp = gs.Ticker.prototype = new gs.events.EventDispatcher();\n\t\tp.constructor = gs.Ticker;\n\n\n/*\n * ----------------------------------------------------------------\n * Animation\n * ----------------------------------------------------------------\n */\n\t\tvar Animation = _class(\"core.Animation\", function(duration, vars) {\n\t\t\t\tthis.vars = vars = vars || {};\n\t\t\t\tthis._duration = this._totalDuration = duration || 0;\n\t\t\t\tthis._delay = Number(vars.delay) || 0;\n\t\t\t\tthis._timeScale = 1;\n\t\t\t\tthis._active = (vars.immediateRender === true);\n\t\t\t\tthis.data = vars.data;\n\t\t\t\tthis._reversed = (vars.reversed === true);\n\n\t\t\t\tif (!_rootTimeline) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly.\n\t\t\t\t\t_ticker.wake();\n\t\t\t\t}\n\n\t\t\t\tvar tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline;\n\t\t\t\ttl.add(this, tl._time);\n\n\t\t\t\tif (this.vars.paused) {\n\t\t\t\t\tthis.paused(true);\n\t\t\t\t}\n\t\t\t});\n\n\t\t_ticker = Animation.ticker = new gs.Ticker();\n\t\tp = Animation.prototype;\n\t\tp._dirty = p._gc = p._initted = p._paused = false;\n\t\tp._totalTime = p._time = 0;\n\t\tp._rawPrevTime = -1;\n\t\tp._next = p._last = p._onUpdate = p._timeline = p.timeline = null;\n\t\tp._paused = false;\n\n\n\t\t//some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.\n\t\tvar _checkTimeout = function() {\n\t\t\t\tif (_tickerActive && _getTime() - _lastUpdate > 2000) {\n\t\t\t\t\t_ticker.wake();\n\t\t\t\t}\n\t\t\t\tsetTimeout(_checkTimeout, 2000);\n\t\t\t};\n\t\t_checkTimeout();\n\n\n\t\tp.play = function(from, suppressEvents) {\n\t\t\tif (from != null) {\n\t\t\t\tthis.seek(from, suppressEvents);\n\t\t\t}\n\t\t\treturn this.reversed(false).paused(false);\n\t\t};\n\n\t\tp.pause = function(atTime, suppressEvents) {\n\t\t\tif (atTime != null) {\n\t\t\t\tthis.seek(atTime, suppressEvents);\n\t\t\t}\n\t\t\treturn this.paused(true);\n\t\t};\n\n\t\tp.resume = function(from, suppressEvents) {\n\t\t\tif (from != null) {\n\t\t\t\tthis.seek(from, suppressEvents);\n\t\t\t}\n\t\t\treturn this.paused(false);\n\t\t};\n\n\t\tp.seek = function(time, suppressEvents) {\n\t\t\treturn this.totalTime(Number(time), suppressEvents !== false);\n\t\t};\n\n\t\tp.restart = function(includeDelay, suppressEvents) {\n\t\t\treturn this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true);\n\t\t};\n\n\t\tp.reverse = function(from, suppressEvents) {\n\t\t\tif (from != null) {\n\t\t\t\tthis.seek((from || this.totalDuration()), suppressEvents);\n\t\t\t}\n\t\t\treturn this.reversed(true).paused(false);\n\t\t};\n\n\t\tp.render = function(time, suppressEvents, force) {\n\t\t\t//stub - we override this method in subclasses.\n\t\t};\n\n\t\tp.invalidate = function() {\n\t\t\tthis._time = this._totalTime = 0;\n\t\t\tthis._initted = this._gc = false;\n\t\t\tthis._rawPrevTime = -1;\n\t\t\tif (this._gc || !this.timeline) {\n\t\t\t\tthis._enabled(true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.isActive = function() {\n\t\t\tvar tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active.\n\t\t\t\tstartTime = this._startTime,\n\t\t\t\trawTime;\n\t\t\treturn (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));\n\t\t};\n\n\t\tp._enabled = function (enabled, ignoreTimeline) {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tthis._gc = !enabled;\n\t\t\tthis._active = this.isActive();\n\t\t\tif (ignoreTimeline !== true) {\n\t\t\t\tif (enabled && !this.timeline) {\n\t\t\t\t\tthis._timeline.add(this, this._startTime - this._delay);\n\t\t\t\t} else if (!enabled && this.timeline) {\n\t\t\t\t\tthis._timeline._remove(this, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\n\t\tp._kill = function(vars, target) {\n\t\t\treturn this._enabled(false, false);\n\t\t};\n\n\t\tp.kill = function(vars, target) {\n\t\t\tthis._kill(vars, target);\n\t\t\treturn this;\n\t\t};\n\n\t\tp._uncache = function(includeSelf) {\n\t\t\tvar tween = includeSelf ? this : this.timeline;\n\t\t\twhile (tween) {\n\t\t\t\ttween._dirty = true;\n\t\t\t\ttween = tween.timeline;\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp._swapSelfInParams = function(params) {\n\t\t\tvar i = params.length,\n\t\t\t\tcopy = params.concat();\n\t\t\twhile (--i > -1) {\n\t\t\t\tif (params[i] === \"{self}\") {\n\t\t\t\t\tcopy[i] = this;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn copy;\n\t\t};\n\n\t\tp._callback = function(type) {\n\t\t\tvar v = this.vars,\n\t\t\t\tcallback = v[type],\n\t\t\t\tparams = v[type + \"Params\"],\n\t\t\t\tscope = v[type + \"Scope\"] || v.callbackScope || this,\n\t\t\t\tl = params ? params.length : 0;\n\t\t\tswitch (l) { //speed optimization; call() is faster than apply() so use it when there are only a few parameters (which is by far most common). Previously we simply did var v = this.vars; v[type].apply(v[type + \"Scope\"] || v.callbackScope || this, v[type + \"Params\"] || _blankArray);\n\t\t\t\tcase 0: callback.call(scope); break;\n\t\t\t\tcase 1: callback.call(scope, params[0]); break;\n\t\t\t\tcase 2: callback.call(scope, params[0], params[1]); break;\n\t\t\t\tdefault: callback.apply(scope, params);\n\t\t\t}\n\t\t};\n\n//----Animation getters/setters --------------------------------------------------------\n\n\t\tp.eventCallback = function(type, callback, params, scope) {\n\t\t\tif ((type || \"\").substr(0,2) === \"on\") {\n\t\t\t\tvar v = this.vars;\n\t\t\t\tif (arguments.length === 1) {\n\t\t\t\t\treturn v[type];\n\t\t\t\t}\n\t\t\t\tif (callback == null) {\n\t\t\t\t\tdelete v[type];\n\t\t\t\t} else {\n\t\t\t\t\tv[type] = callback;\n\t\t\t\t\tv[type + \"Params\"] = (_isArray(params) && params.join(\"\").indexOf(\"{self}\") !== -1) ? this._swapSelfInParams(params) : params;\n\t\t\t\t\tv[type + \"Scope\"] = scope;\n\t\t\t\t}\n\t\t\t\tif (type === \"onUpdate\") {\n\t\t\t\t\tthis._onUpdate = callback;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.delay = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._delay;\n\t\t\t}\n\t\t\tif (this._timeline.smoothChildTiming) {\n\t\t\t\tthis.startTime( this._startTime + value - this._delay );\n\t\t\t}\n\t\t\tthis._delay = value;\n\t\t\treturn this;\n\t\t};\n\n\t\tp.duration = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\tthis._dirty = false;\n\t\t\t\treturn this._duration;\n\t\t\t}\n\t\t\tthis._duration = this._totalDuration = value;\n\t\t\tthis._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration.\n\t\t\tif (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) {\n\t\t\t\tthis.totalTime(this._totalTime * (value / this._duration), true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.totalDuration = function(value) {\n\t\t\tthis._dirty = false;\n\t\t\treturn (!arguments.length) ? this._totalDuration : this.duration(value);\n\t\t};\n\n\t\tp.time = function(value, suppressEvents) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._time;\n\t\t\t}\n\t\t\tif (this._dirty) {\n\t\t\t\tthis.totalDuration();\n\t\t\t}\n\t\t\treturn this.totalTime((value > this._duration) ? this._duration : value, suppressEvents);\n\t\t};\n\n\t\tp.totalTime = function(time, suppressEvents, uncapped) {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._totalTime;\n\t\t\t}\n\t\t\tif (this._timeline) {\n\t\t\t\tif (time < 0 && !uncapped) {\n\t\t\t\t\ttime += this.totalDuration();\n\t\t\t\t}\n\t\t\t\tif (this._timeline.smoothChildTiming) {\n\t\t\t\t\tif (this._dirty) {\n\t\t\t\t\t\tthis.totalDuration();\n\t\t\t\t\t}\n\t\t\t\t\tvar totalDuration = this._totalDuration,\n\t\t\t\t\t\ttl = this._timeline;\n\t\t\t\t\tif (time > totalDuration && !uncapped) {\n\t\t\t\t\t\ttime = totalDuration;\n\t\t\t\t\t}\n\t\t\t\t\tthis._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale);\n\t\t\t\t\tif (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.\n\t\t\t\t\t\tthis._uncache(false);\n\t\t\t\t\t}\n\t\t\t\t\t//in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed.\n\t\t\t\t\tif (tl._timeline) {\n\t\t\t\t\t\twhile (tl._timeline) {\n\t\t\t\t\t\t\tif (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) {\n\t\t\t\t\t\t\t\ttl.totalTime(tl._totalTime, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttl = tl._timeline;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this._gc) {\n\t\t\t\t\tthis._enabled(true, false);\n\t\t\t\t}\n\t\t\t\tif (this._totalTime !== time || this._duration === 0) {\n\t\t\t\t\tif (_lazyTweens.length) {\n\t\t\t\t\t\t_lazyRender();\n\t\t\t\t\t}\n\t\t\t\t\tthis.render(time, suppressEvents, false);\n\t\t\t\t\tif (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.\n\t\t\t\t\t\t_lazyRender();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.progress = p.totalProgress = function(value, suppressEvents) {\n\t\t\tvar duration = this.duration();\n\t\t\treturn (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents);\n\t\t};\n\n\t\tp.startTime = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._startTime;\n\t\t\t}\n\t\t\tif (value !== this._startTime) {\n\t\t\t\tthis._startTime = value;\n\t\t\t\tif (this.timeline) if (this.timeline._sortChildren) {\n\t\t\t\t\tthis.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct.\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.endTime = function(includeRepeats) {\n\t\t\treturn this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale;\n\t\t};\n\n\t\tp.timeScale = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._timeScale;\n\t\t\t}\n\t\t\tvalue = value || _tinyNum; //can't allow zero because it'll throw the math off\n\t\t\tif (this._timeline && this._timeline.smoothChildTiming) {\n\t\t\t\tvar pauseTime = this._pauseTime,\n\t\t\t\t\tt = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime();\n\t\t\t\tthis._startTime = t - ((t - this._startTime) * this._timeScale / value);\n\t\t\t}\n\t\t\tthis._timeScale = value;\n\t\t\treturn this._uncache(false);\n\t\t};\n\n\t\tp.reversed = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._reversed;\n\t\t\t}\n\t\t\tif (value != this._reversed) {\n\t\t\t\tthis._reversed = value;\n\t\t\t\tthis.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.paused = function(value) {\n\t\t\tif (!arguments.length) {\n\t\t\t\treturn this._paused;\n\t\t\t}\n\t\t\tvar tl = this._timeline,\n\t\t\t\traw, elapsed;\n\t\t\tif (value != this._paused) if (tl) {\n\t\t\t\tif (!_tickerActive && !value) {\n\t\t\t\t\t_ticker.wake();\n\t\t\t\t}\n\t\t\t\traw = tl.rawTime();\n\t\t\t\telapsed = raw - this._pauseTime;\n\t\t\t\tif (!value && tl.smoothChildTiming) {\n\t\t\t\t\tthis._startTime += elapsed;\n\t\t\t\t\tthis._uncache(false);\n\t\t\t\t}\n\t\t\t\tthis._pauseTime = value ? raw : null;\n\t\t\t\tthis._paused = value;\n\t\t\t\tthis._active = this.isActive();\n\t\t\t\tif (!value && elapsed !== 0 && this._initted && this.duration()) {\n\t\t\t\t\traw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale;\n\t\t\t\t\tthis.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render.\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._gc && !value) {\n\t\t\t\tthis._enabled(true, false);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\n/*\n * ----------------------------------------------------------------\n * SimpleTimeline\n * ----------------------------------------------------------------\n */\n\t\tvar SimpleTimeline = _class(\"core.SimpleTimeline\", function(vars) {\n\t\t\tAnimation.call(this, 0, vars);\n\t\t\tthis.autoRemoveChildren = this.smoothChildTiming = true;\n\t\t});\n\n\t\tp = SimpleTimeline.prototype = new Animation();\n\t\tp.constructor = SimpleTimeline;\n\t\tp.kill()._gc = false;\n\t\tp._first = p._last = p._recent = null;\n\t\tp._sortChildren = false;\n\n\t\tp.add = p.insert = function(child, position, align, stagger) {\n\t\t\tvar prevTween, st;\n\t\t\tchild._startTime = Number(position || 0) + child._delay;\n\t\t\tif (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order).\n\t\t\t\tchild._pauseTime = child._startTime + ((this.rawTime() - child._startTime) / child._timeScale);\n\t\t\t}\n\t\t\tif (child.timeline) {\n\t\t\t\tchild.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one.\n\t\t\t}\n\t\t\tchild.timeline = child._timeline = this;\n\t\t\tif (child._gc) {\n\t\t\t\tchild._enabled(true, true);\n\t\t\t}\n\t\t\tprevTween = this._last;\n\t\t\tif (this._sortChildren) {\n\t\t\t\tst = child._startTime;\n\t\t\t\twhile (prevTween && prevTween._startTime > st) {\n\t\t\t\t\tprevTween = prevTween._prev;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (prevTween) {\n\t\t\t\tchild._next = prevTween._next;\n\t\t\t\tprevTween._next = child;\n\t\t\t} else {\n\t\t\t\tchild._next = this._first;\n\t\t\t\tthis._first = child;\n\t\t\t}\n\t\t\tif (child._next) {\n\t\t\t\tchild._next._prev = child;\n\t\t\t} else {\n\t\t\t\tthis._last = child;\n\t\t\t}\n\t\t\tchild._prev = prevTween;\n\t\t\tthis._recent = child;\n\t\t\tif (this._timeline) {\n\t\t\t\tthis._uncache(true);\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp._remove = function(tween, skipDisable) {\n\t\t\tif (tween.timeline === this) {\n\t\t\t\tif (!skipDisable) {\n\t\t\t\t\ttween._enabled(false, true);\n\t\t\t\t}\n\n\t\t\t\tif (tween._prev) {\n\t\t\t\t\ttween._prev._next = tween._next;\n\t\t\t\t} else if (this._first === tween) {\n\t\t\t\t\tthis._first = tween._next;\n\t\t\t\t}\n\t\t\t\tif (tween._next) {\n\t\t\t\t\ttween._next._prev = tween._prev;\n\t\t\t\t} else if (this._last === tween) {\n\t\t\t\t\tthis._last = tween._prev;\n\t\t\t\t}\n\t\t\t\ttween._next = tween._prev = tween.timeline = null;\n\t\t\t\tif (tween === this._recent) {\n\t\t\t\t\tthis._recent = this._last;\n\t\t\t\t}\n\n\t\t\t\tif (this._timeline) {\n\t\t\t\t\tthis._uncache(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp.render = function(time, suppressEvents, force) {\n\t\t\tvar tween = this._first,\n\t\t\t\tnext;\n\t\t\tthis._totalTime = this._time = this._rawPrevTime = time;\n\t\t\twhile (tween) {\n\t\t\t\tnext = tween._next; //record it here because the value could change after rendering...\n\t\t\t\tif (tween._active || (time >= tween._startTime && !tween._paused)) {\n\t\t\t\t\tif (!tween._reversed) {\n\t\t\t\t\t\ttween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttween = next;\n\t\t\t}\n\t\t};\n\n\t\tp.rawTime = function() {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\treturn this._totalTime;\n\t\t};\n\n/*\n * ----------------------------------------------------------------\n * TweenLite\n * ----------------------------------------------------------------\n */\n\t\tvar TweenLite = _class(\"TweenLite\", function(target, duration, vars) {\n\t\t\t\tAnimation.call(this, duration, vars);\n\t\t\t\tthis.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this \"hot\" method)\n\n\t\t\t\tif (target == null) {\n\t\t\t\t\tthrow \"Cannot tween a null target.\";\n\t\t\t\t}\n\n\t\t\t\tthis.target = target = (typeof(target) !== \"string\") ? target : TweenLite.selector(target) || target;\n\n\t\t\t\tvar isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))),\n\t\t\t\t\toverwrite = this.vars.overwrite,\n\t\t\t\t\ti, targ, targets;\n\n\t\t\t\tthis._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === \"number\") ? overwrite >> 0 : _overwriteLookup[overwrite];\n\n\t\t\t\tif ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== \"number\") {\n\t\t\t\t\tthis._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()\n\t\t\t\t\tthis._propLookup = [];\n\t\t\t\t\tthis._siblings = [];\n\t\t\t\t\tfor (i = 0; i < targets.length; i++) {\n\t\t\t\t\t\ttarg = targets[i];\n\t\t\t\t\t\tif (!targ) {\n\t\t\t\t\t\t\ttargets.splice(i--, 1);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (typeof(targ) === \"string\") {\n\t\t\t\t\t\t\ttarg = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings\n\t\t\t\t\t\t\tif (typeof(targ) === \"string\") {\n\t\t\t\t\t\t\t\ttargets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that elements pass all the criteria regarding length and the first child having style, so we must also check to ensure the target isn't an HTML node itself.\n\t\t\t\t\t\t\ttargets.splice(i--, 1);\n\t\t\t\t\t\t\tthis._targets = targets = targets.concat(_slice(targ));\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._siblings[i] = _register(targ, this, false);\n\t\t\t\t\t\tif (overwrite === 1) if (this._siblings[i].length > 1) {\n\t\t\t\t\t\t\t_applyOverwrite(targ, this, null, 1, this._siblings[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tthis._propLookup = {};\n\t\t\t\t\tthis._siblings = _register(target, this, false);\n\t\t\t\t\tif (overwrite === 1) if (this._siblings.length > 1) {\n\t\t\t\t\t\t_applyOverwrite(target, this, null, 1, this._siblings);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender !== false)) {\n\t\t\t\t\tthis._time = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\t\t\t\t\tthis.render(Math.min(0, -this._delay)); //in case delay is negative\n\t\t\t\t}\n\t\t\t}, true),\n\t\t\t_isSelector = function(v) {\n\t\t\t\treturn (v && v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check \"nodeType\" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox.\n\t\t\t},\n\t\t\t_autoCSS = function(vars, target) {\n\t\t\t\tvar css = {},\n\t\t\t\t\tp;\n\t\t\t\tfor (p in vars) {\n\t\t\t\t\tif (!_reservedProps[p] && (!(p in target) || p === \"transform\" || p === \"x\" || p === \"y\" || p === \"width\" || p === \"height\" || p === \"className\" || p === \"border\") && (!_plugins[p] || (_plugins[p] && _plugins[p]._autoCSS))) { //note: elements contain read-only \"x\" and \"y\" properties. We should also prioritize editing css width/height rather than the element's properties.\n\t\t\t\t\t\tcss[p] = vars[p];\n\t\t\t\t\t\tdelete vars[p];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvars.css = css;\n\t\t\t};\n\n\t\tp = TweenLite.prototype = new Animation();\n\t\tp.constructor = TweenLite;\n\t\tp.kill()._gc = false;\n\n//----TweenLite defaults, overwrite management, and root updates ----------------------------------------------------\n\n\t\tp.ratio = 0;\n\t\tp._firstPT = p._targets = p._overwrittenProps = p._startAt = null;\n\t\tp._notifyPluginsOfEnabled = p._lazy = false;\n\n\t\tTweenLite.version = \"1.20.2\";\n\t\tTweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);\n\t\tTweenLite.defaultOverwrite = \"auto\";\n\t\tTweenLite.ticker = _ticker;\n\t\tTweenLite.autoSleep = 120;\n\t\tTweenLite.lagSmoothing = function(threshold, adjustedLag) {\n\t\t\t_ticker.lagSmoothing(threshold, adjustedLag);\n\t\t};\n\n\t\tTweenLite.selector = window.$ || window.jQuery || function(e) {\n\t\t\tvar selector = window.$ || window.jQuery;\n\t\t\tif (selector) {\n\t\t\t\tTweenLite.selector = selector;\n\t\t\t\treturn selector(e);\n\t\t\t}\n\t\t\treturn (typeof(_doc) === \"undefined\") ? e : (_doc.querySelectorAll ? _doc.querySelectorAll(e) : _doc.getElementById((e.charAt(0) === \"#\") ? e.substr(1) : e));\n\t\t};\n\n\t\tvar _lazyTweens = [],\n\t\t\t_lazyLookup = {},\n\t\t\t_numbersExp = /(?:(-|-=|\\+=)?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[0-9]/ig,\n\t\t\t_relExp = /[\\+-]=-?[\\.\\d]/,\n\t\t\t//_nonNumbersExp = /(?:([\\-+](?!(\\d|=)))|[^\\d\\-+=e]|(e(?![\\-+][\\d])))+/ig,\n\t\t\t_setRatio = function(v) {\n\t\t\t\tvar pt = this._firstPT,\n\t\t\t\t\tmin = 0.000001,\n\t\t\t\t\tval;\n\t\t\t\twhile (pt) {\n\t\t\t\t\tval = !pt.blob ? pt.c * v + pt.s : (v === 1 && this.end) ? this.end : v ? this.join(\"\") : this.start;\n\t\t\t\t\tif (pt.m) {\n\t\t\t\t\t\tval = pt.m(val, this._target || pt.t);\n\t\t\t\t\t} else if (val < min) if (val > -min && !pt.blob) { //prevents issues with converting very small numbers to strings in the browser\n\t\t\t\t\t\tval = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (!pt.f) {\n\t\t\t\t\t\tpt.t[pt.p] = val;\n\t\t\t\t\t} else if (pt.fp) {\n\t\t\t\t\t\tpt.t[pt.p](pt.fp, val);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpt.t[pt.p](val);\n\t\t\t\t\t}\n\t\t\t\t\tpt = pt._next;\n\t\t\t\t}\n\t\t\t},\n\t\t\t//compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, \"rgb(0,0,0)\" and \"rgb(100,50,0)\" would become [\"rgb(\", 0, \",\", 50, \",0)\"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a \"start\" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join(\"\")).\n\t\t\t_blobDif = function(start, end, filter, pt) {\n\t\t\t\tvar a = [],\n\t\t\t\t\tcharIndex = 0,\n\t\t\t\t\ts = \"\",\n\t\t\t\t\tcolor = 0,\n\t\t\t\t\tstartNums, endNums, num, i, l, nonNumbers, currentNum;\n\t\t\t\ta.start = start;\n\t\t\t\ta.end = end;\n\t\t\t\tstart = a[0] = start + \"\"; //ensure values are strings\n\t\t\t\tend = a[1] = end + \"\";\n\t\t\t\tif (filter) {\n\t\t\t\t\tfilter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.\n\t\t\t\t\tstart = a[0];\n\t\t\t\t\tend = a[1];\n\t\t\t\t}\n\t\t\t\ta.length = 0;\n\t\t\t\tstartNums = start.match(_numbersExp) || [];\n\t\t\t\tendNums = end.match(_numbersExp) || [];\n\t\t\t\tif (pt) {\n\t\t\t\t\tpt._next = null;\n\t\t\t\t\tpt.blob = 1;\n\t\t\t\t\ta._firstPT = a._applyPT = pt; //apply last in the linked list (which means inserting it first)\n\t\t\t\t}\n\t\t\t\tl = endNums.length;\n\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\tcurrentNum = endNums[i];\n\t\t\t\t\tnonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex);\n\t\t\t\t\ts += (nonNumbers || !i) ? nonNumbers : \",\"; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n\t\t\t\t\tcharIndex += nonNumbers.length;\n\t\t\t\t\tif (color) { //sense rgba() values and round them.\n\t\t\t\t\t\tcolor = (color + 1) % 5;\n\t\t\t\t\t} else if (nonNumbers.substr(-5) === \"rgba(\") {\n\t\t\t\t\t\tcolor = 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (currentNum === startNums[i] || startNums.length <= i) {\n\t\t\t\t\t\ts += currentNum;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (s) {\n\t\t\t\t\t\t\ta.push(s);\n\t\t\t\t\t\t\ts = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnum = parseFloat(startNums[i]);\n\t\t\t\t\t\ta.push(num);\n\t\t\t\t\t\ta._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === \"=\") ? parseInt(currentNum.charAt(0) + \"1\", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, m:(color && color < 4) ? Math.round : 0};\n\t\t\t\t\t\t//note: we don't set _prev because we'll never need to remove individual PropTweens from this list.\n\t\t\t\t\t}\n\t\t\t\t\tcharIndex += currentNum.length;\n\t\t\t\t}\n\t\t\t\ts += end.substr(charIndex);\n\t\t\t\tif (s) {\n\t\t\t\t\ta.push(s);\n\t\t\t\t}\n\t\t\t\ta.setRatio = _setRatio;\n\t\t\t\tif (_relExp.test(end)) { //if the end string contains relative values, delete it so that on the final render (in _setRatio()), we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n\t\t\t\t\ta.end = 0;\n\t\t\t\t}\n\t\t\t\treturn a;\n\t\t\t},\n\t\t\t//note: \"funcParam\" is only necessary for function-based getters/setters that require an extra parameter like getAttribute(\"width\") and setAttribute(\"width\", value). In this example, funcParam would be \"width\". Used by AttrPlugin for example.\n\t\t\t_addPropTween = function(target, prop, start, end, overwriteProp, mod, funcParam, stringFilter, index) {\n\t\t\t\tif (typeof(end) === \"function\") {\n\t\t\t\t\tend = end(index || 0, target);\n\t\t\t\t}\n\t\t\t\tvar type = typeof(target[prop]),\n\t\t\t\t\tgetterName = (type !== \"function\") ? \"\" : ((prop.indexOf(\"set\") || typeof(target[\"get\" + prop.substr(3)]) !== \"function\") ? prop : \"get\" + prop.substr(3)),\n\t\t\t\t\ts = (start !== \"get\") ? start : !getterName ? target[prop] : funcParam ? target[getterName](funcParam) : target[getterName](),\n\t\t\t\t\tisRelative = (typeof(end) === \"string\" && end.charAt(1) === \"=\"),\n\t\t\t\t\tpt = {t:target, p:prop, s:s, f:(type === \"function\"), pg:0, n:overwriteProp || prop, m:(!mod ? 0 : (typeof(mod) === \"function\") ? mod : Math.round), pr:0, c:isRelative ? parseInt(end.charAt(0) + \"1\", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0},\n\t\t\t\t\tblob;\n\n\t\t\t\tif (typeof(s) !== \"number\" || (typeof(end) !== \"number\" && !isRelative)) {\n\t\t\t\t\tif (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === \"boolean\" || typeof(end) === \"boolean\") {\n\t\t\t\t\t\t//a blob (string that has multiple numbers in it)\n\t\t\t\t\t\tpt.fp = funcParam;\n\t\t\t\t\t\tblob = _blobDif(s, (isRelative ? parseFloat(pt.s) + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt);\n\t\t\t\t\t\tpt = {t: blob, p: \"setRatio\", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //\"2\" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example.\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpt.s = parseFloat(s);\n\t\t\t\t\t\tif (!isRelative) {\n\t\t\t\t\t\t\tpt.c = (parseFloat(end) - pt.s) || 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pt.c) { //only add it to the linked list if there's a change.\n\t\t\t\t\tif ((pt._next = this._firstPT)) {\n\t\t\t\t\t\tpt._next._prev = pt;\n\t\t\t\t\t}\n\t\t\t\t\tthis._firstPT = pt;\n\t\t\t\t\treturn pt;\n\t\t\t\t}\n\t\t\t},\n\t\t\t_internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object.\n\t\t\t_plugins = TweenLite._plugins = {},\n\t\t\t_tweenLookup = _internals.tweenLookup = {},\n\t\t\t_tweenLookupNum = 0,\n\t\t\t_reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1, yoyoEase:1},\n\t\t\t_overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, \"true\":1, \"false\":0},\n\t\t\t_rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),\n\t\t\t_rootTimeline = Animation._rootTimeline = new SimpleTimeline(),\n\t\t\t_nextGCFrame = 30,\n\t\t\t_lazyRender = _internals.lazyRender = function() {\n\t\t\t\tvar i = _lazyTweens.length,\n\t\t\t\t\ttween;\n\t\t\t\t_lazyLookup = {};\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\ttween = _lazyTweens[i];\n\t\t\t\t\tif (tween && tween._lazy !== false) {\n\t\t\t\t\t\ttween.render(tween._lazy[0], tween._lazy[1], true);\n\t\t\t\t\t\ttween._lazy = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_lazyTweens.length = 0;\n\t\t\t};\n\n\t\t_rootTimeline._startTime = _ticker.time;\n\t\t_rootFramesTimeline._startTime = _ticker.frame;\n\t\t_rootTimeline._active = _rootFramesTimeline._active = true;\n\t\tsetTimeout(_lazyRender, 1); //on some mobile devices, there isn't a \"tick\" before code runs which means any lazy renders wouldn't run before the next official \"tick\".\n\n\t\tAnimation._updateRoot = TweenLite.render = function() {\n\t\t\t\tvar i, a, p;\n\t\t\t\tif (_lazyTweens.length) { //if code is run outside of the requestAnimationFrame loop, there may be tweens queued AFTER the engine refreshed, so we need to ensure any pending renders occur before we refresh again.\n\t\t\t\t\t_lazyRender();\n\t\t\t\t}\n\t\t\t\t_rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false);\n\t\t\t\t_rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false);\n\t\t\t\tif (_lazyTweens.length) {\n\t\t\t\t\t_lazyRender();\n\t\t\t\t}\n\t\t\t\tif (_ticker.frame >= _nextGCFrame) { //dump garbage every 120 frames or whatever the user sets TweenLite.autoSleep to\n\t\t\t\t\t_nextGCFrame = _ticker.frame + (parseInt(TweenLite.autoSleep, 10) || 120);\n\t\t\t\t\tfor (p in _tweenLookup) {\n\t\t\t\t\t\ta = _tweenLookup[p].tweens;\n\t\t\t\t\t\ti = a.length;\n\t\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\t\tif (a[i]._gc) {\n\t\t\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a.length === 0) {\n\t\t\t\t\t\t\tdelete _tweenLookup[p];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if there are no more tweens in the root timelines, or if they're all paused, make the _timer sleep to reduce load on the CPU slightly\n\t\t\t\t\tp = _rootTimeline._first;\n\t\t\t\t\tif (!p || p._paused) if (TweenLite.autoSleep && !_rootFramesTimeline._first && _ticker._listeners.tick.length === 1) {\n\t\t\t\t\t\twhile (p && p._paused) {\n\t\t\t\t\t\t\tp = p._next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!p) {\n\t\t\t\t\t\t\t_ticker.sleep();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t_ticker.addEventListener(\"tick\", Animation._updateRoot);\n\n\t\tvar _register = function(target, tween, scrub) {\n\t\t\t\tvar id = target._gsTweenID, a, i;\n\t\t\t\tif (!_tweenLookup[id || (target._gsTweenID = id = \"t\" + (_tweenLookupNum++))]) {\n\t\t\t\t\t_tweenLookup[id] = {target:target, tweens:[]};\n\t\t\t\t}\n\t\t\t\tif (tween) {\n\t\t\t\t\ta = _tweenLookup[id].tweens;\n\t\t\t\t\ta[(i = a.length)] = tween;\n\t\t\t\t\tif (scrub) {\n\t\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\t\tif (a[i] === tween) {\n\t\t\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn _tweenLookup[id].tweens;\n\t\t\t},\n\t\t\t_onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) {\n\t\t\t\tvar func = overwrittenTween.vars.onOverwrite, r1, r2;\n\t\t\t\tif (func) {\n\t\t\t\t\tr1 = func(overwrittenTween, overwritingTween, target, killedProps);\n\t\t\t\t}\n\t\t\t\tfunc = TweenLite.onOverwrite;\n\t\t\t\tif (func) {\n\t\t\t\t\tr2 = func(overwrittenTween, overwritingTween, target, killedProps);\n\t\t\t\t}\n\t\t\t\treturn (r1 !== false && r2 !== false);\n\t\t\t},\n\t\t\t_applyOverwrite = function(target, tween, props, mode, siblings) {\n\t\t\t\tvar i, changed, curTween, l;\n\t\t\t\tif (mode === 1 || mode >= 4) {\n\t\t\t\t\tl = siblings.length;\n\t\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\t\tif ((curTween = siblings[i]) !== tween) {\n\t\t\t\t\t\t\tif (!curTween._gc) {\n\t\t\t\t\t\t\t\tif (curTween._kill(null, target, tween)) {\n\t\t\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (mode === 5) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn changed;\n\t\t\t\t}\n\t\t\t\t//NOTE: Add 0.0000000001 to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example)\n\t\t\t\tvar startTime = tween._startTime + _tinyNum,\n\t\t\t\t\toverlaps = [],\n\t\t\t\t\toCount = 0,\n\t\t\t\t\tzeroDur = (tween._duration === 0),\n\t\t\t\t\tglobalStart;\n\t\t\t\ti = siblings.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) {\n\t\t\t\t\t\t//ignore\n\t\t\t\t\t} else if (curTween._timeline !== tween._timeline) {\n\t\t\t\t\t\tglobalStart = globalStart || _checkOverlap(tween, 0, zeroDur);\n\t\t\t\t\t\tif (_checkOverlap(curTween, globalStart, zeroDur) === 0) {\n\t\t\t\t\t\t\toverlaps[oCount++] = curTween;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale > startTime) if (!((zeroDur || !curTween._initted) && startTime - curTween._startTime <= 0.0000000002)) {\n\t\t\t\t\t\toverlaps[oCount++] = curTween;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ti = oCount;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tcurTween = overlaps[i];\n\t\t\t\t\tif (mode === 2) if (curTween._kill(props, target, tween)) {\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (mode !== 2 || (!curTween._firstPT && curTween._initted)) {\n\t\t\t\t\t\tif (mode !== 2 && !_onOverwrite(curTween, tween)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween.\n\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn changed;\n\t\t\t},\n\t\t\t_checkOverlap = function(tween, reference, zeroDur) {\n\t\t\t\tvar tl = tween._timeline,\n\t\t\t\t\tts = tl._timeScale,\n\t\t\t\t\tt = tween._startTime;\n\t\t\t\twhile (tl._timeline) {\n\t\t\t\t\tt += tl._startTime;\n\t\t\t\t\tts *= tl._timeScale;\n\t\t\t\t\tif (tl._paused) {\n\t\t\t\t\t\treturn -100;\n\t\t\t\t\t}\n\t\t\t\t\ttl = tl._timeline;\n\t\t\t\t}\n\t\t\t\tt /= ts;\n\t\t\t\treturn (t > reference) ? t - reference : ((zeroDur && t === reference) || (!tween._initted && t - reference < 2 * _tinyNum)) ? _tinyNum : ((t += tween.totalDuration() / tween._timeScale / ts) > reference + _tinyNum) ? 0 : t - reference - _tinyNum;\n\t\t\t};\n\n\n//---- TweenLite instance methods -----------------------------------------------------------------------------\n\n\t\tp._init = function() {\n\t\t\tvar v = this.vars,\n\t\t\t\top = this._overwrittenProps,\n\t\t\t\tdur = this._duration,\n\t\t\t\timmediate = !!v.immediateRender,\n\t\t\t\tease = v.ease,\n\t\t\t\ti, initPlugins, pt, p, startVars, l;\n\t\t\tif (v.startAt) {\n\t\t\t\tif (this._startAt) {\n\t\t\t\t\tthis._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:\"+=100\"}, {x:\"-=100\"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change.\n\t\t\t\t\tthis._startAt.kill();\n\t\t\t\t}\n\t\t\t\tstartVars = {};\n\t\t\t\tfor (p in v.startAt) { //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, 1, from, to).fromTo(e, 1, to, from);\n\t\t\t\t\tstartVars[p] = v.startAt[p];\n\t\t\t\t}\n\t\t\t\tstartVars.overwrite = false;\n\t\t\t\tstartVars.immediateRender = true;\n\t\t\t\tstartVars.lazy = (immediate && v.lazy !== false);\n\t\t\t\tstartVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop).\n\t\t\t\tstartVars.onUpdate = v.onUpdate;\n\t\t\t\tstartVars.onUpdateScope = v.onUpdateScope || v.callbackScope || this;\n\t\t\t\tthis._startAt = TweenLite.to(this.target, 0, startVars);\n\t\t\t\tif (immediate) {\n\t\t\t\t\tif (this._time > 0) {\n\t\t\t\t\t\tthis._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()).\n\t\t\t\t\t} else if (dur !== 0) {\n\t\t\t\t\t\treturn; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (v.runBackwards && dur !== 0) {\n\t\t\t\t//from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)\n\t\t\t\tif (this._startAt) {\n\t\t\t\t\tthis._startAt.render(-1, true);\n\t\t\t\t\tthis._startAt.kill();\n\t\t\t\t\tthis._startAt = null;\n\t\t\t\t} else {\n\t\t\t\t\tif (this._time !== 0) { //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0\n\t\t\t\t\t\timmediate = false;\n\t\t\t\t\t}\n\t\t\t\t\tpt = {};\n\t\t\t\t\tfor (p in v) { //copy props into a new object and skip any reserved props, otherwise onComplete or onUpdate or onStart could fire. We should, however, permit autoCSS to go through.\n\t\t\t\t\t\tif (!_reservedProps[p] || p === \"autoCSS\") {\n\t\t\t\t\t\t\tpt[p] = v[p];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpt.overwrite = 0;\n\t\t\t\t\tpt.data = \"isFromStart\"; //we tag the tween with as \"isFromStart\" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a \"from()\" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:\"height\", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.\n\t\t\t\t\tpt.lazy = (immediate && v.lazy !== false);\n\t\t\t\t\tpt.immediateRender = immediate; //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)\n\t\t\t\t\tthis._startAt = TweenLite.to(this.target, 0, pt);\n\t\t\t\t\tif (!immediate) {\n\t\t\t\t\t\tthis._startAt._init(); //ensures that the initial values are recorded\n\t\t\t\t\t\tthis._startAt._enabled(false); //no need to have the tween render on the next cycle. Disable it because we'll always manually control the renders of the _startAt tween.\n\t\t\t\t\t\tif (this.vars.immediateRender) {\n\t\t\t\t\t\t\tthis._startAt = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (this._time === 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._ease = ease = (!ease) ? TweenLite.defaultEase : (ease instanceof Ease) ? ease : (typeof(ease) === \"function\") ? new Ease(ease, v.easeParams) : _easeMap[ease] || TweenLite.defaultEase;\n\t\t\tif (v.easeParams instanceof Array && ease.config) {\n\t\t\t\tthis._ease = ease.config.apply(ease, v.easeParams);\n\t\t\t}\n\t\t\tthis._easeType = this._ease._type;\n\t\t\tthis._easePower = this._ease._power;\n\t\t\tthis._firstPT = null;\n\n\t\t\tif (this._targets) {\n\t\t\t\tl = this._targets.length;\n\t\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\t\tif ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (op ? op[i] : null), i) ) {\n\t\t\t\t\t\tinitPlugins = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinitPlugins = this._initProps(this.target, this._propLookup, this._siblings, op, 0);\n\t\t\t}\n\n\t\t\tif (initPlugins) {\n\t\t\t\tTweenLite._onPluginEvent(\"_onInitAllProps\", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite\n\t\t\t}\n\t\t\tif (op) if (!this._firstPT) if (typeof(this.target) !== \"function\") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live.\n\t\t\t\tthis._enabled(false, false);\n\t\t\t}\n\t\t\tif (v.runBackwards) {\n\t\t\t\tpt = this._firstPT;\n\t\t\t\twhile (pt) {\n\t\t\t\t\tpt.s += pt.c;\n\t\t\t\t\tpt.c = -pt.c;\n\t\t\t\t\tpt = pt._next;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._onUpdate = v.onUpdate;\n\t\t\tthis._initted = true;\n\t\t};\n\n\t\tp._initProps = function(target, propLookup, siblings, overwrittenProps, index) {\n\t\t\tvar p, i, initPlugins, plugin, pt, v;\n\t\t\tif (target == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (_lazyLookup[target._gsTweenID]) {\n\t\t\t\t_lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)\n\t\t\t}\n\n\t\t\tif (!this.vars.css) if (target.style) if (target !== window && target.nodeType) if (_plugins.css) if (this.vars.autoCSS !== false) { //it's so common to use TweenLite/Max to animate the css of DOM elements, we assume that if the target is a DOM element, that's what is intended (a convenience so that users don't have to wrap things in css:{}, although we still recommend it for a slight performance boost and better specificity). Note: we cannot check \"nodeType\" on the window inside an iframe.\n\t\t\t\t_autoCSS(this.vars, target);\n\t\t\t}\n\t\t\tfor (p in this.vars) {\n\t\t\t\tv = this.vars[p];\n\t\t\t\tif (_reservedProps[p]) {\n\t\t\t\t\tif (v) if ((v instanceof Array) || (v.push && _isArray(v))) if (v.join(\"\").indexOf(\"{self}\") !== -1) {\n\t\t\t\t\t\tthis.vars[p] = v = this._swapSelfInParams(v, this);\n\t\t\t\t\t}\n\n\t\t\t\t} else if (_plugins[p] && (plugin = new _plugins[p]())._onInitTween(target, this.vars[p], this, index)) {\n\n\t\t\t\t\t//t - target \t\t[object]\n\t\t\t\t\t//p - property \t\t[string]\n\t\t\t\t\t//s - start\t\t\t[number]\n\t\t\t\t\t//c - change\t\t[number]\n\t\t\t\t\t//f - isFunction\t[boolean]\n\t\t\t\t\t//n - name\t\t\t[string]\n\t\t\t\t\t//pg - isPlugin \t[boolean]\n\t\t\t\t\t//pr - priority\t\t[number]\n\t\t\t\t\t//m - mod [function | 0]\n\t\t\t\t\tthis._firstPT = pt = {_next:this._firstPT, t:plugin, p:\"setRatio\", s:0, c:1, f:1, n:p, pg:1, pr:plugin._priority, m:0};\n\t\t\t\t\ti = plugin._overwriteProps.length;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tpropLookup[plugin._overwriteProps[i]] = this._firstPT;\n\t\t\t\t\t}\n\t\t\t\t\tif (plugin._priority || plugin._onInitAllProps) {\n\t\t\t\t\t\tinitPlugins = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (plugin._onDisable || plugin._onEnable) {\n\t\t\t\t\t\tthis._notifyPluginsOfEnabled = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (pt._next) {\n\t\t\t\t\t\tpt._next._prev = pt;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tpropLookup[p] = _addPropTween.call(this, target, p, \"get\", v, p, 0, null, this.vars.stringFilter, index);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (overwrittenProps) if (this._kill(overwrittenProps, target)) { //another tween may have tried to overwrite properties of this tween before init() was called (like if two tweens start at the same time, the one created second will run first)\n\t\t\t\treturn this._initProps(target, propLookup, siblings, overwrittenProps, index);\n\t\t\t}\n\t\t\tif (this._overwrite > 1) if (this._firstPT) if (siblings.length > 1) if (_applyOverwrite(target, this, propLookup, this._overwrite, siblings)) {\n\t\t\t\tthis._kill(propLookup, target);\n\t\t\t\treturn this._initProps(target, propLookup, siblings, overwrittenProps, index);\n\t\t\t}\n\t\t\tif (this._firstPT) if ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration)) { //zero duration tweens don't lazy render by default; everything else does.\n\t\t\t\t_lazyLookup[target._gsTweenID] = true;\n\t\t\t}\n\t\t\treturn initPlugins;\n\t\t};\n\n\t\tp.render = function(time, suppressEvents, force) {\n\t\t\tvar prevTime = this._time,\n\t\t\t\tduration = this._duration,\n\t\t\t\tprevRawPrevTime = this._rawPrevTime,\n\t\t\t\tisComplete, callback, pt, rawPrevTime;\n\t\t\tif (time >= duration - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts.\n\t\t\t\tthis._totalTime = this._time = duration;\n\t\t\t\tthis.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1;\n\t\t\t\tif (!this._reversed ) {\n\t\t\t\t\tisComplete = true;\n\t\t\t\t\tcallback = \"onComplete\";\n\t\t\t\t\tforce = (force || this._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline.\n\t\t\t\t}\n\t\t\t\tif (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the \"playhead\" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's \"playhead\" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.\n\t\t\t\t\tif (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate.\n\t\t\t\t\t\ttime = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (prevRawPrevTime < 0 || (time <= 0 && time >= -0.0000001) || (prevRawPrevTime === _tinyNum && this.data !== \"isPause\")) if (prevRawPrevTime !== time) { //note: when this.data is \"isPause\", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause.\n\t\t\t\t\t\tforce = true;\n\t\t\t\t\t\tif (prevRawPrevTime > _tinyNum) {\n\t\t\t\t\t\t\tcallback = \"onReverseComplete\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.\n\t\t\t\t}\n\n\t\t\t} else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.\n\t\t\t\tthis._totalTime = this._time = 0;\n\t\t\t\tthis.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;\n\t\t\t\tif (prevTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) {\n\t\t\t\t\tcallback = \"onReverseComplete\";\n\t\t\t\t\tisComplete = this._reversed;\n\t\t\t\t}\n\t\t\t\tif (time < 0) {\n\t\t\t\t\tthis._active = false;\n\t\t\t\t\tif (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the \"playhead\" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's \"playhead\" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.\n\t\t\t\t\t\tif (prevRawPrevTime >= 0 && !(prevRawPrevTime === _tinyNum && this.data === \"isPause\")) {\n\t\t\t\t\t\t\tforce = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!this._initted || (this._startAt && this._startAt.progress())) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. Also, we check progress() because if startAt has already rendered at its end, we should force a render at its beginning. Otherwise, if you put the playhead directly on top of where a fromTo({immediateRender:false}) starts, and then move it backwards, the from() won't revert its values.\n\t\t\t\t\tforce = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._totalTime = this._time = time;\n\n\t\t\t\tif (this._easeType) {\n\t\t\t\t\tvar r = time / duration, type = this._easeType, pow = this._easePower;\n\t\t\t\t\tif (type === 1 || (type === 3 && r >= 0.5)) {\n\t\t\t\t\t\tr = 1 - r;\n\t\t\t\t\t}\n\t\t\t\t\tif (type === 3) {\n\t\t\t\t\t\tr *= 2;\n\t\t\t\t\t}\n\t\t\t\t\tif (pow === 1) {\n\t\t\t\t\t\tr *= r;\n\t\t\t\t\t} else if (pow === 2) {\n\t\t\t\t\t\tr *= r * r;\n\t\t\t\t\t} else if (pow === 3) {\n\t\t\t\t\t\tr *= r * r * r;\n\t\t\t\t\t} else if (pow === 4) {\n\t\t\t\t\t\tr *= r * r * r * r;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (type === 1) {\n\t\t\t\t\t\tthis.ratio = 1 - r;\n\t\t\t\t\t} else if (type === 2) {\n\t\t\t\t\t\tthis.ratio = r;\n\t\t\t\t\t} else if (time / duration < 0.5) {\n\t\t\t\t\t\tthis.ratio = r / 2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.ratio = 1 - (r / 2);\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tthis.ratio = this._ease.getRatio(time / duration);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._time === prevTime && !force) {\n\t\t\t\treturn;\n\t\t\t} else if (!this._initted) {\n\t\t\t\tthis._init();\n\t\t\t\tif (!this._initted || this._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example.\n\t\t\t\t\treturn;\n\t\t\t\t} else if (!force && this._firstPT && ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration))) {\n\t\t\t\t\tthis._time = this._totalTime = prevTime;\n\t\t\t\t\tthis._rawPrevTime = prevRawPrevTime;\n\t\t\t\t\t_lazyTweens.push(this);\n\t\t\t\t\tthis._lazy = [time, suppressEvents];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t//_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently.\n\t\t\t\tif (this._time && !isComplete) {\n\t\t\t\t\tthis.ratio = this._ease.getRatio(this._time / duration);\n\t\t\t\t} else if (isComplete && this._ease._calcEnd) {\n\t\t\t\t\tthis.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._lazy !== false) { //in case a lazy render is pending, we should flush it because the new render is occurring now (imagine a lazy tween instantiating and then immediately the user calls tween.seek(tween.duration()), skipping to the end - the end render would be forced, and then if we didn't flush the lazy render, it'd fire AFTER the seek(), rendering it at the wrong time.\n\t\t\t\tthis._lazy = false;\n\t\t\t}\n\t\t\tif (!this._active) if (!this._paused && this._time !== prevTime && time >= 0) {\n\t\t\t\tthis._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done.\n\t\t\t}\n\t\t\tif (prevTime === 0) {\n\t\t\t\tif (this._startAt) {\n\t\t\t\t\tif (time >= 0) {\n\t\t\t\t\t\tthis._startAt.render(time, suppressEvents, force);\n\t\t\t\t\t} else if (!callback) {\n\t\t\t\t\t\tcallback = \"_dummyGS\"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.vars.onStart) if (this._time !== 0 || duration === 0) if (!suppressEvents) {\n\t\t\t\t\tthis._callback(\"onStart\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tpt = this._firstPT;\n\t\t\twhile (pt) {\n\t\t\t\tif (pt.f) {\n\t\t\t\t\tpt.t[pt.p](pt.c * this.ratio + pt.s);\n\t\t\t\t} else {\n\t\t\t\t\tpt.t[pt.p] = pt.c * this.ratio + pt.s;\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\n\t\t\tif (this._onUpdate) {\n\t\t\t\tif (time < 0) if (this._startAt && time !== -0.0001) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values.\n\t\t\t\t\tthis._startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.\n\t\t\t\t}\n\t\t\t\tif (!suppressEvents) if (this._time !== prevTime || isComplete || force) {\n\t\t\t\t\tthis._callback(\"onUpdate\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (callback) if (!this._gc || force) { //check _gc because there's a chance that kill() could be called in an onUpdate\n\t\t\t\tif (time < 0 && this._startAt && !this._onUpdate && time !== -0.0001) { //-0.0001 is a special value that we use when looping back to the beginning of a repeated TimelineMax, in which case we shouldn't render the _startAt values.\n\t\t\t\t\tthis._startAt.render(time, suppressEvents, force);\n\t\t\t\t}\n\t\t\t\tif (isComplete) {\n\t\t\t\t\tif (this._timeline.autoRemoveChildren) {\n\t\t\t\t\t\tthis._enabled(false, false);\n\t\t\t\t\t}\n\t\t\t\t\tthis._active = false;\n\t\t\t\t}\n\t\t\t\tif (!suppressEvents && this.vars[callback]) {\n\t\t\t\t\tthis._callback(callback);\n\t\t\t\t}\n\t\t\t\tif (duration === 0 && this._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the \"time\" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless.\n\t\t\t\t\tthis._rawPrevTime = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tp._kill = function(vars, target, overwritingTween) {\n\t\t\tif (vars === \"all\") {\n\t\t\t\tvars = null;\n\t\t\t}\n\t\t\tif (vars == null) if (target == null || target === this.target) {\n\t\t\t\tthis._lazy = false;\n\t\t\t\treturn this._enabled(false, false);\n\t\t\t}\n\t\t\ttarget = (typeof(target) !== \"string\") ? (target || this._targets || this.target) : TweenLite.selector(target) || target;\n\t\t\tvar simultaneousOverwrite = (overwritingTween && this._time && overwritingTween._startTime === this._startTime && this._timeline === overwritingTween._timeline),\n\t\t\t\ti, overwrittenProps, p, pt, propLookup, changed, killProps, record, killed;\n\t\t\tif ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== \"number\") {\n\t\t\t\ti = target.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (this._kill(vars, target[i], overwritingTween)) {\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._targets) {\n\t\t\t\t\ti = this._targets.length;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tif (target === this._targets[i]) {\n\t\t\t\t\t\t\tpropLookup = this._propLookup[i] || {};\n\t\t\t\t\t\t\tthis._overwrittenProps = this._overwrittenProps || [];\n\t\t\t\t\t\t\toverwrittenProps = this._overwrittenProps[i] = vars ? this._overwrittenProps[i] || {} : \"all\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (target !== this.target) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\tpropLookup = this._propLookup;\n\t\t\t\t\toverwrittenProps = this._overwrittenProps = vars ? this._overwrittenProps || {} : \"all\";\n\t\t\t\t}\n\n\t\t\t\tif (propLookup) {\n\t\t\t\t\tkillProps = vars || propLookup;\n\t\t\t\t\trecord = (vars !== overwrittenProps && overwrittenProps !== \"all\" && vars !== propLookup && (typeof(vars) !== \"object\" || !vars._tempKill)); //_tempKill is a super-secret way to delete a particular tweening property but NOT have it remembered as an official overwritten property (like in BezierPlugin)\n\t\t\t\t\tif (overwritingTween && (TweenLite.onOverwrite || this.vars.onOverwrite)) {\n\t\t\t\t\t\tfor (p in killProps) {\n\t\t\t\t\t\t\tif (propLookup[p]) {\n\t\t\t\t\t\t\t\tif (!killed) {\n\t\t\t\t\t\t\t\t\tkilled = [];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tkilled.push(p);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((killed || !vars) && !_onOverwrite(this, overwritingTween, target, killed)) { //if the onOverwrite returned false, that means the user wants to override the overwriting (cancel it).\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (p in killProps) {\n\t\t\t\t\t\tif ((pt = propLookup[p])) {\n\t\t\t\t\t\t\tif (simultaneousOverwrite) { //if another tween overwrites this one and they both start at exactly the same time, yet this tween has already rendered once (for example, at 0.001) because it's first in the queue, we should revert the values to where they were at 0 so that the starting values aren't contaminated on the overwriting tween.\n\t\t\t\t\t\t\t\tif (pt.f) {\n\t\t\t\t\t\t\t\t\tpt.t[pt.p](pt.s);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tpt.t[pt.p] = pt.s;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (pt.pg && pt.t._kill(killProps)) {\n\t\t\t\t\t\t\t\tchanged = true; //some plugins need to be notified so they can perform cleanup tasks first\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!pt.pg || pt.t._overwriteProps.length === 0) {\n\t\t\t\t\t\t\t\tif (pt._prev) {\n\t\t\t\t\t\t\t\t\tpt._prev._next = pt._next;\n\t\t\t\t\t\t\t\t} else if (pt === this._firstPT) {\n\t\t\t\t\t\t\t\t\tthis._firstPT = pt._next;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (pt._next) {\n\t\t\t\t\t\t\t\t\tpt._next._prev = pt._prev;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpt._next = pt._prev = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdelete propLookup[p];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (record) {\n\t\t\t\t\t\t\toverwrittenProps[p] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!this._firstPT && this._initted) { //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.\n\t\t\t\t\t\tthis._enabled(false, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn changed;\n\t\t};\n\n\t\tp.invalidate = function() {\n\t\t\tif (this._notifyPluginsOfEnabled) {\n\t\t\t\tTweenLite._onPluginEvent(\"_onDisable\", this);\n\t\t\t}\n\t\t\tthis._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null;\n\t\t\tthis._notifyPluginsOfEnabled = this._active = this._lazy = false;\n\t\t\tthis._propLookup = (this._targets) ? {} : [];\n\t\t\tAnimation.prototype.invalidate.call(this);\n\t\t\tif (this.vars.immediateRender) {\n\t\t\t\tthis._time = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\t\t\t\tthis.render(Math.min(0, -this._delay)); //in case delay is negative.\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\tp._enabled = function(enabled, ignoreTimeline) {\n\t\t\tif (!_tickerActive) {\n\t\t\t\t_ticker.wake();\n\t\t\t}\n\t\t\tif (enabled && this._gc) {\n\t\t\t\tvar targets = this._targets,\n\t\t\t\t\ti;\n\t\t\t\tif (targets) {\n\t\t\t\t\ti = targets.length;\n\t\t\t\t\twhile (--i > -1) {\n\t\t\t\t\t\tthis._siblings[i] = _register(targets[i], this, true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._siblings = _register(this.target, this, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tAnimation.prototype._enabled.call(this, enabled, ignoreTimeline);\n\t\t\tif (this._notifyPluginsOfEnabled) if (this._firstPT) {\n\t\t\t\treturn TweenLite._onPluginEvent((enabled ? \"_onEnable\" : \"_onDisable\"), this);\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\n//----TweenLite static methods -----------------------------------------------------\n\n\t\tTweenLite.to = function(target, duration, vars) {\n\t\t\treturn new TweenLite(target, duration, vars);\n\t\t};\n\n\t\tTweenLite.from = function(target, duration, vars) {\n\t\t\tvars.runBackwards = true;\n\t\t\tvars.immediateRender = (vars.immediateRender != false);\n\t\t\treturn new TweenLite(target, duration, vars);\n\t\t};\n\n\t\tTweenLite.fromTo = function(target, duration, fromVars, toVars) {\n\t\t\ttoVars.startAt = fromVars;\n\t\t\ttoVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);\n\t\t\treturn new TweenLite(target, duration, toVars);\n\t\t};\n\n\t\tTweenLite.delayedCall = function(delay, callback, params, scope, useFrames) {\n\t\t\treturn new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, lazy:false, useFrames:useFrames, overwrite:0});\n\t\t};\n\n\t\tTweenLite.set = function(target, vars) {\n\t\t\treturn new TweenLite(target, 0, vars);\n\t\t};\n\n\t\tTweenLite.getTweensOf = function(target, onlyActive) {\n\t\t\tif (target == null) { return []; }\n\t\t\ttarget = (typeof(target) !== \"string\") ? target : TweenLite.selector(target) || target;\n\t\t\tvar i, a, j, t;\n\t\t\tif ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== \"number\") {\n\t\t\t\ti = target.length;\n\t\t\t\ta = [];\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\ta = a.concat(TweenLite.getTweensOf(target[i], onlyActive));\n\t\t\t\t}\n\t\t\t\ti = a.length;\n\t\t\t\t//now get rid of any duplicates (tweens of arrays of objects could cause duplicates)\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tt = a[i];\n\t\t\t\t\tj = i;\n\t\t\t\t\twhile (--j > -1) {\n\t\t\t\t\t\tif (t === a[j]) {\n\t\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (target._gsTweenID) {\n\t\t\t\ta = _register(target).concat();\n\t\t\t\ti = a.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (a[i]._gc || (onlyActive && !a[i].isActive())) {\n\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a || [];\n\t\t};\n\n\t\tTweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) {\n\t\t\tif (typeof(onlyActive) === \"object\") {\n\t\t\t\tvars = onlyActive; //for backwards compatibility (before \"onlyActive\" parameter was inserted)\n\t\t\t\tonlyActive = false;\n\t\t\t}\n\t\t\tvar a = TweenLite.getTweensOf(target, onlyActive),\n\t\t\t\ti = a.length;\n\t\t\twhile (--i > -1) {\n\t\t\t\ta[i]._kill(vars, target);\n\t\t\t}\n\t\t};\n\n\n\n/*\n * ----------------------------------------------------------------\n * TweenPlugin (could easily be split out as a separate file/class, but included for ease of use (so that people don't need to include another script call before loading plugins which is easy to forget)\n * ----------------------------------------------------------------\n */\n\t\tvar TweenPlugin = _class(\"plugins.TweenPlugin\", function(props, priority) {\n\t\t\t\t\tthis._overwriteProps = (props || \"\").split(\",\");\n\t\t\t\t\tthis._propName = this._overwriteProps[0];\n\t\t\t\t\tthis._priority = priority || 0;\n\t\t\t\t\tthis._super = TweenPlugin.prototype;\n\t\t\t\t}, true);\n\n\t\tp = TweenPlugin.prototype;\n\t\tTweenPlugin.version = \"1.19.0\";\n\t\tTweenPlugin.API = 2;\n\t\tp._firstPT = null;\n\t\tp._addTween = _addPropTween;\n\t\tp.setRatio = _setRatio;\n\n\t\tp._kill = function(lookup) {\n\t\t\tvar a = this._overwriteProps,\n\t\t\t\tpt = this._firstPT,\n\t\t\t\ti;\n\t\t\tif (lookup[this._propName] != null) {\n\t\t\t\tthis._overwriteProps = [];\n\t\t\t} else {\n\t\t\t\ti = a.length;\n\t\t\t\twhile (--i > -1) {\n\t\t\t\t\tif (lookup[a[i]] != null) {\n\t\t\t\t\t\ta.splice(i, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (pt) {\n\t\t\t\tif (lookup[pt.n] != null) {\n\t\t\t\t\tif (pt._next) {\n\t\t\t\t\t\tpt._next._prev = pt._prev;\n\t\t\t\t\t}\n\t\t\t\t\tif (pt._prev) {\n\t\t\t\t\t\tpt._prev._next = pt._next;\n\t\t\t\t\t\tpt._prev = null;\n\t\t\t\t\t} else if (this._firstPT === pt) {\n\t\t\t\t\t\tthis._firstPT = pt._next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tp._mod = p._roundProps = function(lookup) {\n\t\t\tvar pt = this._firstPT,\n\t\t\t\tval;\n\t\t\twhile (pt) {\n\t\t\t\tval = lookup[this._propName] || (pt.n != null && lookup[ pt.n.split(this._propName + \"_\").join(\"\") ]);\n\t\t\t\tif (val && typeof(val) === \"function\") { //some properties that are very plugin-specific add a prefix named after the _propName plus an underscore, so we need to ignore that extra stuff here.\n\t\t\t\t\tif (pt.f === 2) {\n\t\t\t\t\t\tpt.t._applyPT.m = val;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpt.m = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\t\t};\n\n\t\tTweenLite._onPluginEvent = function(type, tween) {\n\t\t\tvar pt = tween._firstPT,\n\t\t\t\tchanged, pt2, first, last, next;\n\t\t\tif (type === \"_onInitAllProps\") {\n\t\t\t\t//sorts the PropTween linked list in order of priority because some plugins need to render earlier/later than others, like MotionBlurPlugin applies its effects after all x/y/alpha tweens have rendered on each frame.\n\t\t\t\twhile (pt) {\n\t\t\t\t\tnext = pt._next;\n\t\t\t\t\tpt2 = first;\n\t\t\t\t\twhile (pt2 && pt2.pr > pt.pr) {\n\t\t\t\t\t\tpt2 = pt2._next;\n\t\t\t\t\t}\n\t\t\t\t\tif ((pt._prev = pt2 ? pt2._prev : last)) {\n\t\t\t\t\t\tpt._prev._next = pt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfirst = pt;\n\t\t\t\t\t}\n\t\t\t\t\tif ((pt._next = pt2)) {\n\t\t\t\t\t\tpt2._prev = pt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlast = pt;\n\t\t\t\t\t}\n\t\t\t\t\tpt = next;\n\t\t\t\t}\n\t\t\t\tpt = tween._firstPT = first;\n\t\t\t}\n\t\t\twhile (pt) {\n\t\t\t\tif (pt.pg) if (typeof(pt.t[type]) === \"function\") if (pt.t[type]()) {\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t\tpt = pt._next;\n\t\t\t}\n\t\t\treturn changed;\n\t\t};\n\n\t\tTweenPlugin.activate = function(plugins) {\n\t\t\tvar i = plugins.length;\n\t\t\twhile (--i > -1) {\n\t\t\t\tif (plugins[i].API === TweenPlugin.API) {\n\t\t\t\t\t_plugins[(new plugins[i]())._propName] = plugins[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\t//provides a more concise way to define plugins that have no dependencies besides TweenPlugin and TweenLite, wrapping common boilerplate stuff into one function (added in 1.9.0). You don't NEED to use this to define a plugin - the old way still works and can be useful in certain (rare) situations.\n\t\t_gsDefine.plugin = function(config) {\n\t\t\tif (!config || !config.propName || !config.init || !config.API) { throw \"illegal plugin definition.\"; }\n\t\t\tvar propName = config.propName,\n\t\t\t\tpriority = config.priority || 0,\n\t\t\t\toverwriteProps = config.overwriteProps,\n\t\t\t\tmap = {init:\"_onInitTween\", set:\"setRatio\", kill:\"_kill\", round:\"_mod\", mod:\"_mod\", initAll:\"_onInitAllProps\"},\n\t\t\t\tPlugin = _class(\"plugins.\" + propName.charAt(0).toUpperCase() + propName.substr(1) + \"Plugin\",\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tTweenPlugin.call(this, propName, priority);\n\t\t\t\t\t\tthis._overwriteProps = overwriteProps || [];\n\t\t\t\t\t}, (config.global === true)),\n\t\t\t\tp = Plugin.prototype = new TweenPlugin(propName),\n\t\t\t\tprop;\n\t\t\tp.constructor = Plugin;\n\t\t\tPlugin.API = config.API;\n\t\t\tfor (prop in map) {\n\t\t\t\tif (typeof(config[prop]) === \"function\") {\n\t\t\t\t\tp[map[prop]] = config[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t\tPlugin.version = config.version;\n\t\t\tTweenPlugin.activate([Plugin]);\n\t\t\treturn Plugin;\n\t\t};\n\n\n\t\t//now run through all the dependencies discovered and if any are missing, log that to the console as a warning. This is why it's best to have TweenLite load last - it can check all the dependencies for you.\n\t\ta = window._gsQueue;\n\t\tif (a) {\n\t\t\tfor (i = 0; i < a.length; i++) {\n\t\t\t\ta[i]();\n\t\t\t}\n\t\t\tfor (p in _defLookup) {\n\t\t\t\tif (!_defLookup[p].func) {\n\t\t\t\t\twindow.console.log(\"GSAP encountered missing dependency: \" + p);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated\n\n})((typeof(module) !== \"undefined\" && module.exports && typeof(global) !== \"undefined\") ? global : this || window, \"TweenMax\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/gsap/TweenMax.js\n// module id = 140\n// module chunks = 0","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_Uint8Array.js\n// module id = 141\n// module chunks = 0","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_WeakMap.js\n// module id = 142\n// module chunks = 0","/**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\nfunction arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = arrayEvery;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayEvery.js\n// module id = 143\n// module chunks = 0","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayLikeKeys.js\n// module id = 144\n// module chunks = 0","var baseRandom = require('./_baseRandom');\n\n/**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\nfunction arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n}\n\nmodule.exports = arraySample;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arraySample.js\n// module id = 145\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_assignMergeValue.js\n// module id = 146\n// module chunks = 0","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAssign.js\n// module id = 147\n// module chunks = 0","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\nfunction baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n}\n\nmodule.exports = baseDelay;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseDelay.js\n// module id = 148\n// module chunks = 0","var baseForOwnRight = require('./_baseForOwnRight'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEachRight = createBaseEach(baseForOwnRight, true);\n\nmodule.exports = baseEachRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseEachRight.js\n// module id = 149\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseFilter.js\n// module id = 150\n// module chunks = 0","/**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\nfunction baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n}\n\nmodule.exports = baseFindKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseFindKey.js\n// module id = 151\n// module chunks = 0","var createBaseFor = require('./_createBaseFor');\n\n/**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseForRight = createBaseFor(true);\n\nmodule.exports = baseForRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseForRight.js\n// module id = 152\n// module chunks = 0","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseGetAllKeys.js\n// module id = 153\n// module chunks = 0","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIndexOf.js\n// module id = 154\n// module chunks = 0","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsEqual.js\n// module id = 155\n// module chunks = 0","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseKeys.js\n// module id = 156\n// module chunks = 0","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMap.js\n// module id = 157\n// module chunks = 0","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMatches.js\n// module id = 158\n// module chunks = 0","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMatchesProperty.js\n// module id = 159\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseOrderBy.js\n// module id = 160\n// module chunks = 0","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_basePickBy.js\n// module id = 161\n// module chunks = 0","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseProperty.js\n// module id = 162\n// module chunks = 0","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseReduce.js\n// module id = 163\n// module chunks = 0","var identity = require('./identity'),\n metaMap = require('./_metaMap');\n\n/**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n};\n\nmodule.exports = baseSetData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSetData.js\n// module id = 164\n// module chunks = 0","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSlice.js\n// module id = 165\n// module chunks = 0","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseTimes.js\n// module id = 166\n// module chunks = 0","var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseUnset.js\n// module id = 167\n// module chunks = 0","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet');\n\n/**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n}\n\nmodule.exports = baseUpdate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseUpdate.js\n// module id = 168\n// module chunks = 0","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseValues.js\n// module id = 169\n// module chunks = 0","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneBuffer.js\n// module id = 170\n// module chunks = 0","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneTypedArray.js\n// module id = 171\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n}\n\nmodule.exports = composeArgs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_composeArgs.js\n// module id = 172\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\nfunction composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n}\n\nmodule.exports = composeArgsRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_composeArgsRight.js\n// module id = 173\n// module chunks = 0","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createBaseEach.js\n// module id = 174\n// module chunks = 0","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createBaseFor.js\n// module id = 175\n// module chunks = 0","var baseIteratee = require('./_baseIteratee'),\n isArrayLike = require('./isArrayLike'),\n keys = require('./keys');\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nmodule.exports = createFind;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createFind.js\n// module id = 176\n// module chunks = 0","var LodashWrapper = require('./_LodashWrapper'),\n flatRest = require('./_flatRest'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n isArray = require('./isArray'),\n isLaziable = require('./_isLaziable');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\nfunction createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n}\n\nmodule.exports = createFlow;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createFlow.js\n// module id = 177\n// module chunks = 0","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n countHolders = require('./_countHolders'),\n createCtor = require('./_createCtor'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n reorder = require('./_reorder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_ARY_FLAG = 128,\n WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n}\n\nmodule.exports = createHybrid;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createHybrid.js\n// module id = 178\n// module chunks = 0","var baseInverter = require('./_baseInverter');\n\n/**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\nfunction createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n}\n\nmodule.exports = createInverter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createInverter.js\n// module id = 179\n// module chunks = 0","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createRange.js\n// module id = 180\n// module chunks = 0","var isLaziable = require('./_isLaziable'),\n setData = require('./_setData'),\n setWrapToString = require('./_setWrapToString');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n}\n\nmodule.exports = createRecurry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createRecurry.js\n// module id = 181\n// module chunks = 0","var baseToPairs = require('./_baseToPairs'),\n getTag = require('./_getTag'),\n mapToArray = require('./_mapToArray'),\n setToPairs = require('./_setToPairs');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\nfunction createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n}\n\nmodule.exports = createToPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createToPairs.js\n// module id = 182\n// module chunks = 0","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_defineProperty.js\n// module id = 183\n// module chunks = 0","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_equalArrays.js\n// module id = 184\n// module chunks = 0","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_freeGlobal.js\n// module id = 185\n// module chunks = 0","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getAllKeys.js\n// module id = 186\n// module chunks = 0","var realNames = require('./_realNames');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nfunction getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n}\n\nmodule.exports = getFuncName;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getFuncName.js\n// module id = 187\n// module chunks = 0","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getSymbolsIn.js\n// module id = 188\n// module chunks = 0","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hasPath.js\n// module id = 189\n// module chunks = 0","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_initCloneObject.js\n// module id = 190\n// module chunks = 0","var LazyWrapper = require('./_LazyWrapper'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n lodash = require('./wrapperLodash');\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n}\n\nmodule.exports = isLaziable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isLaziable.js\n// module id = 191\n// module chunks = 0","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isStrictComparable.js\n// module id = 192\n// module chunks = 0","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_matchesStrictComparable.js\n// module id = 193\n// module chunks = 0","var WeakMap = require('./_WeakMap');\n\n/** Used to store function metadata. */\nvar metaMap = WeakMap && new WeakMap;\n\nmodule.exports = metaMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_metaMap.js\n// module id = 194\n// module chunks = 0","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_overArg.js\n// module id = 195\n// module chunks = 0","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_overRest.js\n// module id = 196\n// module chunks = 0","var baseGet = require('./_baseGet'),\n baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_parent.js\n// module id = 197\n// module chunks = 0","var baseSetData = require('./_baseSetData'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\nvar setData = shortOut(baseSetData);\n\nmodule.exports = setData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setData.js\n// module id = 198\n// module chunks = 0","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setToArray.js\n// module id = 199\n// module chunks = 0","var getWrapDetails = require('./_getWrapDetails'),\n insertWrapDetails = require('./_insertWrapDetails'),\n setToString = require('./_setToString'),\n updateWrapDetails = require('./_updateWrapDetails');\n\n/**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\nfunction setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n}\n\nmodule.exports = setWrapToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setWrapToString.js\n// module id = 200\n// module chunks = 0","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_shortOut.js\n// module id = 201\n// module chunks = 0","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stringToPath.js\n// module id = 202\n// module chunks = 0","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_toSource.js\n// module id = 203\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_ARY_FLAG = 128;\n\n/**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\nfunction ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n}\n\nmodule.exports = ary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/ary.js\n// module id = 204\n// module chunks = 0","var copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nmodule.exports = assignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assignIn.js\n// module id = 205\n// module chunks = 0","var toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\nfunction before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n}\n\nmodule.exports = before;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/before.js\n// module id = 206\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\nvar bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n});\n\n// Assign default placeholders.\nbind.placeholder = {};\n\nmodule.exports = bind;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/bind.js\n// module id = 207\n// module chunks = 0","module.exports = {\n 'countBy': require('./countBy'),\n 'each': require('./each'),\n 'eachRight': require('./eachRight'),\n 'every': require('./every'),\n 'filter': require('./filter'),\n 'find': require('./find'),\n 'findLast': require('./findLast'),\n 'flatMap': require('./flatMap'),\n 'flatMapDeep': require('./flatMapDeep'),\n 'flatMapDepth': require('./flatMapDepth'),\n 'forEach': require('./forEach'),\n 'forEachRight': require('./forEachRight'),\n 'groupBy': require('./groupBy'),\n 'includes': require('./includes'),\n 'invokeMap': require('./invokeMap'),\n 'keyBy': require('./keyBy'),\n 'map': require('./map'),\n 'orderBy': require('./orderBy'),\n 'partition': require('./partition'),\n 'reduce': require('./reduce'),\n 'reduceRight': require('./reduceRight'),\n 'reject': require('./reject'),\n 'sample': require('./sample'),\n 'sampleSize': require('./sampleSize'),\n 'shuffle': require('./shuffle'),\n 'size': require('./size'),\n 'some': require('./some'),\n 'sortBy': require('./sortBy')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/collection.js\n// module id = 208\n// module chunks = 0","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/debounce.js\n// module id = 209\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n baseEach = require('./_baseEach'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forEach.js\n// module id = 210\n// module chunks = 0","var arrayEachRight = require('./_arrayEachRight'),\n baseEachRight = require('./_baseEachRight'),\n castFunction = require('./_castFunction'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\nfunction forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEachRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forEachRight.js\n// module id = 211\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isString.js\n// module id = 212\n// module chunks = 0","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/last.js\n// module id = 213\n// module chunks = 0","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/memoize.js\n// module id = 214\n// module chunks = 0","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nmodule.exports = mergeWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mergeWith.js\n// module id = 215\n// module chunks = 0","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/noop.js\n// module id = 216\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\nvar partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartial.placeholder = {};\n\nmodule.exports = partial;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/partial.js\n// module id = 217\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n basePickBy = require('./_basePickBy'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nmodule.exports = pickBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/pickBy.js\n// module id = 218\n// module chunks = 0","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/property.js\n// module id = 219\n// module chunks = 0","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubFalse.js\n// module id = 220\n// module chunks = 0","var createToPairs = require('./_createToPairs'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\nvar toPairs = createToPairs(keys);\n\nmodule.exports = toPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPairs.js\n// module id = 221\n// module chunks = 0","var createToPairs = require('./_createToPairs'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\nvar toPairsIn = createToPairs(keysIn);\n\nmodule.exports = toPairsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPairsIn.js\n// module id = 222\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MiniSignalBinding = (function () {\n function MiniSignalBinding(fn, once, thisArg) {\n if (once === undefined) once = false;\n\n _classCallCheck(this, MiniSignalBinding);\n\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n\n _createClass(MiniSignalBinding, [{\n key: 'detach',\n value: function detach() {\n if (this._owner === null) return false;\n this._owner.detach(this);\n return true;\n }\n }]);\n\n return MiniSignalBinding;\n})();\n\nfunction _addMiniSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n } else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n\n node._owner = self;\n\n return node;\n}\n\nvar MiniSignal = (function () {\n function MiniSignal() {\n _classCallCheck(this, MiniSignal);\n\n this._head = this._tail = undefined;\n }\n\n _createClass(MiniSignal, [{\n key: 'handlers',\n value: function handlers() {\n var exists = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];\n\n var node = this._head;\n\n if (exists) return !!node;\n\n var ee = [];\n\n while (node) {\n ee.push(node);\n node = node._next;\n }\n\n return ee;\n }\n }, {\n key: 'has',\n value: function has(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a MiniSignalBinding object.');\n }\n\n return node._owner === this;\n }\n }, {\n key: 'dispatch',\n value: function dispatch() {\n var node = this._head;\n\n if (!node) return false;\n\n while (node) {\n if (node._once) this.detach(node);\n node._fn.apply(node._thisArg, arguments);\n node = node._next;\n }\n\n return true;\n }\n }, {\n key: 'add',\n value: function add(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, false, thisArg));\n }\n }, {\n key: 'once',\n value: function once(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, true, thisArg));\n }\n }, {\n key: 'detach',\n value: function detach(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a MiniSignalBinding object.');\n }\n if (node._owner !== this) return this;\n\n if (node._prev) node._prev._next = node._next;\n if (node._next) node._next._prev = node._prev;\n\n if (node === this._head) {\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n } else if (node === this._tail) {\n this._tail = node._prev;\n this._tail._next = null;\n }\n\n node._owner = null;\n return this;\n }\n }, {\n key: 'detachAll',\n value: function detachAll() {\n var node = this._head;\n if (!node) return this;\n\n this._head = this._tail = null;\n\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n }\n }]);\n\n return MiniSignal;\n})();\n\nMiniSignal.MiniSignalBinding = MiniSignalBinding;\n\nexports['default'] = MiniSignal;\nmodule.exports = exports['default'];\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/mini-signals/lib/mini-signals.js\n// module id = 223\n// module chunks = 0","'use strict'\n\nmodule.exports = function parseURI (str, opts) {\n opts = opts || {}\n\n var o = {\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n }\n\n var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str)\n var uri = {}\n var i = 14\n\n while (i--) uri[o.key[i]] = m[i] || ''\n\n uri[o.q.name] = {}\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) uri[o.q.name][$1] = $2\n })\n\n return uri\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-uri/index.js\n// module id = 224\n// module chunks = 0","\n/**\n * Helper class to create a WebGL Texture\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param width {number} the width of the texture\n * @param height {number} the height of the texture\n * @param format {number} the pixel format of the texture. defaults to gl.RGBA\n * @param type {number} the gl type of the texture. defaults to gl.UNSIGNED_BYTE\n */\nvar Texture = function(gl, width, height, format, type)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\n\t/**\n\t * The WebGL texture\n\t *\n\t * @member {WebGLTexture}\n\t */\n\tthis.texture = gl.createTexture();\n\n\t/**\n\t * If mipmapping was used for this texture, enable and disable with enableMipmap()\n\t *\n\t * @member {Boolean}\n\t */\n\t// some settings..\n\tthis.mipmap = false;\n\n\n\t/**\n\t * Set to true to enable pre-multiplied alpha\n\t *\n\t * @member {Boolean}\n\t */\n\tthis.premultiplyAlpha = false;\n\n\t/**\n\t * The width of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.width = width || -1;\n\t/**\n\t * The height of texture\n\t *\n\t * @member {Number}\n\t */\n\tthis.height = height || -1;\n\n\t/**\n\t * The pixel format of the texture. defaults to gl.RGBA\n\t *\n\t * @member {Number}\n\t */\n\tthis.format = format || gl.RGBA;\n\n\t/**\n\t * The gl type of the texture. defaults to gl.UNSIGNED_BYTE\n\t *\n\t * @member {Number}\n\t */\n\tthis.type = type || gl.UNSIGNED_BYTE;\n\n\n};\n\n/**\n * Uploads this texture to the GPU\n * @param source {HTMLImageElement|ImageData|HTMLVideoElement} the source image of the texture\n */\nTexture.prototype.upload = function(source)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\tvar newWidth = source.videoWidth || source.width;\n\tvar newHeight = source.videoHeight || source.height;\n\n\tif(newHeight !== this.height || newWidth !== this.width)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);\n\t}\n\telse\n\t{\n \tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);\n\t}\n\n\t// if the source is a video, we need to use the videoWidth / videoHeight properties as width / height will be incorrect.\n\tthis.width = newWidth;\n\tthis.height = newHeight;\n\n};\n\nvar FLOATING_POINT_AVAILABLE = false;\n\n/**\n * Use a data source and uploads this texture to the GPU\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.prototype.uploadData = function(data, width, height)\n{\n\tthis.bind();\n\n\tvar gl = this.gl;\n\n\n\tif(data instanceof Float32Array)\n\t{\n\t\tif(!FLOATING_POINT_AVAILABLE)\n\t\t{\n\t\t\tvar ext = gl.getExtension(\"OES_texture_float\");\n\n\t\t\tif(ext)\n\t\t\t{\n\t\t\t\tFLOATING_POINT_AVAILABLE = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Error('floating point textures not available');\n\t\t\t}\n\t\t}\n\n\t\tthis.type = gl.FLOAT;\n\t}\n\telse\n\t{\n\t\t// TODO support for other types\n\t\tthis.type = this.type || gl.UNSIGNED_BYTE;\n\t}\n\n\t// what type of data?\n\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);\n\n\n\tif(width !== this.width || height !== this.height)\n\t{\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, this.type, data || null);\n\t}\n\telse\n\t{\n\t\tgl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, this.format, this.type, data || null);\n\t}\n\n\tthis.width = width;\n\tthis.height = height;\n\n\n//\ttexSubImage2D\n};\n\n/**\n * Binds the texture\n * @param location\n */\nTexture.prototype.bind = function(location)\n{\n\tvar gl = this.gl;\n\n\tif(location !== undefined)\n\t{\n\t\tgl.activeTexture(gl.TEXTURE0 + location);\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n};\n\n/**\n * Unbinds the texture\n */\nTexture.prototype.unbind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindTexture(gl.TEXTURE_2D, null);\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.minFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tif(this.mipmap)\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n\t}\n\telse\n\t{\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n\t}\n};\n\n/**\n * @param linear {Boolean} if we want to use linear filtering or nearest neighbour interpolation\n */\nTexture.prototype.magFilter = function( linear )\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, linear ? gl.LINEAR : gl.NEAREST);\n};\n\n/**\n * Enables mipmapping\n */\nTexture.prototype.enableMipmap = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tthis.mipmap = true;\n\n\tgl.generateMipmap(gl.TEXTURE_2D);\n};\n\n/**\n * Enables linear filtering\n */\nTexture.prototype.enableLinearScaling = function()\n{\n\tthis.minFilter(true);\n\tthis.magFilter(true);\n};\n\n/**\n * Enables nearest neighbour interpolation\n */\nTexture.prototype.enableNearestScaling = function()\n{\n\tthis.minFilter(false);\n\tthis.magFilter(false);\n};\n\n/**\n * Enables clamping on the texture so WebGL will not repeat it\n */\nTexture.prototype.enableWrapClamp = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n};\n\n/**\n * Enable tiling on the texture\n */\nTexture.prototype.enableWrapRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n};\n\nTexture.prototype.enableWrapMirrorRepeat = function()\n{\n\tvar gl = this.gl;\n\n\tthis.bind();\n\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT);\n};\n\n\n/**\n * Destroys this texture\n */\nTexture.prototype.destroy = function()\n{\n\tvar gl = this.gl;\n\t//TODO\n\tgl.deleteTexture(this.texture);\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param source {HTMLImageElement|ImageData} the source image of the texture\n * @param premultiplyAlpha {Boolean} If we want to use pre-multiplied alpha\n */\nTexture.fromSource = function(gl, source, premultiplyAlpha)\n{\n\tvar texture = new Texture(gl);\n\ttexture.premultiplyAlpha = premultiplyAlpha || false;\n\ttexture.upload(source);\n\n\treturn texture;\n};\n\n/**\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param data {TypedArray} the data to upload to the texture\n * @param width {number} the new width of the texture\n * @param height {number} the new height of the texture\n */\nTexture.fromData = function(gl, data, width, height)\n{\n\t//console.log(data, width, height);\n\tvar texture = new Texture(gl);\n\ttexture.uploadData(data, width, height);\n\n\treturn texture;\n};\n\n\nmodule.exports = Texture;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLTexture.js\n// module id = 225\n// module chunks = 0","// var GL_MAP = {};\n\n/**\n * @param gl {WebGLRenderingContext} The current WebGL context\n * @param attribs {*}\n * @param state {*}\n */\nvar setVertexAttribArrays = function (gl, attribs, state)\n{\n var i;\n if(state)\n {\n var tempAttribState = state.tempAttribState,\n attribState = state.attribState;\n\n for (i = 0; i < tempAttribState.length; i++)\n {\n tempAttribState[i] = false;\n }\n\n // set the new attribs\n for (i = 0; i < attribs.length; i++)\n {\n tempAttribState[attribs[i].attribute.location] = true;\n }\n\n for (i = 0; i < attribState.length; i++)\n {\n if (attribState[i] !== tempAttribState[i])\n {\n attribState[i] = tempAttribState[i];\n\n if (state.attribState[i])\n {\n gl.enableVertexAttribArray(i);\n }\n else\n {\n gl.disableVertexAttribArray(i);\n }\n }\n }\n\n }\n else\n {\n for (i = 0; i < attribs.length; i++)\n {\n var attrib = attribs[i];\n gl.enableVertexAttribArray(attrib.attribute.location);\n }\n }\n};\n\nmodule.exports = setVertexAttribArrays;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/setVertexAttribArrays.js\n// module id = 226\n// module chunks = 0","\n/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @param attributeLocations {Object} An attribute location map that lets you manually set the attribute locations\n * @return {WebGLProgram} the shader program\n */\nvar compileProgram = function(gl, vertexSrc, fragmentSrc, attributeLocations)\n{\n var glVertShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);\n var glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);\n\n var program = gl.createProgram();\n\n gl.attachShader(program, glVertShader);\n gl.attachShader(program, glFragShader);\n\n // optionally, set the attributes manually for the program rather than letting WebGL decide..\n if(attributeLocations)\n {\n for(var i in attributeLocations)\n {\n gl.bindAttribLocation(program, attributeLocations[i], i);\n }\n }\n\n\n gl.linkProgram(program);\n\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS))\n {\n console.error('Pixi.js Error: Could not initialize shader.');\n console.error('gl.VALIDATE_STATUS', gl.getProgramParameter(program, gl.VALIDATE_STATUS));\n console.error('gl.getError()', gl.getError());\n\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '')\n {\n console.warn('Pixi.js Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n\n gl.deleteProgram(program);\n program = null;\n }\n\n // clean up some shaders\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n\n return program;\n};\n\n/**\n * @private\n * @param gl {WebGLRenderingContext} The current WebGL context {WebGLProgram}\n * @param type {Number} the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @return {WebGLShader} the shader\n */\nvar compileShader = function (gl, type, src)\n{\n var shader = gl.createShader(type);\n\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n {\n console.log(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n};\n\nmodule.exports = compileProgram;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/compileProgram.js\n// module id = 227\n// module chunks = 0","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String} Type of value\n * @param size {Number}\n */\nvar defaultValue = function(type, size) \n{\n switch (type)\n {\n case 'float':\n return 0;\n\n case 'vec2': \n return new Float32Array(2 * size);\n\n case 'vec3':\n return new Float32Array(3 * size);\n\n case 'vec4': \n return new Float32Array(4 * size);\n \n case 'int':\n case 'sampler2D':\n return 0;\n\n case 'ivec2': \n return new Int32Array(2 * size);\n\n case 'ivec3':\n return new Int32Array(3 * size);\n\n case 'ivec4': \n return new Int32Array(4 * size);\n\n case 'bool': \n return false;\n\n case 'bvec2':\n\n return booleanArray( 2 * size);\n\n case 'bvec3':\n return booleanArray(3 * size);\n\n case 'bvec4':\n return booleanArray(4 * size);\n\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n\n case 'mat3': \n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n};\n\nvar booleanArray = function(size)\n{\n var array = new Array(size);\n\n for (var i = 0; i < array.length; i++) \n {\n array[i] = false;\n }\n\n return array;\n};\n\nmodule.exports = defaultValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/defaultValue.js\n// module id = 228\n// module chunks = 0","\nvar mapType = require('./mapType');\nvar mapSize = require('./mapSize');\n\n/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the attributes from\n * @return attributes {Object}\n */\nvar extractAttributes = function(gl, program)\n{\n var attributes = {};\n\n var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (var i = 0; i < totalAttributes; i++)\n {\n var attribData = gl.getActiveAttrib(program, i);\n var type = mapType(gl, attribData.type);\n\n attributes[attribData.name] = {\n type:type,\n size:mapSize(type),\n location:gl.getAttribLocation(program, attribData.name),\n //TODO - make an attribute object\n pointer: pointer\n };\n }\n\n return attributes;\n};\n\nvar pointer = function(type, normalized, stride, start){\n // console.log(this.location)\n gl.vertexAttribPointer(this.location,this.size, type || gl.FLOAT, normalized || false, stride || 0, start || 0);\n};\n\nmodule.exports = extractAttributes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/extractAttributes.js\n// module id = 229\n// module chunks = 0","var mapType = require('./mapType');\nvar defaultValue = require('./defaultValue');\n\n/**\n * Extracts the uniforms\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param program {WebGLProgram} The shader program to get the uniforms from\n * @return uniforms {Object}\n */\nvar extractUniforms = function(gl, program)\n{\n\tvar uniforms = {};\n\n var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n for (var i = 0; i < totalUniforms; i++)\n {\n \tvar uniformData = gl.getActiveUniform(program, i);\n \tvar name = uniformData.name.replace(/\\[.*?\\]/, \"\");\n var type = mapType(gl, uniformData.type );\n\n \tuniforms[name] = {\n \t\ttype:type,\n \t\tsize:uniformData.size,\n \t\tlocation:gl.getUniformLocation(program, name),\n \t\tvalue:defaultValue(type, uniformData.size)\n \t};\n }\n\n\treturn uniforms;\n};\n\nmodule.exports = extractUniforms;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/extractUniforms.js\n// module id = 230\n// module chunks = 0","/**\n * Extracts the attributes\n * @class\n * @memberof PIXI.glCore.shader\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param uniforms {Array} @mat ?\n * @return attributes {Object}\n */\nvar generateUniformAccessObject = function(gl, uniformData)\n{\n // this is the object we will be sending back.\n // an object hierachy will be created for structs\n var uniforms = {data:{}};\n\n uniforms.gl = gl;\n\n var uniformKeys= Object.keys(uniformData);\n\n for (var i = 0; i < uniformKeys.length; i++)\n {\n var fullName = uniformKeys[i];\n\n var nameTokens = fullName.split('.');\n var name = nameTokens[nameTokens.length - 1];\n\n\n var uniformGroup = getUniformGroup(nameTokens, uniforms);\n\n var uniform = uniformData[fullName];\n uniformGroup.data[name] = uniform;\n\n uniformGroup.gl = gl;\n\n Object.defineProperty(uniformGroup, name, {\n get: generateGetter(name),\n set: generateSetter(name, uniform)\n });\n }\n\n return uniforms;\n};\n\nvar generateGetter = function(name)\n{\n\tvar template = getterTemplate.replace('%%', name);\n\treturn new Function(template); // jshint ignore:line\n};\n\nvar generateSetter = function(name, uniform)\n{\n var template = setterTemplate.replace(/%%/g, name);\n var setTemplate;\n\n if(uniform.size === 1)\n {\n setTemplate = GLSL_TO_SINGLE_SETTERS[uniform.type];\n }\n else\n {\n setTemplate = GLSL_TO_ARRAY_SETTERS[uniform.type];\n }\n\n if(setTemplate)\n {\n template += \"\\nthis.gl.\" + setTemplate + \";\";\n }\n\n \treturn new Function('value', template); // jshint ignore:line\n};\n\nvar getUniformGroup = function(nameTokens, uniform)\n{\n var cur = uniform;\n\n for (var i = 0; i < nameTokens.length - 1; i++)\n {\n var o = cur[nameTokens[i]] || {data:{}};\n cur[nameTokens[i]] = o;\n cur = o;\n }\n\n return cur;\n};\n\nvar getterTemplate = [\n 'return this.data.%%.value;',\n].join('\\n');\n\nvar setterTemplate = [\n 'this.data.%%.value = value;',\n 'var location = this.data.%%.location;'\n].join('\\n');\n\n\nvar GLSL_TO_SINGLE_SETTERS = {\n\n 'float': 'uniform1f(location, value)',\n\n 'vec2': 'uniform2f(location, value[0], value[1])',\n 'vec3': 'uniform3f(location, value[0], value[1], value[2])',\n 'vec4': 'uniform4f(location, value[0], value[1], value[2], value[3])',\n\n 'int': 'uniform1i(location, value)',\n 'ivec2': 'uniform2i(location, value[0], value[1])',\n 'ivec3': 'uniform3i(location, value[0], value[1], value[2])',\n 'ivec4': 'uniform4i(location, value[0], value[1], value[2], value[3])',\n\n 'bool': 'uniform1i(location, value)',\n 'bvec2': 'uniform2i(location, value[0], value[1])',\n 'bvec3': 'uniform3i(location, value[0], value[1], value[2])',\n 'bvec4': 'uniform4i(location, value[0], value[1], value[2], value[3])',\n\n 'mat2': 'uniformMatrix2fv(location, false, value)',\n 'mat3': 'uniformMatrix3fv(location, false, value)',\n 'mat4': 'uniformMatrix4fv(location, false, value)',\n\n 'sampler2D':'uniform1i(location, value)'\n};\n\nvar GLSL_TO_ARRAY_SETTERS = {\n\n 'float': 'uniform1fv(location, value)',\n\n 'vec2': 'uniform2fv(location, value)',\n 'vec3': 'uniform3fv(location, value)',\n 'vec4': 'uniform4fv(location, value)',\n\n 'int': 'uniform1iv(location, value)',\n 'ivec2': 'uniform2iv(location, value)',\n 'ivec3': 'uniform3iv(location, value)',\n 'ivec4': 'uniform4iv(location, value)',\n\n 'bool': 'uniform1iv(location, value)',\n 'bvec2': 'uniform2iv(location, value)',\n 'bvec3': 'uniform3iv(location, value)',\n 'bvec4': 'uniform4iv(location, value)',\n\n 'sampler2D':'uniform1iv(location, value)'\n};\n\nmodule.exports = generateUniformAccessObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/generateUniformAccessObject.js\n// module id = 231\n// module chunks = 0","/**\n * @class\n * @memberof PIXI.glCore.shader\n * @param type {String}\n * @return {Number}\n */\nvar mapSize = function(type) \n{ \n return GLSL_TO_SIZE[type];\n};\n\n\nvar GLSL_TO_SIZE = {\n 'float': 1,\n 'vec2': 2,\n 'vec3': 3,\n 'vec4': 4,\n\n 'int': 1,\n 'ivec2': 2,\n 'ivec3': 3,\n 'ivec4': 4,\n\n 'bool': 1,\n 'bvec2': 2,\n 'bvec3': 3,\n 'bvec4': 4,\n\n 'mat2': 4,\n 'mat3': 9,\n 'mat4': 16,\n\n 'sampler2D': 1\n};\n\nmodule.exports = mapSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/mapSize.js\n// module id = 232\n// module chunks = 0","/**\n * Sets the float precision on the shader. If the precision is already present this function will do nothing\n * @param {string} src the shader source\n * @param {string} precision The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n *\n * @return {string} modified shader source\n */\nvar setPrecision = function(src, precision)\n{\n if(src.substring(0, 9) !== 'precision')\n {\n return 'precision ' + precision + ' float;\\n' + src;\n }\n\n return src;\n};\n\nmodule.exports = setPrecision;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/setPrecision.js\n// module id = 233\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.accessibility.AccessibilityManager}.\n *\n * @function accessibleTarget\n * @memberof PIXI.accessibility\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibility.accessibleTarget\n * );\n */\nexports.default = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n *\n * @member {boolean}\n */\n accessible: false,\n\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n *\n * @member {string}\n */\n accessibleTitle: null,\n\n /**\n * Sets the aria-label attribute of the shadow div\n *\n * @member {string}\n */\n accessibleHint: null,\n\n /**\n * @todo Needs docs.\n */\n tabIndex: 0,\n\n /**\n * @todo Needs docs.\n */\n _accessibleActive: false,\n\n /**\n * @todo Needs docs.\n */\n _accessibleDiv: false\n};\n//# sourceMappingURL=accessibleTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/accessibility/accessibleTarget.js\n// module id = 234\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _autoDetectRenderer = require('./autoDetectRenderer');\n\nvar _Container = require('./display/Container');\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _ticker = require('./ticker');\n\nvar _settings = require('./settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _const = require('./const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Convenience class to create a new PIXI application.\n * This class automatically creates the renderer, ticker\n * and root container.\n *\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.fromImage('something.png'));\n *\n * @class\n * @memberof PIXI\n */\nvar Application = function () {\n // eslint-disable-next-line valid-jsdoc\n /**\n * @param {object} [options] - The optional renderer parameters\n * @param {boolean} [options.autoStart=true] - automatically starts the rendering after the construction.\n * Note that setting this parameter to false does NOT stop the shared ticker even if you set\n * options.sharedTicker to true in case that it is already started. Stop it by your own.\n * @param {number} [options.width=800] - the width of the renderers view\n * @param {number} [options.height=600] - the height of the renderers view\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.\n * FXAA is faster, but may not always look as great **webgl only**\n * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices.\n * If you experience unexplained flickering try setting this to true. **webgl only**\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card **webgl only**\n * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker.\n * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader.\n */\n function Application(options, arg2, arg3, arg4, arg5) {\n _classCallCheck(this, Application);\n\n // Support for constructor(width, height, options, noWebGL, useSharedTicker)\n if (typeof options === 'number') {\n options = Object.assign({\n width: options,\n height: arg2 || _settings2.default.RENDER_OPTIONS.height,\n forceCanvas: !!arg4,\n sharedTicker: !!arg5\n }, arg3);\n }\n\n /**\n * The default options, so we mixin functionality later.\n * @member {object}\n * @protected\n */\n this._options = options = Object.assign({\n autoStart: true,\n sharedTicker: false,\n forceCanvas: false,\n sharedLoader: false\n }, options);\n\n /**\n * WebGL renderer if available, otherwise CanvasRenderer\n * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer}\n */\n this.renderer = (0, _autoDetectRenderer.autoDetectRenderer)(options);\n\n /**\n * The root display container that's rendered.\n * @member {PIXI.Container}\n */\n this.stage = new _Container2.default();\n\n /**\n * Internal reference to the ticker\n * @member {PIXI.ticker.Ticker}\n * @private\n */\n this._ticker = null;\n\n /**\n * Ticker for doing render updates.\n * @member {PIXI.ticker.Ticker}\n * @default PIXI.ticker.shared\n */\n this.ticker = options.sharedTicker ? _ticker.shared : new _ticker.Ticker();\n\n // Start the rendering\n if (options.autoStart) {\n this.start();\n }\n }\n\n /**\n * Render the current stage.\n */\n Application.prototype.render = function render() {\n this.renderer.render(this.stage);\n };\n\n /**\n * Convenience method for stopping the render.\n */\n\n\n Application.prototype.stop = function stop() {\n this._ticker.stop();\n };\n\n /**\n * Convenience method for starting the render.\n */\n\n\n Application.prototype.start = function start() {\n this._ticker.start();\n };\n\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n\n\n /**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] Automatically remove canvas from DOM.\n */\n Application.prototype.destroy = function destroy(removeView) {\n var oldTicker = this._ticker;\n\n this.ticker = null;\n\n oldTicker.destroy();\n\n this.stage.destroy();\n this.stage = null;\n\n this.renderer.destroy(removeView);\n this.renderer = null;\n\n this._options = null;\n };\n\n _createClass(Application, [{\n key: 'ticker',\n set: function set(ticker) // eslint-disable-line require-jsdoc\n {\n if (this._ticker) {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker) {\n ticker.add(this.render, this, _const.UPDATE_PRIORITY.LOW);\n }\n },\n get: function get() // eslint-disable-line require-jsdoc\n {\n return this._ticker;\n }\n }, {\n key: 'view',\n get: function get() {\n return this.renderer.view;\n }\n\n /**\n * Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen\n * @member {PIXI.Rectangle}\n * @readonly\n */\n\n }, {\n key: 'screen',\n get: function get() {\n return this.renderer.screen;\n }\n }]);\n\n return Application;\n}();\n\nexports.default = Application;\n//# sourceMappingURL=Application.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/Application.js\n// module id = 235\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.autoDetectRenderer = autoDetectRenderer;\n\nvar _utils = require('./utils');\n\nvar utils = _interopRequireWildcard(_utils);\n\nvar _CanvasRenderer = require('./renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _WebGLRenderer = require('./renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\n * the browser then this function will return a canvas renderer\n *\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the renderers view\n * @param {number} [options.height=600] - the height of the renderers view\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the webgl context\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n * @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.\n * FXAA is faster, but may not always look as great **webgl only**\n * @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices.\n * If you experience unexplained flickering try setting this to true. **webgl only**\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card **webgl only**\n * @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer\n */\nfunction autoDetectRenderer(options, arg1, arg2, arg3) {\n // Backward-compatible support for noWebGL option\n var forceCanvas = options && options.forceCanvas;\n\n if (arg3 !== undefined) {\n forceCanvas = arg3;\n }\n\n if (!forceCanvas && utils.isWebGLSupported()) {\n return new _WebGLRenderer2.default(options, arg1, arg2);\n }\n\n return new _CanvasRenderer2.default(options, arg1, arg2);\n}\n//# sourceMappingURL=autoDetectRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/autoDetectRenderer.js\n// module id = 236\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _TransformStatic = require('./TransformStatic');\n\nvar _TransformStatic2 = _interopRequireDefault(_TransformStatic);\n\nvar _Transform = require('./Transform');\n\nvar _Transform2 = _interopRequireDefault(_Transform);\n\nvar _Bounds = require('./Bounds');\n\nvar _Bounds2 = _interopRequireDefault(_Bounds);\n\nvar _math = require('../math');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// _tempDisplayObjectParent = new DisplayObject();\n\n/**\n * The base class for all objects that are rendered on the screen.\n * This is an abstract class and should not be used on its own rather it should be extended.\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\nvar DisplayObject = function (_EventEmitter) {\n _inherits(DisplayObject, _EventEmitter);\n\n /**\n *\n */\n function DisplayObject() {\n _classCallCheck(this, DisplayObject);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n var TransformClass = _settings2.default.TRANSFORM_MODE === _const.TRANSFORM_MODE.STATIC ? _TransformStatic2.default : _Transform2.default;\n\n _this.tempDisplayObjectParent = null;\n\n // TODO: need to create Transform from factory\n /**\n * World transform and local transform of this object.\n * This will become read-only later, please do not assign anything there unless you know what are you doing\n *\n * @member {PIXI.TransformBase}\n */\n _this.transform = new TransformClass();\n\n /**\n * The opacity of the object.\n *\n * @member {number}\n */\n _this.alpha = 1;\n\n /**\n * The visibility of the object. If false the object will not be drawn, and\n * the updateTransform function will not be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually\n *\n * @member {boolean}\n */\n _this.visible = true;\n\n /**\n * Can this object be rendered, if false the object will not be drawn but the updateTransform\n * methods will still be called.\n *\n * Only affects recursive calls from parent. You can ask for bounds manually\n *\n * @member {boolean}\n */\n _this.renderable = true;\n\n /**\n * The display object container that contains this display object.\n *\n * @member {PIXI.Container}\n * @readonly\n */\n _this.parent = null;\n\n /**\n * The multiplied alpha of the displayObject\n *\n * @member {number}\n * @readonly\n */\n _this.worldAlpha = 1;\n\n /**\n * The area the filter is applied to. This is used as more of an optimisation\n * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle\n *\n * Also works as an interaction mask\n *\n * @member {PIXI.Rectangle}\n */\n _this.filterArea = null;\n\n _this._filters = null;\n _this._enabledFilters = null;\n\n /**\n * The bounds object, this is used to calculate and store the bounds of the displayObject\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._bounds = new _Bounds2.default();\n _this._boundsID = 0;\n _this._lastBoundsID = -1;\n _this._boundsRect = null;\n _this._localBoundsRect = null;\n\n /**\n * The original, cached mask of the object\n *\n * @member {PIXI.Graphics|PIXI.Sprite}\n * @private\n */\n _this._mask = null;\n\n /**\n * If the object has been destroyed via destroy(). If true, it should not be used.\n *\n * @member {boolean}\n * @private\n * @readonly\n */\n _this._destroyed = false;\n\n /**\n * Fired when this DisplayObject is added to a Container.\n *\n * @event PIXI.DisplayObject#added\n * @param {PIXI.Container} container - The container added to.\n */\n\n /**\n * Fired when this DisplayObject is removed from a Container.\n *\n * @event PIXI.DisplayObject#removed\n * @param {PIXI.Container} container - The container removed from.\n */\n return _this;\n }\n\n /**\n * @private\n * @member {PIXI.DisplayObject}\n */\n\n\n /**\n * Updates the object transform for rendering\n *\n * TODO - Optimization pass!\n */\n DisplayObject.prototype.updateTransform = function updateTransform() {\n this.transform.updateTransform(this.parent.transform);\n // multiply the alphas..\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n\n this._bounds.updateID++;\n };\n\n /**\n * recursively updates transform of all objects from the root to this one\n * internal function for toLocal()\n */\n\n\n DisplayObject.prototype._recursivePostUpdateTransform = function _recursivePostUpdateTransform() {\n if (this.parent) {\n this.parent._recursivePostUpdateTransform();\n this.transform.updateTransform(this.parent.transform);\n } else {\n this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n }\n };\n\n /**\n * Retrieves the bounds of the displayObject as a rectangle object.\n *\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost\n * @param {PIXI.Rectangle} rect - Optional rectangle to store the result of the bounds calculation\n * @return {PIXI.Rectangle} the rectangular bounding area\n */\n\n\n DisplayObject.prototype.getBounds = function getBounds(skipUpdate, rect) {\n if (!skipUpdate) {\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this._recursivePostUpdateTransform();\n this.updateTransform();\n }\n }\n\n if (this._boundsID !== this._lastBoundsID) {\n this.calculateBounds();\n }\n\n if (!rect) {\n if (!this._boundsRect) {\n this._boundsRect = new _math.Rectangle();\n }\n\n rect = this._boundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n };\n\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object\n *\n * @param {PIXI.Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation\n * @return {PIXI.Rectangle} the rectangular bounding area\n */\n\n\n DisplayObject.prototype.getLocalBounds = function getLocalBounds(rect) {\n var transformRef = this.transform;\n var parentRef = this.parent;\n\n this.parent = null;\n this.transform = this._tempDisplayObjectParent.transform;\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new _math.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n var bounds = this.getBounds(false, rect);\n\n this.parent = parentRef;\n this.transform = transformRef;\n\n return bounds;\n };\n\n /**\n * Calculates the global position of the display object\n *\n * @param {PIXI.Point} position - The world origin to calculate from\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point)\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform.\n * @return {PIXI.Point} A point object representing the position of this object\n */\n\n\n DisplayObject.prototype.toGlobal = function toGlobal(position, point) {\n var skipUpdate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n // don't need to update the lot\n return this.worldTransform.apply(position, point);\n };\n\n /**\n * Calculates the local position of the display object relative to another point\n *\n * @param {PIXI.Point} position - The world origin to calculate from\n * @param {PIXI.DisplayObject} [from] - The DisplayObject to calculate the global position from\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional\n * (otherwise will create a new Point)\n * @param {boolean} [skipUpdate=false] - Should we skip the update transform\n * @return {PIXI.Point} A point object representing the position of this object\n */\n\n\n DisplayObject.prototype.toLocal = function toLocal(position, from, point, skipUpdate) {\n if (from) {\n position = from.toGlobal(position, point, skipUpdate);\n }\n\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n } else {\n this.displayObjectUpdateTransform();\n }\n }\n\n // simply apply the matrix..\n return this.worldTransform.applyInverse(position, point);\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n DisplayObject.prototype.renderWebGL = function renderWebGL(renderer) // eslint-disable-line no-unused-vars\n {}\n // OVERWRITE;\n\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n ;\n\n DisplayObject.prototype.renderCanvas = function renderCanvas(renderer) // eslint-disable-line no-unused-vars\n {}\n // OVERWRITE;\n\n\n /**\n * Set the parent Container of this DisplayObject\n *\n * @param {PIXI.Container} container - The Container to add this DisplayObject to\n * @return {PIXI.Container} The Container that this DisplayObject was added to\n */\n ;\n\n DisplayObject.prototype.setParent = function setParent(container) {\n if (!container || !container.addChild) {\n throw new Error('setParent: Argument must be a Container');\n }\n\n container.addChild(this);\n\n return container;\n };\n\n /**\n * Convenience function to set the position, scale, skew and pivot at once.\n *\n * @param {number} [x=0] - The X position\n * @param {number} [y=0] - The Y position\n * @param {number} [scaleX=1] - The X scale value\n * @param {number} [scaleY=1] - The Y scale value\n * @param {number} [rotation=0] - The rotation\n * @param {number} [skewX=0] - The X skew value\n * @param {number} [skewY=0] - The Y skew value\n * @param {number} [pivotX=0] - The X pivot value\n * @param {number} [pivotY=0] - The Y pivot value\n * @return {PIXI.DisplayObject} The DisplayObject instance\n */\n\n\n DisplayObject.prototype.setTransform = function setTransform() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var scaleX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var scaleY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var rotation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var skewX = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n var skewY = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var pivotX = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;\n var pivotY = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 0;\n\n this.position.x = x;\n this.position.y = y;\n this.scale.x = !scaleX ? 1 : scaleX;\n this.scale.y = !scaleY ? 1 : scaleY;\n this.rotation = rotation;\n this.skew.x = skewX;\n this.skew.y = skewY;\n this.pivot.x = pivotX;\n this.pivot.y = pivotY;\n\n return this;\n };\n\n /**\n * Base destroy method for generic display objects. This will automatically\n * remove the display object from its parent Container as well as remove\n * all current event listeners and internal references. Do not use a DisplayObject\n * after calling `destroy`.\n *\n */\n\n\n DisplayObject.prototype.destroy = function destroy() {\n this.removeAllListeners();\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n\n this._destroyed = true;\n };\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n * An alias to position.x\n *\n * @member {number}\n */\n\n\n _createClass(DisplayObject, [{\n key: '_tempDisplayObjectParent',\n get: function get() {\n if (this.tempDisplayObjectParent === null) {\n this.tempDisplayObjectParent = new DisplayObject();\n }\n\n return this.tempDisplayObjectParent;\n }\n }, {\n key: 'x',\n get: function get() {\n return this.position.x;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.x = value;\n }\n\n /**\n * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n * An alias to position.y\n *\n * @member {number}\n */\n\n }, {\n key: 'y',\n get: function get() {\n return this.position.y;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.y = value;\n }\n\n /**\n * Current transform of the object based on world (parent) factors\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n\n }, {\n key: 'worldTransform',\n get: function get() {\n return this.transform.worldTransform;\n }\n\n /**\n * Current transform of the object based on local factors: position, scale, other stuff\n *\n * @member {PIXI.Matrix}\n * @readonly\n */\n\n }, {\n key: 'localTransform',\n get: function get() {\n return this.transform.localTransform;\n }\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'position',\n get: function get() {\n return this.transform.position;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.position.copy(value);\n }\n\n /**\n * The scale factor of the object.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'scale',\n get: function get() {\n return this.transform.scale;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.scale.copy(value);\n }\n\n /**\n * The pivot point of the displayObject that it rotates around\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.Point|PIXI.ObservablePoint}\n */\n\n }, {\n key: 'pivot',\n get: function get() {\n return this.transform.pivot;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.pivot.copy(value);\n }\n\n /**\n * The skew factor for the object in radians.\n * Assignment by value since pixi-v4.\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'skew',\n get: function get() {\n return this.transform.skew;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.skew.copy(value);\n }\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n }, {\n key: 'rotation',\n get: function get() {\n return this.transform.rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.transform.rotation = value;\n }\n\n /**\n * Indicates if the object is globally visible.\n *\n * @member {boolean}\n * @readonly\n */\n\n }, {\n key: 'worldVisible',\n get: function get() {\n var item = this;\n\n do {\n if (!item.visible) {\n return false;\n }\n\n item = item.parent;\n } while (item);\n\n return true;\n }\n\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it. In PIXI a regular mask must be a\n * PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it\n * utilises shape clipping. To remove a mask, set this property to null.\n *\n * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n *\n * @member {PIXI.Graphics|PIXI.Sprite}\n */\n\n }, {\n key: 'mask',\n get: function get() {\n return this._mask;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._mask) {\n this._mask.renderable = true;\n }\n\n this._mask = value;\n\n if (this._mask) {\n this._mask.renderable = false;\n }\n }\n\n /**\n * Sets the filters for the displayObject.\n * * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\n * To remove filters simply set this property to 'null'\n *\n * @member {PIXI.Filter[]}\n */\n\n }, {\n key: 'filters',\n get: function get() {\n return this._filters && this._filters.slice();\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._filters = value && value.slice();\n }\n }]);\n\n return DisplayObject;\n}(_eventemitter2.default);\n\n// performance increase to avoid using call.. (10x faster)\n\n\nexports.default = DisplayObject;\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n//# sourceMappingURL=DisplayObject.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/display/DisplayObject.js\n// module id = 237\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _TransformBase2 = require('./TransformBase');\n\nvar _TransformBase3 = _interopRequireDefault(_TransformBase2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Generic class to deal with traditional 2D matrix transforms\n * local transformation is calculated from position,scale,skew and rotation\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nvar Transform = function (_TransformBase) {\n _inherits(Transform, _TransformBase);\n\n /**\n *\n */\n function Transform() {\n _classCallCheck(this, Transform);\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.Point}\n */\n var _this = _possibleConstructorReturn(this, _TransformBase.call(this));\n\n _this.position = new _math.Point(0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.Point}\n */\n _this.scale = new _math.Point(1, 1);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.skew = new _math.ObservablePoint(_this.updateSkew, _this, 0, 0);\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @member {PIXI.Point}\n */\n _this.pivot = new _math.Point(0, 0);\n\n /**\n * The rotation value of the object, in radians\n *\n * @member {Number}\n * @private\n */\n _this._rotation = 0;\n\n _this._cx = 1; // cos rotation + skewY;\n _this._sx = 0; // sin rotation + skewY;\n _this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n _this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n return _this;\n }\n\n /**\n * Updates the skew values when the skew or rotation changes.\n *\n * @private\n */\n\n\n Transform.prototype.updateSkew = function updateSkew() {\n this._cx = Math.cos(this._rotation + this.skew._y);\n this._sx = Math.sin(this._rotation + this.skew._y);\n this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n };\n\n /**\n * Updates only local matrix\n */\n\n\n Transform.prototype.updateLocalTransform = function updateLocalTransform() {\n var lt = this.localTransform;\n\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);\n lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);\n };\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n */\n\n\n Transform.prototype.updateTransform = function updateTransform(parentTransform) {\n var lt = this.localTransform;\n\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n\n lt.tx = this.position.x - (this.pivot.x * lt.a + this.pivot.y * lt.c);\n lt.ty = this.position.y - (this.pivot.x * lt.b + this.pivot.y * lt.d);\n\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._worldID++;\n };\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n\n\n Transform.prototype.setFromMatrix = function setFromMatrix(matrix) {\n matrix.decompose(this);\n };\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n\n _createClass(Transform, [{\n key: 'rotation',\n get: function get() {\n return this._rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rotation = value;\n this.updateSkew();\n }\n }]);\n\n return Transform;\n}(_TransformBase3.default);\n\nexports.default = Transform;\n//# sourceMappingURL=Transform.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/display/Transform.js\n// module id = 238\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _math = require('../math');\n\nvar _TransformBase2 = require('./TransformBase');\n\nvar _TransformBase3 = _interopRequireDefault(_TransformBase2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @extends PIXI.TransformBase\n * @memberof PIXI\n */\nvar TransformStatic = function (_TransformBase) {\n _inherits(TransformStatic, _TransformBase);\n\n /**\n *\n */\n function TransformStatic() {\n _classCallCheck(this, TransformStatic);\n\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.ObservablePoint}\n */\n var _this = _possibleConstructorReturn(this, _TransformBase.call(this));\n\n _this.position = new _math.ObservablePoint(_this.onChange, _this, 0, 0);\n\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.scale = new _math.ObservablePoint(_this.onChange, _this, 1, 1);\n\n /**\n * The pivot point of the displayObject that it rotates around\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.pivot = new _math.ObservablePoint(_this.onChange, _this, 0, 0);\n\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n _this.skew = new _math.ObservablePoint(_this.updateSkew, _this, 0, 0);\n\n _this._rotation = 0;\n\n _this._cx = 1; // cos rotation + skewY;\n _this._sx = 0; // sin rotation + skewY;\n _this._cy = 0; // cos rotation + Math.PI/2 - skewX;\n _this._sy = 1; // sin rotation + Math.PI/2 - skewX;\n\n _this._localID = 0;\n _this._currentLocalID = 0;\n return _this;\n }\n\n /**\n * Called when a value changes.\n *\n * @private\n */\n\n\n TransformStatic.prototype.onChange = function onChange() {\n this._localID++;\n };\n\n /**\n * Called when skew or rotation changes\n *\n * @private\n */\n\n\n TransformStatic.prototype.updateSkew = function updateSkew() {\n this._cx = Math.cos(this._rotation + this.skew._y);\n this._sx = Math.sin(this._rotation + this.skew._y);\n this._cy = -Math.sin(this._rotation - this.skew._x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew._x); // sin, added PI/2\n\n this._localID++;\n };\n\n /**\n * Updates only local matrix\n */\n\n\n TransformStatic.prototype.updateLocalTransform = function updateLocalTransform() {\n var lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale._x;\n lt.b = this._sx * this.scale._x;\n lt.c = this._cy * this.scale._y;\n lt.d = this._sy * this.scale._y;\n\n lt.tx = this.position._x - (this.pivot._x * lt.a + this.pivot._y * lt.c);\n lt.ty = this.position._y - (this.pivot._x * lt.b + this.pivot._y * lt.d);\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n };\n\n /**\n * Updates the values of the object and applies the parent's transform.\n *\n * @param {PIXI.Transform} parentTransform - The transform of the parent of this object\n */\n\n\n TransformStatic.prototype.updateTransform = function updateTransform(parentTransform) {\n var lt = this.localTransform;\n\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale._x;\n lt.b = this._sx * this.scale._x;\n lt.c = this._cy * this.scale._y;\n lt.d = this._sy * this.scale._y;\n\n lt.tx = this.position._x - (this.pivot._x * lt.a + this.pivot._y * lt.c);\n lt.ty = this.position._y - (this.pivot._x * lt.b + this.pivot._y * lt.d);\n this._currentLocalID = this._localID;\n\n // force an update..\n this._parentID = -1;\n }\n\n if (this._parentID !== parentTransform._worldID) {\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n\n wt.a = lt.a * pt.a + lt.b * pt.c;\n wt.b = lt.a * pt.b + lt.b * pt.d;\n wt.c = lt.c * pt.a + lt.d * pt.c;\n wt.d = lt.c * pt.b + lt.d * pt.d;\n wt.tx = lt.tx * pt.a + lt.ty * pt.c + pt.tx;\n wt.ty = lt.tx * pt.b + lt.ty * pt.d + pt.ty;\n\n this._parentID = parentTransform._worldID;\n\n // update the id of the transform..\n this._worldID++;\n }\n };\n\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n\n\n TransformStatic.prototype.setFromMatrix = function setFromMatrix(matrix) {\n matrix.decompose(this);\n this._localID++;\n };\n\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n\n\n _createClass(TransformStatic, [{\n key: 'rotation',\n get: function get() {\n return this._rotation;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rotation = value;\n this.updateSkew();\n }\n }]);\n\n return TransformStatic;\n}(_TransformBase3.default);\n\nexports.default = TransformStatic;\n//# sourceMappingURL=TransformStatic.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/display/TransformStatic.js\n// module id = 239\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A GraphicsData object.\n *\n * @class\n * @memberof PIXI\n */\nvar GraphicsData = function () {\n /**\n *\n * @param {number} lineWidth - the width of the line to draw\n * @param {number} lineColor - the color of the line to draw\n * @param {number} lineAlpha - the alpha of the line to draw\n * @param {number} fillColor - the color of the fill\n * @param {number} fillAlpha - the alpha of the fill\n * @param {boolean} fill - whether or not the shape is filled with a colour\n * @param {boolean} nativeLines - the method for drawing lines\n * @param {PIXI.Circle|PIXI.Rectangle|PIXI.Ellipse|PIXI.Polygon} shape - The shape object to draw.\n */\n function GraphicsData(lineWidth, lineColor, lineAlpha, fillColor, fillAlpha, fill, nativeLines, shape) {\n _classCallCheck(this, GraphicsData);\n\n /**\n * @member {number} the width of the line to draw\n */\n this.lineWidth = lineWidth;\n /**\n * @member {boolean} if true the liens will be draw using LINES instead of TRIANGLE_STRIP\n */\n this.nativeLines = nativeLines;\n\n /**\n * @member {number} the color of the line to draw\n */\n this.lineColor = lineColor;\n\n /**\n * @member {number} the alpha of the line to draw\n */\n this.lineAlpha = lineAlpha;\n\n /**\n * @member {number} cached tint of the line to draw\n */\n this._lineTint = lineColor;\n\n /**\n * @member {number} the color of the fill\n */\n this.fillColor = fillColor;\n\n /**\n * @member {number} the alpha of the fill\n */\n this.fillAlpha = fillAlpha;\n\n /**\n * @member {number} cached tint of the fill\n */\n this._fillTint = fillColor;\n\n /**\n * @member {boolean} whether or not the shape is filled with a colour\n */\n this.fill = fill;\n\n this.holes = [];\n\n /**\n * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} The shape object to draw.\n */\n this.shape = shape;\n\n /**\n * @member {number} The type of the shape, see the Const.Shapes file for all the existing types,\n */\n this.type = shape.type;\n }\n\n /**\n * Creates a new GraphicsData object with the same values as this one.\n *\n * @return {PIXI.GraphicsData} Cloned GraphicsData object\n */\n\n\n GraphicsData.prototype.clone = function clone() {\n return new GraphicsData(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.fill, this.nativeLines, this.shape);\n };\n\n /**\n * Adds a hole to the shape.\n *\n * @param {PIXI.Rectangle|PIXI.Circle} shape - The shape of the hole.\n */\n\n\n GraphicsData.prototype.addHole = function addHole(shape) {\n this.holes.push(shape);\n };\n\n /**\n * Destroys the Graphics data.\n */\n\n\n GraphicsData.prototype.destroy = function destroy() {\n this.shape = null;\n this.holes = null;\n };\n\n return GraphicsData;\n}();\n\nexports.default = GraphicsData;\n//# sourceMappingURL=GraphicsData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/GraphicsData.js\n// module id = 240\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Matrix = require('./Matrix');\n\nvar _Matrix2 = _interopRequireDefault(_Matrix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1]; // Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group of order 16\n\nvar uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\nvar tempMatrices = [];\n\nvar mul = [];\n\nfunction signum(x) {\n if (x < 0) {\n return -1;\n }\n if (x > 0) {\n return 1;\n }\n\n return 0;\n}\n\nfunction init() {\n for (var i = 0; i < 16; i++) {\n var row = [];\n\n mul.push(row);\n\n for (var j = 0; j < 16; j++) {\n var _ux = signum(ux[i] * ux[j] + vx[i] * uy[j]);\n var _uy = signum(uy[i] * ux[j] + vy[i] * uy[j]);\n var _vx = signum(ux[i] * vx[j] + vx[i] * vy[j]);\n var _vy = signum(uy[i] * vx[j] + vy[i] * vy[j]);\n\n for (var k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n\n for (var _i = 0; _i < 16; _i++) {\n var mat = new _Matrix2.default();\n\n mat.set(ux[_i], uy[_i], vx[_i], vy[_i], 0, 0);\n tempMatrices.push(mat);\n }\n}\n\ninit();\n\n/**\n * Implements Dihedral Group D_8, see [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html},\n * D8 is the same but with diagonals. Used for texture rotations.\n *\n * Vector xX(i), xY(i) is U-axis of sprite with rotation i\n * Vector yY(i), yY(i) is V-axis of sprite with rotation i\n * Rotations: 0 grad (0), 90 grad (2), 180 grad (4), 270 grad (6)\n * Mirrors: vertical (8), main diagonal (10), horizontal (12), reverse diagonal (14)\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @author Ivan @ivanpopelyshev\n * @class\n * @memberof PIXI\n */\nvar GroupD8 = {\n E: 0,\n SE: 1,\n S: 2,\n SW: 3,\n W: 4,\n NW: 5,\n N: 6,\n NE: 7,\n MIRROR_VERTICAL: 8,\n MIRROR_HORIZONTAL: 12,\n uX: function uX(ind) {\n return ux[ind];\n },\n uY: function uY(ind) {\n return uy[ind];\n },\n vX: function vX(ind) {\n return vx[ind];\n },\n vY: function vY(ind) {\n return vy[ind];\n },\n inv: function inv(rotation) {\n if (rotation & 8) {\n return rotation & 15;\n }\n\n return -rotation & 7;\n },\n add: function add(rotationSecond, rotationFirst) {\n return mul[rotationSecond][rotationFirst];\n },\n sub: function sub(rotationSecond, rotationFirst) {\n return mul[rotationSecond][GroupD8.inv(rotationFirst)];\n },\n\n /**\n * Adds 180 degrees to rotation. Commutative operation.\n *\n * @memberof PIXI.GroupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} rotated number\n */\n rotate180: function rotate180(rotation) {\n return rotation ^ 4;\n },\n\n /**\n * I dont know why sometimes width and heights needs to be swapped. We'll fix it later.\n *\n * @memberof PIXI.GroupD8\n * @param {number} rotation - The number to check.\n * @returns {boolean} Whether or not the width/height should be swapped.\n */\n isSwapWidthHeight: function isSwapWidthHeight(rotation) {\n return (rotation & 3) === 2;\n },\n\n /**\n * @memberof PIXI.GroupD8\n * @param {number} dx - TODO\n * @param {number} dy - TODO\n *\n * @return {number} TODO\n */\n byDirection: function byDirection(dx, dy) {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return GroupD8.S;\n }\n\n return GroupD8.N;\n } else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return GroupD8.E;\n }\n\n return GroupD8.W;\n } else if (dy > 0) {\n if (dx > 0) {\n return GroupD8.SE;\n }\n\n return GroupD8.SW;\n } else if (dx > 0) {\n return GroupD8.NE;\n }\n\n return GroupD8.NW;\n },\n\n /**\n * Helps sprite to compensate texture packer rotation.\n *\n * @memberof PIXI.GroupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {number} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: function matrixAppendRotationInv(matrix, rotation) {\n var tx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var ty = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n // Packer used \"rotation\", we use \"inv(rotation)\"\n var mat = tempMatrices[GroupD8.inv(rotation)];\n\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n }\n};\n\nexports.default = GroupD8;\n//# sourceMappingURL=GroupD8.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/GroupD8.js\n// module id = 241\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n * An observable point is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n */\nvar ObservablePoint = function () {\n /**\n * @param {Function} cb - callback when changed\n * @param {object} scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function ObservablePoint(cb, scope) {\n var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, ObservablePoint);\n\n this._x = x;\n this._y = y;\n\n this.cb = cb;\n this.scope = scope;\n }\n\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n\n\n ObservablePoint.prototype.set = function set(x, y) {\n var _x = x || 0;\n var _y = y || (y !== 0 ? _x : 0);\n\n if (this._x !== _x || this._y !== _y) {\n this._x = _x;\n this._y = _y;\n this.cb.call(this.scope);\n }\n };\n\n /**\n * Copies the data from another point\n *\n * @param {PIXI.Point|PIXI.ObservablePoint} point - point to copy from\n */\n\n\n ObservablePoint.prototype.copy = function copy(point) {\n if (this._x !== point.x || this._y !== point.y) {\n this._x = point.x;\n this._y = point.y;\n this.cb.call(this.scope);\n }\n };\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n\n\n _createClass(ObservablePoint, [{\n key: \"x\",\n get: function get() {\n return this._x;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._x !== value) {\n this._x = value;\n this.cb.call(this.scope);\n }\n }\n\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n\n }, {\n key: \"y\",\n get: function get() {\n return this._y;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._y !== value) {\n this._y = value;\n this.cb.call(this.scope);\n }\n }\n }]);\n\n return ObservablePoint;\n}();\n\nexports.default = ObservablePoint;\n//# sourceMappingURL=ObservablePoint.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/ObservablePoint.js\n// module id = 242\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _utils = require('../utils');\n\nvar _math = require('../math');\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _Container = require('../display/Container');\n\nvar _Container2 = _interopRequireDefault(_Container);\n\nvar _RenderTexture = require('../textures/RenderTexture');\n\nvar _RenderTexture2 = _interopRequireDefault(_RenderTexture);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempMatrix = new _math.Matrix();\n\n/**\n * The SystemRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.WebGLRenderer} which can be used for rendering a PixiJS scene.\n *\n * @abstract\n * @class\n * @extends EventEmitter\n * @memberof PIXI\n */\n\nvar SystemRenderer = function (_EventEmitter) {\n _inherits(SystemRenderer, _EventEmitter);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n * @param {string} system - The name of the system this renderer is for.\n * @param {object} [options] - The optional renderer parameters\n * @param {number} [options.width=800] - the width of the screen\n * @param {number} [options.height=600] - the height of the screen\n * @param {HTMLCanvasElement} [options.view] - the canvas to use as a view, optional\n * @param {boolean} [options.transparent=false] - If the render view is transparent, default false\n * @param {boolean} [options.autoResize=false] - If the render view is automatically resized, default false\n * @param {boolean} [options.antialias=false] - sets antialias (only applicable in chrome at the moment)\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer. The\n * resolution of the renderer retina would be 2.\n * @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,\n * enable this if you need to call toDataUrl on the webgl context.\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.roundPixels=false] - If true PixiJS will Math.floor() x/y values when rendering,\n * stopping pixel interpolation.\n */\n function SystemRenderer(system, options, arg2, arg3) {\n _classCallCheck(this, SystemRenderer);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n (0, _utils.sayHello)(system);\n\n // Support for constructor(system, screenWidth, screenHeight, options)\n if (typeof options === 'number') {\n options = Object.assign({\n width: options,\n height: arg2 || _settings2.default.RENDER_OPTIONS.height\n }, arg3);\n }\n\n // Add the default render options\n options = Object.assign({}, _settings2.default.RENDER_OPTIONS, options);\n\n /**\n * The supplied constructor options.\n *\n * @member {Object}\n * @readOnly\n */\n _this.options = options;\n\n /**\n * The type of the renderer.\n *\n * @member {number}\n * @default PIXI.RENDERER_TYPE.UNKNOWN\n * @see PIXI.RENDERER_TYPE\n */\n _this.type = _const.RENDERER_TYPE.UNKNOWN;\n\n /**\n * Measurements of the screen. (0, 0, screenWidth, screenHeight)\n *\n * Its safe to use as filterArea or hitArea for whole stage\n *\n * @member {PIXI.Rectangle}\n */\n _this.screen = new _math.Rectangle(0, 0, options.width, options.height);\n\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.view = options.view || document.createElement('canvas');\n\n /**\n * The resolution / device pixel ratio of the renderer\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = options.resolution || _settings2.default.RESOLUTION;\n\n /**\n * Whether the render view is transparent\n *\n * @member {boolean}\n */\n _this.transparent = options.transparent;\n\n /**\n * Whether css dimensions of canvas view should be resized to screen dimensions automatically\n *\n * @member {boolean}\n */\n _this.autoResize = options.autoResize || false;\n\n /**\n * Tracks the blend modes useful for this renderer.\n *\n * @member {object}\n */\n _this.blendModes = null;\n\n /**\n * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n * the stencil buffer is retained after rendering.\n *\n * @member {boolean}\n */\n _this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n\n /**\n * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every\n * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect\n * to clear the canvas every frame. Disable this by setting this to false. For example if\n * your game has a canvas filling background image you often don't need this set.\n *\n * @member {boolean}\n * @default\n */\n _this.clearBeforeRender = options.clearBeforeRender;\n\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Handy for crisp pixel art and speed on legacy devices.\n *\n * @member {boolean}\n */\n _this.roundPixels = options.roundPixels;\n\n /**\n * The background color as a number.\n *\n * @member {number}\n * @private\n */\n _this._backgroundColor = 0x000000;\n\n /**\n * The background color as an [R, G, B] array.\n *\n * @member {number[]}\n * @private\n */\n _this._backgroundColorRgba = [0, 0, 0, 0];\n\n /**\n * The background color as a string.\n *\n * @member {string}\n * @private\n */\n _this._backgroundColorString = '#000000';\n\n _this.backgroundColor = options.backgroundColor || _this._backgroundColor; // run bg color setter\n\n /**\n * This temporary display object used as the parent of the currently being rendered item\n *\n * @member {PIXI.DisplayObject}\n * @private\n */\n _this._tempDisplayObjectParent = new _Container2.default();\n\n /**\n * The last root object that the renderer tried to render.\n *\n * @member {PIXI.DisplayObject}\n * @private\n */\n _this._lastObjectRendered = _this._tempDisplayObjectParent;\n return _this;\n }\n\n /**\n * Same as view.width, actual number of pixels in the canvas by horizontal\n *\n * @member {number}\n * @readonly\n * @default 800\n */\n\n\n /**\n * Resizes the screen and canvas to the specified width and height\n * Canvas dimensions are multiplied by resolution\n *\n * @param {number} screenWidth - the new width of the screen\n * @param {number} screenHeight - the new height of the screen\n */\n SystemRenderer.prototype.resize = function resize(screenWidth, screenHeight) {\n this.screen.width = screenWidth;\n this.screen.height = screenHeight;\n\n this.view.width = screenWidth * this.resolution;\n this.view.height = screenHeight * this.resolution;\n\n if (this.autoResize) {\n this.view.style.width = screenWidth + 'px';\n this.view.style.height = screenHeight + 'px';\n }\n };\n\n /**\n * Useful function that returns a texture of the display object that can then be used to create sprites\n * This can be quite useful if your displayObject is complicated and needs to be reused multiple times.\n *\n * @param {PIXI.DisplayObject} displayObject - The displayObject the object will be generated from\n * @param {number} scaleMode - Should be one of the scaleMode consts\n * @param {number} resolution - The resolution / device pixel ratio of the texture being generated\n * @return {PIXI.Texture} a texture of the graphics object\n */\n\n\n SystemRenderer.prototype.generateTexture = function generateTexture(displayObject, scaleMode, resolution) {\n var bounds = displayObject.getLocalBounds();\n\n var renderTexture = _RenderTexture2.default.create(bounds.width | 0, bounds.height | 0, scaleMode, resolution);\n\n tempMatrix.tx = -bounds.x;\n tempMatrix.ty = -bounds.y;\n\n this.render(displayObject, renderTexture, false, tempMatrix, true);\n\n return renderTexture;\n };\n\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n *\n * @param {boolean} [removeView=false] - Removes the Canvas element from the DOM.\n */\n\n\n SystemRenderer.prototype.destroy = function destroy(removeView) {\n if (removeView && this.view.parentNode) {\n this.view.parentNode.removeChild(this.view);\n }\n\n this.type = _const.RENDERER_TYPE.UNKNOWN;\n\n this.view = null;\n\n this.screen = null;\n\n this.resolution = 0;\n\n this.transparent = false;\n\n this.autoResize = false;\n\n this.blendModes = null;\n\n this.options = null;\n\n this.preserveDrawingBuffer = false;\n this.clearBeforeRender = false;\n\n this.roundPixels = false;\n\n this._backgroundColor = 0;\n this._backgroundColorRgba = null;\n this._backgroundColorString = null;\n\n this._tempDisplayObjectParent = null;\n this._lastObjectRendered = null;\n };\n\n /**\n * The background color to fill if not transparent\n *\n * @member {number}\n */\n\n\n _createClass(SystemRenderer, [{\n key: 'width',\n get: function get() {\n return this.view.width;\n }\n\n /**\n * Same as view.height, actual number of pixels in the canvas by vertical\n *\n * @member {number}\n * @readonly\n * @default 600\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.view.height;\n }\n }, {\n key: 'backgroundColor',\n get: function get() {\n return this._backgroundColor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._backgroundColor = value;\n this._backgroundColorString = (0, _utils.hex2string)(value);\n (0, _utils.hex2rgb)(value, this._backgroundColorRgba);\n }\n }]);\n\n return SystemRenderer;\n}(_eventemitter2.default);\n\nexports.default = SystemRenderer;\n//# sourceMappingURL=SystemRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/SystemRenderer.js\n// module id = 243\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _settings = require('../../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Creates a Canvas element of the given size.\n *\n * @class\n * @memberof PIXI\n */\nvar CanvasRenderTarget = function () {\n /**\n * @param {number} width - the width for the newly created canvas\n * @param {number} height - the height for the newly created canvas\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the canvas\n */\n function CanvasRenderTarget(width, height, resolution) {\n _classCallCheck(this, CanvasRenderTarget);\n\n /**\n * The Canvas object that belongs to this CanvasRenderTarget.\n *\n * @member {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas');\n\n /**\n * A CanvasRenderingContext2D object representing a two-dimensional rendering context.\n *\n * @member {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d');\n\n this.resolution = resolution || _settings2.default.RESOLUTION;\n\n this.resize(width, height);\n }\n\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n *\n * @private\n */\n\n\n CanvasRenderTarget.prototype.clear = function clear() {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n };\n\n /**\n * Resizes the canvas to the specified width and height.\n *\n * @param {number} width - the new width of the canvas\n * @param {number} height - the new height of the canvas\n */\n\n\n CanvasRenderTarget.prototype.resize = function resize(width, height) {\n this.canvas.width = width * this.resolution;\n this.canvas.height = height * this.resolution;\n };\n\n /**\n * Destroys this canvas.\n *\n */\n\n\n CanvasRenderTarget.prototype.destroy = function destroy() {\n this.context = null;\n this.canvas = null;\n };\n\n /**\n * The width of the canvas buffer in pixels.\n *\n * @member {number}\n */\n\n\n _createClass(CanvasRenderTarget, [{\n key: 'width',\n get: function get() {\n return this.canvas.width;\n },\n set: function set(val) // eslint-disable-line require-jsdoc\n {\n this.canvas.width = val;\n }\n\n /**\n * The height of the canvas buffer in pixels.\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this.canvas.height;\n },\n set: function set(val) // eslint-disable-line require-jsdoc\n {\n this.canvas.height = val;\n }\n }]);\n\n return CanvasRenderTarget;\n}();\n\nexports.default = CanvasRenderTarget;\n//# sourceMappingURL=CanvasRenderTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/CanvasRenderTarget.js\n// module id = 244\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = canUseNewCanvasBlendModes;\n/**\n * Creates a little colored canvas\n *\n * @ignore\n * @param {string} color - The color to make the canvas\n * @return {canvas} a small canvas element\n */\nfunction createColoredCanvas(color) {\n var canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n var context = canvas.getContext('2d');\n\n context.fillStyle = color;\n context.fillRect(0, 0, 6, 1);\n\n return canvas;\n}\n\n/**\n * Checks whether the Canvas BlendModes are supported by the current browser\n *\n * @return {boolean} whether they are supported\n */\nfunction canUseNewCanvasBlendModes() {\n if (typeof document === 'undefined') {\n return false;\n }\n\n var magenta = createColoredCanvas('#ff00ff');\n var yellow = createColoredCanvas('#ffff00');\n\n var canvas = document.createElement('canvas');\n\n canvas.width = 6;\n canvas.height = 1;\n\n var context = canvas.getContext('2d');\n\n context.globalCompositeOperation = 'multiply';\n context.drawImage(magenta, 0, 0);\n context.drawImage(yellow, 2, 0);\n\n var imageData = context.getImageData(2, 0, 1, 1);\n\n if (!imageData) {\n return false;\n }\n\n var data = imageData.data;\n\n return data[0] === 255 && data[1] === 0 && data[2] === 0;\n}\n//# sourceMappingURL=canUseNewCanvasBlendModes.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/canUseNewCanvasBlendModes.js\n// module id = 245\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extractUniformsFromSrc = require('./extractUniformsFromSrc');\n\nvar _extractUniformsFromSrc2 = _interopRequireDefault(_extractUniformsFromSrc);\n\nvar _utils = require('../../../utils');\n\nvar _const = require('../../../const');\n\nvar _settings = require('../../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SOURCE_KEY_MAP = {};\n\n// let math = require('../../../math');\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\n\nvar Filter = function () {\n /**\n * @param {string} [vertexSrc] - The source of the vertex shader.\n * @param {string} [fragmentSrc] - The source of the fragment shader.\n * @param {object} [uniforms] - Custom uniforms to use to augment the built-in ones.\n */\n function Filter(vertexSrc, fragmentSrc, uniforms) {\n _classCallCheck(this, Filter);\n\n /**\n * The vertex shader.\n *\n * @member {string}\n */\n this.vertexSrc = vertexSrc || Filter.defaultVertexSrc;\n\n /**\n * The fragment shader.\n *\n * @member {string}\n */\n this.fragmentSrc = fragmentSrc || Filter.defaultFragmentSrc;\n\n this._blendMode = _const.BLEND_MODES.NORMAL;\n\n this.uniformData = uniforms || (0, _extractUniformsFromSrc2.default)(this.vertexSrc, this.fragmentSrc, 'projectionMatrix|uSampler');\n\n /**\n * An object containing the current values of custom uniforms.\n * @example Updating the value of a custom uniform\n * filter.uniforms.time = performance.now();\n *\n * @member {object}\n */\n this.uniforms = {};\n\n for (var i in this.uniformData) {\n this.uniforms[i] = this.uniformData[i].value;\n if (this.uniformData[i].type) {\n this.uniformData[i].type = this.uniformData[i].type.toLowerCase();\n }\n }\n\n // this is where we store shader references..\n // TODO we could cache this!\n this.glShaders = {};\n\n // used for cacheing.. sure there is a better way!\n if (!SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc]) {\n SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc] = (0, _utils.uid)();\n }\n\n this.glShaderKey = SOURCE_KEY_MAP[this.vertexSrc + this.fragmentSrc];\n\n /**\n * The padding of the filter. Some filters require extra space to breath such as a blur.\n * Increasing this will add extra width and height to the bounds of the object that the\n * filter is applied to.\n *\n * @member {number}\n */\n this.padding = 4;\n\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n *\n * @member {number}\n */\n this.resolution = _settings2.default.RESOLUTION;\n\n /**\n * If enabled is true the filter is applied, if false it will not.\n *\n * @member {boolean}\n */\n this.enabled = true;\n\n /**\n * If enabled, PixiJS will fit the filter area into boundaries for better performance.\n * Switch it off if it does not work for specific shader.\n *\n * @member {boolean}\n */\n this.autoFit = true;\n }\n\n /**\n * Applies the filter\n *\n * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n * @param {boolean} clear - Should the output be cleared before rendering to it\n * @param {object} [currentState] - It's current state of filter.\n * There are some useful properties in the currentState :\n * target, filters, sourceFrame, destinationFrame, renderTarget, resolution\n */\n\n\n Filter.prototype.apply = function apply(filterManager, input, output, clear, currentState) // eslint-disable-line no-unused-vars\n {\n // --- //\n // this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(tempMatrix, window.panda );\n\n // do as you please!\n\n filterManager.applyFilter(this, input, output, clear);\n\n // or just do a regular render..\n };\n\n /**\n * Sets the blendmode of the filter\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n */\n\n\n _createClass(Filter, [{\n key: 'blendMode',\n get: function get() {\n return this._blendMode;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._blendMode = value;\n }\n\n /**\n * The default vertex shader source\n *\n * @static\n * @constant\n */\n\n }], [{\n key: 'defaultVertexSrc',\n get: function get() {\n return ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 projectionMatrix;', 'uniform mat3 filterMatrix;', 'varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;', ' vTextureCoord = aTextureCoord ;', '}'].join('\\n');\n }\n\n /**\n * The default fragment shader source\n *\n * @static\n * @constant\n */\n\n }, {\n key: 'defaultFragmentSrc',\n get: function get() {\n return ['varying vec2 vTextureCoord;', 'varying vec2 vFilterCoord;', 'uniform sampler2D uSampler;', 'uniform sampler2D filterSampler;', 'void main(void){', ' vec4 masky = texture2D(filterSampler, vFilterCoord);', ' vec4 sample = texture2D(uSampler, vTextureCoord);', ' vec4 color;', ' if(mod(vFilterCoord.x, 1.0) > 0.5)', ' {', ' color = vec4(1.0, 0.0, 0.0, 1.0);', ' }', ' else', ' {', ' color = vec4(0.0, 1.0, 0.0, 1.0);', ' }',\n // ' gl_FragColor = vec4(mod(vFilterCoord.x, 1.5), vFilterCoord.y,0.0,1.0);',\n ' gl_FragColor = mix(sample, masky, 0.5);', ' gl_FragColor *= sample.a;', '}'].join('\\n');\n }\n }]);\n\n return Filter;\n}();\n\nexports.default = Filter;\n//# sourceMappingURL=Filter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/Filter.js\n// module id = 246\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Filter2 = require('../Filter');\n\nvar _Filter3 = _interopRequireDefault(_Filter2);\n\nvar _math = require('../../../../math');\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The SpriteMaskFilter class\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI\n */\nvar SpriteMaskFilter = function (_Filter) {\n _inherits(SpriteMaskFilter, _Filter);\n\n /**\n * @param {PIXI.Sprite} sprite - the target sprite\n */\n function SpriteMaskFilter(sprite) {\n _classCallCheck(this, SpriteMaskFilter);\n\n var maskMatrix = new _math.Matrix();\n\n var _this = _possibleConstructorReturn(this, _Filter.call(this, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 otherMatrix;\\n\\nvarying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n}\\n', 'varying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\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\\n float clip = 1.0 - max(text.y, text.x);\\n vec4 original = texture2D(uSampler, vTextureCoord);\\n vec4 masky = texture2D(mask, vMaskCoord);\\n\\n original *= (masky.r * masky.a * alpha * clip);\\n\\n gl_FragColor = original;\\n}\\n'));\n\n sprite.renderable = false;\n\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n return _this;\n }\n\n /**\n * Applies the filter\n *\n * @param {PIXI.FilterManager} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n */\n\n\n SpriteMaskFilter.prototype.apply = function apply(filterManager, input, output) {\n var maskSprite = this.maskSprite;\n\n this.uniforms.mask = maskSprite._texture;\n this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite);\n this.uniforms.alpha = maskSprite.worldAlpha;\n\n filterManager.applyFilter(this, input, output);\n };\n\n return SpriteMaskFilter;\n}(_Filter3.default);\n\nexports.default = SpriteMaskFilter;\n//# sourceMappingURL=SpriteMaskFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/spriteMask/SpriteMaskFilter.js\n// module id = 247\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _createIndicesForQuads = require('../../../utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class to create a quad\n *\n * @class\n * @memberof PIXI\n */\nvar Quad = function () {\n /**\n * @param {WebGLRenderingContext} gl - The gl context for this quad to use.\n * @param {object} state - TODO: Description\n */\n function Quad(gl, state) {\n _classCallCheck(this, Quad);\n\n /**\n * the current WebGL drawing context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * An array of vertices\n *\n * @member {Float32Array}\n */\n this.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1]);\n\n /**\n * The Uvs of the quad\n *\n * @member {Float32Array}\n */\n this.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n\n this.interleaved = new Float32Array(8 * 2);\n\n for (var i = 0; i < 4; i++) {\n this.interleaved[i * 4] = this.vertices[i * 2];\n this.interleaved[i * 4 + 1] = this.vertices[i * 2 + 1];\n this.interleaved[i * 4 + 2] = this.uvs[i * 2];\n this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1];\n }\n\n /**\n * An array containing the indices of the vertices\n *\n * @member {Uint16Array}\n */\n this.indices = (0, _createIndicesForQuads2.default)(1);\n\n /**\n * The vertex buffer\n *\n * @member {glCore.GLBuffer}\n */\n this.vertexBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, this.interleaved, gl.STATIC_DRAW);\n\n /**\n * The index buffer\n *\n * @member {glCore.GLBuffer}\n */\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n /**\n * The vertex array object\n *\n * @member {glCore.VertexArrayObject}\n */\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, state);\n }\n\n /**\n * Initialises the vaos and uses the shader.\n *\n * @param {PIXI.Shader} shader - the shader to use\n */\n\n\n Quad.prototype.initVao = function initVao(shader) {\n this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer, shader.attributes.aVertexPosition, this.gl.FLOAT, false, 4 * 4, 0).addAttribute(this.vertexBuffer, shader.attributes.aTextureCoord, this.gl.FLOAT, false, 4 * 4, 2 * 4);\n };\n\n /**\n * Maps two Rectangle to the quad.\n *\n * @param {PIXI.Rectangle} targetTextureFrame - the first rectangle\n * @param {PIXI.Rectangle} destinationFrame - the second rectangle\n * @return {PIXI.Quad} Returns itself.\n */\n\n\n Quad.prototype.map = function map(targetTextureFrame, destinationFrame) {\n var x = 0; // destinationFrame.x / targetTextureFrame.width;\n var y = 0; // destinationFrame.y / targetTextureFrame.height;\n\n this.uvs[0] = x;\n this.uvs[1] = y;\n\n this.uvs[2] = x + destinationFrame.width / targetTextureFrame.width;\n this.uvs[3] = y;\n\n this.uvs[4] = x + destinationFrame.width / targetTextureFrame.width;\n this.uvs[5] = y + destinationFrame.height / targetTextureFrame.height;\n\n this.uvs[6] = x;\n this.uvs[7] = y + destinationFrame.height / targetTextureFrame.height;\n\n x = destinationFrame.x;\n y = destinationFrame.y;\n\n this.vertices[0] = x;\n this.vertices[1] = y;\n\n this.vertices[2] = x + destinationFrame.width;\n this.vertices[3] = y;\n\n this.vertices[4] = x + destinationFrame.width;\n this.vertices[5] = y + destinationFrame.height;\n\n this.vertices[6] = x;\n this.vertices[7] = y + destinationFrame.height;\n\n return this;\n };\n\n /**\n * Binds the buffer and uploads the data\n *\n * @return {PIXI.Quad} Returns itself.\n */\n\n\n Quad.prototype.upload = function upload() {\n for (var i = 0; i < 4; i++) {\n this.interleaved[i * 4] = this.vertices[i * 2];\n this.interleaved[i * 4 + 1] = this.vertices[i * 2 + 1];\n this.interleaved[i * 4 + 2] = this.uvs[i * 2];\n this.interleaved[i * 4 + 3] = this.uvs[i * 2 + 1];\n }\n\n this.vertexBuffer.upload(this.interleaved);\n\n return this;\n };\n\n /**\n * Removes this quad from WebGL\n */\n\n\n Quad.prototype.destroy = function destroy() {\n var gl = this.gl;\n\n gl.deleteBuffer(this.vertexBuffer);\n gl.deleteBuffer(this.indexBuffer);\n };\n\n return Quad;\n}();\n\nexports.default = Quad;\n//# sourceMappingURL=Quad.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/Quad.js\n// module id = 248\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * @class\n * @memberOf PIXI\n */\nvar TextMetrics = function () {\n /**\n * @param {string} text - the text that was measured\n * @param {PIXI.TextStyle} style - the style that was measured\n * @param {number} width - the measured width of the text\n * @param {number} height - the measured height of the text\n * @param {array} lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param {array} lineWidths - an array of the line widths for each line matched to `lines`\n * @param {number} lineHeight - the measured line height for this style\n * @param {number} maxLineWidth - the maximum line width for all measured lines\n * @param {Object} fontProperties - the font properties object from TextMetrics.measureFont\n */\n function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) {\n _classCallCheck(this, TextMetrics);\n\n this.text = text;\n this.style = style;\n this.width = width;\n this.height = height;\n this.lines = lines;\n this.lineWidths = lineWidths;\n this.lineHeight = lineHeight;\n this.maxLineWidth = maxLineWidth;\n this.fontProperties = fontProperties;\n }\n\n /**\n * Measures the supplied string of text and returns a Rectangle.\n *\n * @param {string} text - the text to measure.\n * @param {PIXI.TextStyle} style - the text style to use for measuring\n * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text.\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {PIXI.TextMetrics} measured width and height of the text.\n */\n\n\n TextMetrics.measureText = function measureText(text, style, wordWrap) {\n var canvas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : TextMetrics._canvas;\n\n wordWrap = wordWrap || style.wordWrap;\n var font = style.toFontString();\n var fontProperties = TextMetrics.measureFont(font);\n var context = canvas.getContext('2d');\n\n context.font = font;\n\n var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * style.letterSpacing;\n\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n var width = maxLineWidth + style.strokeThickness;\n\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness) + (lines.length - 1) * (lineHeight + style.leading);\n\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n\n return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties);\n };\n\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n *\n * @private\n * @param {string} text - String to apply word wrapping to\n * @param {PIXI.TextStyle} style - the style to use when wrapping\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {string} New string with new lines applied where required\n */\n\n\n TextMetrics.wordWrap = function wordWrap(text, style) {\n var canvas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TextMetrics._canvas;\n\n var context = canvas.getContext('2d');\n\n // Greedy wrapping algorithm that will wrap words as the line grows longer\n // than its horizontal bounds.\n var result = '';\n var lines = text.split('\\n');\n var wordWrapWidth = style.wordWrapWidth;\n var characterCache = {};\n\n for (var i = 0; i < lines.length; i++) {\n var spaceLeft = wordWrapWidth;\n var words = lines[i].split(' ');\n\n for (var j = 0; j < words.length; j++) {\n var wordWidth = context.measureText(words[j]).width;\n\n if (style.breakWords && wordWidth > wordWrapWidth) {\n // Word should be split in the middle\n var characters = words[j].split('');\n\n for (var c = 0; c < characters.length; c++) {\n var character = characters[c];\n var characterWidth = characterCache[character];\n\n if (characterWidth === undefined) {\n characterWidth = context.measureText(character).width;\n characterCache[character] = characterWidth;\n }\n\n if (characterWidth > spaceLeft) {\n result += '\\n' + character;\n spaceLeft = wordWrapWidth - characterWidth;\n } else {\n if (c === 0) {\n result += ' ';\n }\n\n result += character;\n spaceLeft -= characterWidth;\n }\n }\n } else {\n var wordWidthWithSpace = wordWidth + context.measureText(' ').width;\n\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is\n // greater than the word wrap width.\n if (j > 0) {\n result += '\\n';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth;\n } else {\n spaceLeft -= wordWidthWithSpace;\n result += ' ' + words[j];\n }\n }\n }\n\n if (i < lines.length - 1) {\n result += '\\n';\n }\n }\n\n return result;\n };\n\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n *\n * @static\n * @param {string} font - String representing the style of the font\n * @return {PIXI.TextMetrics~FontMetrics} Font properties object\n */\n\n\n TextMetrics.measureFont = function measureFont(font) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font]) {\n return TextMetrics._fonts[font];\n }\n\n var properties = {};\n\n var canvas = TextMetrics._canvas;\n var context = TextMetrics._context;\n\n context.font = font;\n\n var width = Math.ceil(context.measureText('|MÉq').width);\n var baseline = Math.ceil(context.measureText('M').width);\n var height = 2 * baseline;\n\n baseline = baseline * 1.4 | 0;\n\n canvas.width = width;\n canvas.height = height;\n\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n\n context.font = font;\n\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText('|MÉq', 0, baseline);\n\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n\n var i = 0;\n var idx = 0;\n var stop = false;\n\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n } else {\n break;\n }\n }\n\n properties.ascent = baseline - i;\n\n idx = pixels - line;\n stop = false;\n\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var _j = 0; _j < line; _j += 4) {\n if (imagedata[idx + _j] !== 255) {\n stop = true;\n break;\n }\n }\n\n if (!stop) {\n idx -= line;\n } else {\n break;\n }\n }\n\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n\n TextMetrics._fonts[font] = properties;\n\n return properties;\n };\n\n return TextMetrics;\n}();\n\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n * @class FontMetrics\n * @memberof PIXI.TextMetrics~\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n */\n\nexports.default = TextMetrics;\nvar canvas = document.createElement('canvas');\n\ncanvas.width = canvas.height = 10;\n\n/**\n * Cached canvas element for measuring text\n * @memberof PIXI.TextMetrics\n * @type {HTMLCanvasElement}\n * @private\n */\nTextMetrics._canvas = canvas;\n\n/**\n * Cache for context to use.\n * @memberof PIXI.TextMetrics\n * @type {CanvasRenderingContext2D}\n * @private\n */\nTextMetrics._context = canvas.getContext('2d');\n\n/**\n * Cache of PIXI.TextMetrics~FontMetrics objects.\n * @memberof PIXI.TextMetrics\n * @type {Object}\n * @private\n */\nTextMetrics._fonts = {};\n//# sourceMappingURL=TextMetrics.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/text/TextMetrics.js\n// module id = 249\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // disabling eslint for now, going to rewrite this in v5\n/* eslint-disable */\n\nvar _const = require('../const');\n\nvar _utils = require('../utils');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: _const.TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0\n};\n\n/**\n * A TextStyle Object decorates a Text Object. It can be shared between\n * multiple Text objects. Changing the style will update all text objects using it.\n *\n * @class\n * @memberof PIXI\n */\n\nvar TextStyle = function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', 800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Default is 'miter' (creates a sharp corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n _classCallCheck(this, TextStyle);\n\n this.styleID = 0;\n\n Object.assign(this, defaultStyle, style);\n }\n\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return {PIXI.TextStyle} New cloned TextStyle object\n */\n\n\n TextStyle.prototype.clone = function clone() {\n var clonedProperties = {};\n\n for (var key in defaultStyle) {\n clonedProperties[key] = this[key];\n }\n\n return new TextStyle(clonedProperties);\n };\n\n /**\n * Resets all properties to the defaults specified in TextStyle.prototype._default\n */\n\n\n TextStyle.prototype.reset = function reset() {\n Object.assign(this, defaultStyle);\n };\n\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n\n\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return {string} Font style string, for passing to `TextMetrics.measureFont()`\n */\n TextStyle.prototype.toFontString = function toFontString() {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n var fontSizeString = typeof this.fontSize === 'number' ? this.fontSize + 'px' : this.fontSize;\n\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = this.fontFamily;\n\n if (!Array.isArray(this.fontFamily)) {\n fontFamilies = this.fontFamily.split(',');\n }\n\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n\n // Check if font already contains strings\n if (!/([\\\"\\'])[^\\'\\\"]+\\1/.test(fontFamily)) {\n fontFamily = '\"' + fontFamily + '\"';\n }\n fontFamilies[i] = fontFamily;\n }\n\n return this.fontStyle + ' ' + this.fontVariant + ' ' + this.fontWeight + ' ' + fontSizeString + ' ' + fontFamilies.join(',');\n };\n\n _createClass(TextStyle, [{\n key: 'align',\n get: function get() {\n return this._align;\n },\n set: function set(align) // eslint-disable-line require-jsdoc\n {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n }\n\n /**\n * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true\n *\n * @member {boolean}\n */\n\n }, {\n key: 'breakWords',\n get: function get() {\n return this._breakWords;\n },\n set: function set(breakWords) // eslint-disable-line require-jsdoc\n {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n }\n\n /**\n * Set a drop shadow for the text\n *\n * @member {boolean}\n */\n\n }, {\n key: 'dropShadow',\n get: function get() {\n return this._dropShadow;\n },\n set: function set(dropShadow) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n }\n\n /**\n * Set alpha for the drop shadow\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowAlpha',\n get: function get() {\n return this._dropShadowAlpha;\n },\n set: function set(dropShadowAlpha) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowAlpha !== dropShadowAlpha) {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n }\n\n /**\n * Set a angle of the drop shadow\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowAngle',\n get: function get() {\n return this._dropShadowAngle;\n },\n set: function set(dropShadowAngle) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n }\n\n /**\n * Set a shadow blur radius\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowBlur',\n get: function get() {\n return this._dropShadowBlur;\n },\n set: function set(dropShadowBlur) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n }\n\n /**\n * A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n *\n * @member {string|number}\n */\n\n }, {\n key: 'dropShadowColor',\n get: function get() {\n return this._dropShadowColor;\n },\n set: function set(dropShadowColor) // eslint-disable-line require-jsdoc\n {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * Set a distance of the drop shadow\n *\n * @member {number}\n */\n\n }, {\n key: 'dropShadowDistance',\n get: function get() {\n return this._dropShadowDistance;\n },\n set: function set(dropShadowDistance) // eslint-disable-line require-jsdoc\n {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n }\n\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n\n }, {\n key: 'fill',\n get: function get() {\n return this._fill;\n },\n set: function set(fill) // eslint-disable-line require-jsdoc\n {\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n * See {@link PIXI.TEXT_GRADIENT}\n *\n * @member {number}\n */\n\n }, {\n key: 'fillGradientType',\n get: function get() {\n return this._fillGradientType;\n },\n set: function set(fillGradientType) // eslint-disable-line require-jsdoc\n {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n }\n\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n *\n * @member {number[]}\n */\n\n }, {\n key: 'fillGradientStops',\n get: function get() {\n return this._fillGradientStops;\n },\n set: function set(fillGradientStops) // eslint-disable-line require-jsdoc\n {\n if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n }\n\n /**\n * The font family\n *\n * @member {string|string[]}\n */\n\n }, {\n key: 'fontFamily',\n get: function get() {\n return this._fontFamily;\n },\n set: function set(fontFamily) // eslint-disable-line require-jsdoc\n {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n }\n\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n *\n * @member {number|string}\n */\n\n }, {\n key: 'fontSize',\n get: function get() {\n return this._fontSize;\n },\n set: function set(fontSize) // eslint-disable-line require-jsdoc\n {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n }\n\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n\n }, {\n key: 'fontStyle',\n get: function get() {\n return this._fontStyle;\n },\n set: function set(fontStyle) // eslint-disable-line require-jsdoc\n {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n }\n\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n\n }, {\n key: 'fontVariant',\n get: function get() {\n return this._fontVariant;\n },\n set: function set(fontVariant) // eslint-disable-line require-jsdoc\n {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n }\n\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n\n }, {\n key: 'fontWeight',\n get: function get() {\n return this._fontWeight;\n },\n set: function set(fontWeight) // eslint-disable-line require-jsdoc\n {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n }\n\n /**\n * The amount of spacing between letters, default is 0\n *\n * @member {number}\n */\n\n }, {\n key: 'letterSpacing',\n get: function get() {\n return this._letterSpacing;\n },\n set: function set(letterSpacing) // eslint-disable-line require-jsdoc\n {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n }\n\n /**\n * The line height, a number that represents the vertical space that a letter uses\n *\n * @member {number}\n */\n\n }, {\n key: 'lineHeight',\n get: function get() {\n return this._lineHeight;\n },\n set: function set(lineHeight) // eslint-disable-line require-jsdoc\n {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n }\n\n /**\n * The space between lines\n *\n * @member {number}\n */\n\n }, {\n key: 'leading',\n get: function get() {\n return this._leading;\n },\n set: function set(leading) // eslint-disable-line require-jsdoc\n {\n if (this._leading !== leading) {\n this._leading = leading;\n this.styleID++;\n }\n }\n\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n\n }, {\n key: 'lineJoin',\n get: function get() {\n return this._lineJoin;\n },\n set: function set(lineJoin) // eslint-disable-line require-jsdoc\n {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n }\n\n /**\n * The miter limit to use when using the 'miter' lineJoin mode\n * This can reduce or increase the spikiness of rendered text.\n *\n * @member {number}\n */\n\n }, {\n key: 'miterLimit',\n get: function get() {\n return this._miterLimit;\n },\n set: function set(miterLimit) // eslint-disable-line require-jsdoc\n {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n }\n\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n *\n * @member {number}\n */\n\n }, {\n key: 'padding',\n get: function get() {\n return this._padding;\n },\n set: function set(padding) // eslint-disable-line require-jsdoc\n {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n }\n\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n *\n * @member {string|number}\n */\n\n }, {\n key: 'stroke',\n get: function get() {\n return this._stroke;\n },\n set: function set(stroke) // eslint-disable-line require-jsdoc\n {\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n }\n\n /**\n * A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n *\n * @member {number}\n */\n\n }, {\n key: 'strokeThickness',\n get: function get() {\n return this._strokeThickness;\n },\n set: function set(strokeThickness) // eslint-disable-line require-jsdoc\n {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n }\n\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n\n }, {\n key: 'textBaseline',\n get: function get() {\n return this._textBaseline;\n },\n set: function set(textBaseline) // eslint-disable-line require-jsdoc\n {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n }\n\n /**\n * Trim transparent borders\n *\n * @member {boolean}\n */\n\n }, {\n key: 'trim',\n get: function get() {\n return this._trim;\n },\n set: function set(trim) // eslint-disable-line require-jsdoc\n {\n if (this._trim !== trim) {\n this._trim = trim;\n this.styleID++;\n }\n }\n\n /**\n * Indicates if word wrap should be used\n *\n * @member {boolean}\n */\n\n }, {\n key: 'wordWrap',\n get: function get() {\n return this._wordWrap;\n },\n set: function set(wordWrap) // eslint-disable-line require-jsdoc\n {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n }\n\n /**\n * The width at which text will wrap, it needs wordWrap to be set to true\n *\n * @member {number}\n */\n\n }, {\n key: 'wordWrapWidth',\n get: function get() {\n return this._wordWrapWidth;\n },\n set: function set(wordWrapWidth) // eslint-disable-line require-jsdoc\n {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n }\n }]);\n\n return TextStyle;\n}();\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n *\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\n\n\nexports.default = TextStyle;\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return (0, _utils.hex2string)(color);\n } else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n\n return color;\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n *\n * @param {number|number[]} color\n * @return {string} The color as a string.\n */\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n } else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n\n return color;\n }\n}\n\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n *\n * @param {Array} array1 First array to compare\n * @param {Array} array2 Second array to compare\n * @return {boolean} Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n\n return true;\n}\n//# sourceMappingURL=TextStyle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/text/TextStyle.js\n// module id = 250\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _BaseTexture2 = require('./BaseTexture');\n\nvar _BaseTexture3 = _interopRequireDefault(_BaseTexture2);\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer(1024, 1024, { view: canvas, ratio: 1 });\n * let baseRenderTexture = new PIXI.BaseRenderTexture(renderer, 800, 600);\n * let sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * baseRenderTexture.render(sprite);\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture(100, 100);\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(sprite, renderTexture); // Renders to center of RenderTexture\n * ```\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nvar BaseRenderTexture = function (_BaseTexture) {\n _inherits(BaseRenderTexture, _BaseTexture);\n\n /**\n * @param {number} [width=100] - The width of the base render texture\n * @param {number} [height=100] - The height of the base render texture\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the texture being generated\n */\n function BaseRenderTexture() {\n var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var scaleMode = arguments[2];\n var resolution = arguments[3];\n\n _classCallCheck(this, BaseRenderTexture);\n\n var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, null, scaleMode));\n\n _this.resolution = resolution || _settings2.default.RESOLUTION;\n\n _this.width = width;\n _this.height = height;\n\n _this.realWidth = _this.width * _this.resolution;\n _this.realHeight = _this.height * _this.resolution;\n\n _this.scaleMode = scaleMode !== undefined ? scaleMode : _settings2.default.SCALE_MODE;\n _this.hasLoaded = true;\n\n /**\n * A map of renderer IDs to webgl renderTargets\n *\n * @private\n * @member {object}\n */\n _this._glRenderTargets = {};\n\n /**\n * A reference to the canvas render target (we only need one as this can be shared across renderers)\n *\n * @private\n * @member {object}\n */\n _this._canvasRenderTarget = null;\n\n /**\n * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.\n *\n * @member {boolean}\n */\n _this.valid = false;\n return _this;\n }\n\n /**\n * Resizes the BaseRenderTexture.\n *\n * @param {number} width - The width to resize to.\n * @param {number} height - The height to resize to.\n */\n\n\n BaseRenderTexture.prototype.resize = function resize(width, height) {\n if (width === this.width && height === this.height) {\n return;\n }\n\n this.valid = width > 0 && height > 0;\n\n this.width = width;\n this.height = height;\n\n this.realWidth = this.width * this.resolution;\n this.realHeight = this.height * this.resolution;\n\n if (!this.valid) {\n return;\n }\n\n this.emit('update', this);\n };\n\n /**\n * Destroys this texture\n *\n */\n\n\n BaseRenderTexture.prototype.destroy = function destroy() {\n _BaseTexture.prototype.destroy.call(this, true);\n this.renderer = null;\n };\n\n return BaseRenderTexture;\n}(_BaseTexture3.default);\n\nexports.default = BaseRenderTexture;\n//# sourceMappingURL=BaseRenderTexture.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/BaseRenderTexture.js\n// module id = 251\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _GroupD = require('../math/GroupD8');\n\nvar _GroupD2 = _interopRequireDefault(_GroupD);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A standard object to store the Uvs of a texture\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar TextureUvs = function () {\n /**\n *\n */\n function TextureUvs() {\n _classCallCheck(this, TextureUvs);\n\n this.x0 = 0;\n this.y0 = 0;\n\n this.x1 = 1;\n this.y1 = 0;\n\n this.x2 = 1;\n this.y2 = 1;\n\n this.x3 = 0;\n this.y3 = 1;\n\n this.uvsUint32 = new Uint32Array(4);\n }\n\n /**\n * Sets the texture Uvs based on the given frame information.\n *\n * @private\n * @param {PIXI.Rectangle} frame - The frame of the texture\n * @param {PIXI.Rectangle} baseFrame - The base frame of the texture\n * @param {number} rotate - Rotation of frame, see {@link PIXI.GroupD8}\n */\n\n\n TextureUvs.prototype.set = function set(frame, baseFrame, rotate) {\n var tw = baseFrame.width;\n var th = baseFrame.height;\n\n if (rotate) {\n // width and height div 2 div baseFrame size\n var w2 = frame.width / 2 / tw;\n var h2 = frame.height / 2 / th;\n\n // coordinates of center\n var cX = frame.x / tw + w2;\n var cY = frame.y / th + h2;\n\n rotate = _GroupD2.default.add(rotate, _GroupD2.default.NW); // NW is top-left corner\n this.x0 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y0 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2); // rotate 90 degrees clockwise\n this.x1 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y1 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2);\n this.x2 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y2 = cY + h2 * _GroupD2.default.uY(rotate);\n\n rotate = _GroupD2.default.add(rotate, 2);\n this.x3 = cX + w2 * _GroupD2.default.uX(rotate);\n this.y3 = cY + h2 * _GroupD2.default.uY(rotate);\n } else {\n this.x0 = frame.x / tw;\n this.y0 = frame.y / th;\n\n this.x1 = (frame.x + frame.width) / tw;\n this.y1 = frame.y / th;\n\n this.x2 = (frame.x + frame.width) / tw;\n this.y2 = (frame.y + frame.height) / th;\n\n this.x3 = frame.x / tw;\n this.y3 = (frame.y + frame.height) / th;\n }\n\n this.uvsUint32[0] = (this.y0 * 65535 & 0xFFFF) << 16 | this.x0 * 65535 & 0xFFFF;\n this.uvsUint32[1] = (this.y1 * 65535 & 0xFFFF) << 16 | this.x1 * 65535 & 0xFFFF;\n this.uvsUint32[2] = (this.y2 * 65535 & 0xFFFF) << 16 | this.x2 * 65535 & 0xFFFF;\n this.uvsUint32[3] = (this.y3 * 65535 & 0xFFFF) << 16 | this.x3 * 65535 & 0xFFFF;\n };\n\n return TextureUvs;\n}();\n\nexports.default = TextureUvs;\n//# sourceMappingURL=TextureUvs.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/TextureUvs.js\n// module id = 252\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _BaseTexture2 = require('./BaseTexture');\n\nvar _BaseTexture3 = _interopRequireDefault(_BaseTexture2);\n\nvar _utils = require('../utils');\n\nvar _ticker = require('../ticker');\n\nvar _const = require('../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A texture of a [playing] Video.\n *\n * Video base textures mimic PixiJS BaseTexture.from.... method in their creation process.\n *\n * This can be used in several ways, such as:\n *\n * ```js\n * let texture = PIXI.VideoBaseTexture.fromUrl('http://mydomain.com/video.mp4');\n *\n * let texture = PIXI.VideoBaseTexture.fromUrl({ src: 'http://mydomain.com/video.mp4', mime: 'video/mp4' });\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls(['/video.webm', '/video.mp4']);\n *\n * let texture = PIXI.VideoBaseTexture.fromUrls([\n * { src: '/video.webm', mime: 'video/webm' },\n * { src: '/video.mp4', mime: 'video/mp4' }\n * ]);\n * ```\n *\n * See the [\"deus\" demo](http://www.goodboydigital.com/pixijs/examples/deus/).\n *\n * @class\n * @extends PIXI.BaseTexture\n * @memberof PIXI\n */\nvar VideoBaseTexture = function (_BaseTexture) {\n _inherits(VideoBaseTexture, _BaseTexture);\n\n /**\n * @param {HTMLVideoElement} source - Video source\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n */\n function VideoBaseTexture(source, scaleMode) {\n _classCallCheck(this, VideoBaseTexture);\n\n if (!source) {\n throw new Error('No video source element specified.');\n }\n\n // hook in here to check if video is already available.\n // BaseTexture looks for a source.complete boolean, plus width & height.\n\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA) && source.width && source.height) {\n source.complete = true;\n }\n\n var _this = _possibleConstructorReturn(this, _BaseTexture.call(this, source, scaleMode));\n\n _this.width = source.videoWidth;\n _this.height = source.videoHeight;\n\n _this._autoUpdate = true;\n _this._isAutoUpdating = false;\n\n /**\n * When set to true will automatically play videos used by this texture once\n * they are loaded. If false, it will not modify the playing state.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPlay = true;\n\n _this.update = _this.update.bind(_this);\n _this._onCanPlay = _this._onCanPlay.bind(_this);\n\n source.addEventListener('play', _this._onPlayStart.bind(_this));\n source.addEventListener('pause', _this._onPlayStop.bind(_this));\n _this.hasLoaded = false;\n _this.__loaded = false;\n\n if (!_this._isSourceReady()) {\n source.addEventListener('canplay', _this._onCanPlay);\n source.addEventListener('canplaythrough', _this._onCanPlay);\n } else {\n _this._onCanPlay();\n }\n return _this;\n }\n\n /**\n * Returns true if the underlying source is playing.\n *\n * @private\n * @return {boolean} True if playing.\n */\n\n\n VideoBaseTexture.prototype._isSourcePlaying = function _isSourcePlaying() {\n var source = this.source;\n\n return source.currentTime > 0 && source.paused === false && source.ended === false && source.readyState > 2;\n };\n\n /**\n * Returns true if the underlying source is ready for playing.\n *\n * @private\n * @return {boolean} True if ready.\n */\n\n\n VideoBaseTexture.prototype._isSourceReady = function _isSourceReady() {\n return this.source.readyState === 3 || this.source.readyState === 4;\n };\n\n /**\n * Runs the update loop when the video is ready to play\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onPlayStart = function _onPlayStart() {\n // Just in case the video has not received its can play even yet..\n if (!this.hasLoaded) {\n this._onCanPlay();\n }\n\n if (!this._isAutoUpdating && this.autoUpdate) {\n _ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH);\n this._isAutoUpdating = true;\n }\n };\n\n /**\n * Fired when a pause event is triggered, stops the update loop\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onPlayStop = function _onPlayStop() {\n if (this._isAutoUpdating) {\n _ticker.shared.remove(this.update, this);\n this._isAutoUpdating = false;\n }\n };\n\n /**\n * Fired when the video is loaded and ready to play\n *\n * @private\n */\n\n\n VideoBaseTexture.prototype._onCanPlay = function _onCanPlay() {\n this.hasLoaded = true;\n\n if (this.source) {\n this.source.removeEventListener('canplay', this._onCanPlay);\n this.source.removeEventListener('canplaythrough', this._onCanPlay);\n\n this.width = this.source.videoWidth;\n this.height = this.source.videoHeight;\n\n // prevent multiple loaded dispatches..\n if (!this.__loaded) {\n this.__loaded = true;\n this.emit('loaded', this);\n }\n\n if (this._isSourcePlaying()) {\n this._onPlayStart();\n } else if (this.autoPlay) {\n this.source.play();\n }\n }\n };\n\n /**\n * Destroys this texture\n *\n */\n\n\n VideoBaseTexture.prototype.destroy = function destroy() {\n if (this._isAutoUpdating) {\n _ticker.shared.remove(this.update, this);\n }\n\n if (this.source && this.source._pixiId) {\n _BaseTexture3.default.removeFromCache(this.source._pixiId);\n delete this.source._pixiId;\n }\n\n _BaseTexture.prototype.destroy.call(this);\n };\n\n /**\n * Mimic PixiJS BaseTexture.from.... method.\n *\n * @static\n * @param {HTMLVideoElement} video - Video to create texture from\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n */\n\n\n VideoBaseTexture.fromVideo = function fromVideo(video, scaleMode) {\n if (!video._pixiId) {\n video._pixiId = 'video_' + (0, _utils.uid)();\n }\n\n var baseTexture = _utils.BaseTextureCache[video._pixiId];\n\n if (!baseTexture) {\n baseTexture = new VideoBaseTexture(video, scaleMode);\n _BaseTexture3.default.addToCache(baseTexture, video._pixiId);\n }\n\n return baseTexture;\n };\n\n /**\n * Helper function that creates a new BaseTexture based on the given video element.\n * This BaseTexture can then be used to create a texture\n *\n * @static\n * @param {string|object|string[]|object[]} videoSrc - The URL(s) for the video.\n * @param {string} [videoSrc.src] - One of the source urls for the video\n * @param {string} [videoSrc.mime] - The mimetype of the video (e.g. 'video/mp4'). If not specified\n * the url's extension will be used as the second part of the mime type.\n * @param {number} scaleMode - See {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.VideoBaseTexture} Newly created VideoBaseTexture\n */\n\n\n VideoBaseTexture.fromUrl = function fromUrl(videoSrc, scaleMode) {\n var video = document.createElement('video');\n\n video.setAttribute('webkit-playsinline', '');\n video.setAttribute('playsinline', '');\n\n // array of objects or strings\n if (Array.isArray(videoSrc)) {\n for (var i = 0; i < videoSrc.length; ++i) {\n video.appendChild(createSource(videoSrc[i].src || videoSrc[i], videoSrc[i].mime));\n }\n }\n // single object or string\n else {\n video.appendChild(createSource(videoSrc.src || videoSrc, videoSrc.mime));\n }\n\n video.load();\n\n return VideoBaseTexture.fromVideo(video, scaleMode);\n };\n\n /**\n * Should the base texture automatically update itself, set to true by default\n *\n * @member {boolean}\n */\n\n\n _createClass(VideoBaseTexture, [{\n key: 'autoUpdate',\n get: function get() {\n return this._autoUpdate;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n\n if (!this._autoUpdate && this._isAutoUpdating) {\n _ticker.shared.remove(this.update, this);\n this._isAutoUpdating = false;\n } else if (this._autoUpdate && !this._isAutoUpdating) {\n _ticker.shared.add(this.update, this, _const.UPDATE_PRIORITY.HIGH);\n this._isAutoUpdating = true;\n }\n }\n }\n }]);\n\n return VideoBaseTexture;\n}(_BaseTexture3.default);\n\nexports.default = VideoBaseTexture;\n\n\nVideoBaseTexture.fromUrls = VideoBaseTexture.fromUrl;\n\nfunction createSource(path, type) {\n if (!type) {\n type = 'video/' + path.substr(path.lastIndexOf('.') + 1);\n }\n\n var source = document.createElement('source');\n\n source.src = path;\n source.type = type;\n\n return source;\n}\n//# sourceMappingURL=VideoBaseTexture.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/VideoBaseTexture.js\n// module id = 253\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.BitmapText = exports.TilingSpriteRenderer = exports.TilingSprite = exports.TextureTransform = exports.AnimatedSprite = undefined;\n\nvar _AnimatedSprite = require('./AnimatedSprite');\n\nObject.defineProperty(exports, 'AnimatedSprite', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AnimatedSprite).default;\n }\n});\n\nvar _TextureTransform = require('./TextureTransform');\n\nObject.defineProperty(exports, 'TextureTransform', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TextureTransform).default;\n }\n});\n\nvar _TilingSprite = require('./TilingSprite');\n\nObject.defineProperty(exports, 'TilingSprite', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TilingSprite).default;\n }\n});\n\nvar _TilingSpriteRenderer = require('./webgl/TilingSpriteRenderer');\n\nObject.defineProperty(exports, 'TilingSpriteRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TilingSpriteRenderer).default;\n }\n});\n\nvar _BitmapText = require('./BitmapText');\n\nObject.defineProperty(exports, 'BitmapText', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BitmapText).default;\n }\n});\n\nrequire('./cacheAsBitmap');\n\nrequire('./getChildByName');\n\nrequire('./getGlobalPosition');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// imported for side effect of extending the prototype only, contains no exports\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/index.js\n// module id = 254\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _generateBlurVertSource = require('./generateBlurVertSource');\n\nvar _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource);\n\nvar _generateBlurFragSource = require('./generateBlurFragSource');\n\nvar _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource);\n\nvar _getMaxBlurKernelSize = require('./getMaxBlurKernelSize');\n\nvar _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurXFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurXFilter = function (_core$Filter) {\n _inherits(BlurXFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurXFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurXFilter);\n\n kernelSize = kernelSize || 5;\n var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, true);\n var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n vertSrc,\n // fragment shader\n fragSrc));\n\n _this.resolution = resolution || core.settings.RESOLUTION;\n\n _this._quality = 0;\n\n _this.quality = quality || 4;\n _this.strength = strength || 8;\n\n _this.firstRun = true;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n * @param {boolean} clear - Should the output be cleared before rendering?\n */\n\n\n BlurXFilter.prototype.apply = function apply(filterManager, input, output, clear) {\n if (this.firstRun) {\n var gl = filterManager.renderer.gl;\n var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl);\n\n this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, true);\n this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n this.firstRun = false;\n }\n\n this.uniforms.strength = 1 / output.size.width * (output.size.width / input.size.width);\n\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes; // / this.passes//Math.pow(1, this.passes);\n\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clear);\n } else {\n var renderTarget = filterManager.getRenderTarget(true);\n var flip = input;\n var flop = renderTarget;\n\n for (var i = 0; i < this.passes - 1; i++) {\n filterManager.applyFilter(this, flip, flop, true);\n\n var temp = flop;\n\n flop = flip;\n flip = temp;\n }\n\n filterManager.applyFilter(this, flip, output, clear);\n\n filterManager.returnRenderTarget(renderTarget);\n }\n };\n\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 16\n */\n\n\n _createClass(BlurXFilter, [{\n key: 'blur',\n get: function get() {\n return this.strength;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.padding = Math.abs(value) * 2;\n this.strength = value;\n }\n\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this._quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._quality = value;\n this.passes = value;\n }\n }]);\n\n return BlurXFilter;\n}(core.Filter);\n\nexports.default = BlurXFilter;\n//# sourceMappingURL=BlurXFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/BlurXFilter.js\n// module id = 255\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _generateBlurVertSource = require('./generateBlurVertSource');\n\nvar _generateBlurVertSource2 = _interopRequireDefault(_generateBlurVertSource);\n\nvar _generateBlurFragSource = require('./generateBlurFragSource');\n\nvar _generateBlurFragSource2 = _interopRequireDefault(_generateBlurFragSource);\n\nvar _getMaxBlurKernelSize = require('./getMaxBlurKernelSize');\n\nvar _getMaxBlurKernelSize2 = _interopRequireDefault(_getMaxBlurKernelSize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurYFilter applies a horizontal Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurYFilter = function (_core$Filter) {\n _inherits(BlurYFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurYFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurYFilter);\n\n kernelSize = kernelSize || 5;\n var vertSrc = (0, _generateBlurVertSource2.default)(kernelSize, false);\n var fragSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n vertSrc,\n // fragment shader\n fragSrc));\n\n _this.resolution = resolution || core.settings.RESOLUTION;\n\n _this._quality = 0;\n\n _this.quality = quality || 4;\n _this.strength = strength || 8;\n\n _this.firstRun = true;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n * @param {boolean} clear - Should the output be cleared before rendering?\n */\n\n\n BlurYFilter.prototype.apply = function apply(filterManager, input, output, clear) {\n if (this.firstRun) {\n var gl = filterManager.renderer.gl;\n var kernelSize = (0, _getMaxBlurKernelSize2.default)(gl);\n\n this.vertexSrc = (0, _generateBlurVertSource2.default)(kernelSize, false);\n this.fragmentSrc = (0, _generateBlurFragSource2.default)(kernelSize);\n\n this.firstRun = false;\n }\n\n this.uniforms.strength = 1 / output.size.height * (output.size.height / input.size.height);\n\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clear);\n } else {\n var renderTarget = filterManager.getRenderTarget(true);\n var flip = input;\n var flop = renderTarget;\n\n for (var i = 0; i < this.passes - 1; i++) {\n filterManager.applyFilter(this, flip, flop, true);\n\n var temp = flop;\n\n flop = flip;\n flip = temp;\n }\n\n filterManager.applyFilter(this, flip, output, clear);\n\n filterManager.returnRenderTarget(renderTarget);\n }\n };\n\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 2\n */\n\n\n _createClass(BlurYFilter, [{\n key: 'blur',\n get: function get() {\n return this.strength;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.padding = Math.abs(value) * 2;\n this.strength = value;\n }\n\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this._quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._quality = value;\n this.passes = value;\n }\n }]);\n\n return BlurYFilter;\n}(core.Filter);\n\nexports.default = BlurYFilter;\n//# sourceMappingURL=BlurYFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/BlurYFilter.js\n// module id = 256\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = generateFragBlurSource;\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448]\n};\n\nvar fragTemplate = ['varying vec2 vBlurTexCoords[%size%];', 'uniform sampler2D uSampler;', 'void main(void)', '{', ' gl_FragColor = vec4(0.0);', ' %blur%', '}'].join('\\n');\n\nfunction generateFragBlurSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n\n var fragSource = fragTemplate;\n\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value = void 0;\n\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i);\n\n value = i;\n\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n\n blur = blur.replace('%value%', kernel[value]);\n\n blurLoop += blur;\n blurLoop += '\\n';\n }\n\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize);\n\n return fragSource;\n}\n//# sourceMappingURL=generateBlurFragSource.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/generateBlurFragSource.js\n// module id = 257\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = generateVertBlurSource;\nvar vertTemplate = ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform float strength;', 'uniform mat3 projectionMatrix;', 'varying vec2 vBlurTexCoords[%size%];', 'void main(void)', '{', 'gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);', '%blur%', '}'].join('\\n');\n\nfunction generateVertBlurSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n\n var vertSource = vertTemplate;\n\n var blurLoop = '';\n var template = void 0;\n // let value;\n\n if (x) {\n template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);';\n } else {\n template = 'vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i);\n\n // value = i;\n\n // if(i >= halfLength)\n // {\n // value = kernelSize - i - 1;\n // }\n\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + '.0');\n\n blurLoop += blur;\n blurLoop += '\\n';\n }\n\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize);\n\n return vertSource;\n}\n//# sourceMappingURL=generateBlurVertSource.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/generateBlurVertSource.js\n// module id = 258\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.default = getMaxKernelSize;\nfunction getMaxKernelSize(gl) {\n var maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS);\n var kernelSize = 15;\n\n while (kernelSize > maxVaryings) {\n kernelSize -= 2;\n }\n\n return kernelSize;\n}\n//# sourceMappingURL=getMaxBlurKernelSize.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/getMaxBlurKernelSize.js\n// module id = 259\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Holds all information related to an Interaction event\n *\n * @class\n * @memberof PIXI.interaction\n */\nvar InteractionData = function () {\n /**\n *\n */\n function InteractionData() {\n _classCallCheck(this, InteractionData);\n\n /**\n * This point stores the global coords of where the touch/mouse event happened\n *\n * @member {PIXI.Point}\n */\n this.global = new core.Point();\n\n /**\n * The target DisplayObject that was interacted with\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n\n /**\n * When passed to an event handler, this will be the original DOM Event that was captured\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent\n * @member {MouseEvent|TouchEvent|PointerEvent}\n */\n this.originalEvent = null;\n\n /**\n * Unique identifier for this interaction\n *\n * @member {number}\n */\n this.identifier = null;\n\n /**\n * Indicates whether or not the pointer device that created the event is the primary pointer.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary\n * @type {Boolean}\n */\n this.isPrimary = false;\n\n /**\n * Indicates which button was pressed on the mouse or pointer device to trigger the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n * @type {number}\n */\n this.button = 0;\n\n /**\n * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n * @type {number}\n */\n this.buttons = 0;\n\n /**\n * The width of the pointer's contact along the x-axis, measured in CSS pixels.\n * radiusX of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width\n * @type {number}\n */\n this.width = 0;\n\n /**\n * The height of the pointer's contact along the y-axis, measured in CSS pixels.\n * radiusY of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height\n * @type {number}\n */\n this.height = 0;\n\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX\n * @type {number}\n */\n this.tiltX = 0;\n\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY\n * @type {number}\n */\n this.tiltY = 0;\n\n /**\n * The type of pointer that triggered the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\n * @type {string}\n */\n this.pointerType = null;\n\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n * @type {number}\n */\n this.pressure = 0;\n\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n * @type {number}\n */\n this.rotationAngle = 0;\n\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.twist = 0;\n\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.tangentialPressure = 0;\n }\n\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @member {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n\n\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n *\n * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n * coords off\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n InteractionData.prototype.getLocalPosition = function getLocalPosition(displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n\n /**\n * Copies properties from normalized event data.\n *\n * @param {Touch|MouseEvent|PointerEvent} event The normalized event data\n * @private\n */\n\n\n InteractionData.prototype._copyEvent = function _copyEvent(event) {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if (event.isPrimary) {\n this.isPrimary = true;\n }\n this.button = event.button;\n this.buttons = event.buttons;\n this.width = event.width;\n this.height = event.height;\n this.tiltX = event.tiltX;\n this.tiltY = event.tiltY;\n this.pointerType = event.pointerType;\n this.pressure = event.pressure;\n this.rotationAngle = event.rotationAngle;\n this.twist = event.twist || 0;\n this.tangentialPressure = event.tangentialPressure || 0;\n };\n\n /**\n * Resets the data for pooling.\n *\n * @private\n */\n\n\n InteractionData.prototype._reset = function _reset() {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n };\n\n _createClass(InteractionData, [{\n key: 'pointerId',\n get: function get() {\n return this.identifier;\n }\n }]);\n\n return InteractionData;\n}();\n\nexports.default = InteractionData;\n//# sourceMappingURL=InteractionData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionData.js\n// module id = 260\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Event class that mimics native DOM events.\n *\n * @class\n * @memberof PIXI.interaction\n */\nvar InteractionEvent = function () {\n /**\n *\n */\n function InteractionEvent() {\n _classCallCheck(this, InteractionEvent);\n\n /**\n * Whether this event will continue propagating in the tree\n *\n * @member {boolean}\n */\n this.stopped = false;\n\n /**\n * The object which caused this event to be dispatched.\n * For listener callback see {@link PIXI.interaction.InteractionEvent.currentTarget}.\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n\n /**\n * The object whose event listener’s callback is currently being invoked.\n *\n * @member {PIXI.DisplayObject}\n */\n this.currentTarget = null;\n\n /**\n * Type of the event\n *\n * @member {string}\n */\n this.type = null;\n\n /**\n * InteractionData related to this event\n *\n * @member {PIXI.interaction.InteractionData}\n */\n this.data = null;\n }\n\n /**\n * Prevents event from reaching any objects other than the current object.\n *\n */\n\n\n InteractionEvent.prototype.stopPropagation = function stopPropagation() {\n this.stopped = true;\n };\n\n /**\n * Resets the event.\n *\n * @private\n */\n\n\n InteractionEvent.prototype._reset = function _reset() {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n };\n\n return InteractionEvent;\n}();\n\nexports.default = InteractionEvent;\n//# sourceMappingURL=InteractionEvent.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionEvent.js\n// module id = 261\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * DisplayObjects with the {@link PIXI.interaction.interactiveTarget} mixin use this class to track interactions\n *\n * @class\n * @private\n * @memberof PIXI.interaction\n */\nvar InteractionTrackingData = function () {\n /**\n * @param {number} pointerId - Unique pointer id of the event\n */\n function InteractionTrackingData(pointerId) {\n _classCallCheck(this, InteractionTrackingData);\n\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n\n\n InteractionTrackingData.prototype._doSet = function _doSet(flag, yn) {\n if (yn) {\n this._flags = this._flags | flag;\n } else {\n this._flags = this._flags & ~flag;\n }\n };\n\n /**\n * Unique pointer id of the event\n *\n * @readonly\n * @member {number}\n */\n\n\n _createClass(InteractionTrackingData, [{\n key: \"pointerId\",\n get: function get() {\n return this._pointerId;\n }\n\n /**\n * State of the tracking data, expressed as bit flags\n *\n * @member {number}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"flags\",\n get: function get() {\n return this._flags;\n }\n\n /**\n * Set the flags for the tracking data\n *\n * @param {number} flags - Flags to set\n */\n ,\n set: function set(flags) {\n this._flags = flags;\n }\n\n /**\n * Is the tracked event inactive (not over or down)?\n *\n * @member {number}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"none\",\n get: function get() {\n return this._flags === this.constructor.FLAGS.NONE;\n }\n\n /**\n * Is the tracked event over the DisplayObject?\n *\n * @member {boolean}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"over\",\n get: function get() {\n return (this._flags & this.constructor.FLAGS.OVER) !== 0;\n }\n\n /**\n * Set the over flag\n *\n * @param {boolean} yn - Is the event over?\n */\n ,\n set: function set(yn) {\n this._doSet(this.constructor.FLAGS.OVER, yn);\n }\n\n /**\n * Did the right mouse button come down in the DisplayObject?\n *\n * @member {boolean}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"rightDown\",\n get: function get() {\n return (this._flags & this.constructor.FLAGS.RIGHT_DOWN) !== 0;\n }\n\n /**\n * Set the right down flag\n *\n * @param {boolean} yn - Is the right mouse button down?\n */\n ,\n set: function set(yn) {\n this._doSet(this.constructor.FLAGS.RIGHT_DOWN, yn);\n }\n\n /**\n * Did the left mouse button come down in the DisplayObject?\n *\n * @member {boolean}\n * @memberof PIXI.interaction.InteractionTrackingData#\n */\n\n }, {\n key: \"leftDown\",\n get: function get() {\n return (this._flags & this.constructor.FLAGS.LEFT_DOWN) !== 0;\n }\n\n /**\n * Set the left down flag\n *\n * @param {boolean} yn - Is the left mouse button down?\n */\n ,\n set: function set(yn) {\n this._doSet(this.constructor.FLAGS.LEFT_DOWN, yn);\n }\n }]);\n\n return InteractionTrackingData;\n}();\n\nexports.default = InteractionTrackingData;\n\n\nInteractionTrackingData.FLAGS = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2\n});\n//# sourceMappingURL=InteractionTrackingData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionTrackingData.js\n// module id = 262\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.interaction.InteractionManager} to automatically give all DisplayObjects these properties\n *\n * @private\n * @name interactiveTarget\n * @memberof PIXI.interaction\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * core.DisplayObject.prototype,\n * PIXI.interaction.interactiveTarget\n * );\n */\nexports.default = {\n\n /**\n * Enable interaction events for the DisplayObject. Touch, pointer and mouse\n * events will not be emitted unless `interactive` is set to `true`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.on('tap', (event) => {\n * //handle event\n * });\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n interactive: false,\n\n /**\n * Determines if the children to the displayObject can be clicked/touched\n * Setting this to false allows PixiJS to bypass a recursive `hitTest` function\n *\n * @member {boolean}\n * @memberof PIXI.Container#\n */\n interactiveChildren: true,\n\n /**\n * Interaction shape. Children will be hit first, then this shape will be checked.\n * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);\n * @member {PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle}\n * @memberof PIXI.DisplayObject#\n */\n hitArea: null,\n\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode() {\n return this.cursor === 'pointer';\n },\n set buttonMode(value) {\n if (value) {\n this.cursor = 'pointer';\n } else if (this.cursor === 'pointer') {\n this.cursor = null;\n }\n },\n\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n\n /**\n * Internal set of all active pointers, by identifier\n *\n * @member {Map}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers() {\n if (this._trackedPointers === undefined) this._trackedPointers = {};\n\n return this._trackedPointers;\n },\n\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n *\n * @private\n * @type {Map}\n */\n _trackedPointers: undefined\n};\n//# sourceMappingURL=interactiveTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/interactiveTarget.js\n// module id = 263\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.parse = parse;\n\nexports.default = function () {\n return function bitmapFontParser(resource, next) {\n // skip if no data or not xml data\n if (!resource.data || resource.type !== _resourceLoader.Resource.TYPE.XML) {\n next();\n\n return;\n }\n\n // skip if not bitmap font data, using some silly duck-typing\n if (resource.data.getElementsByTagName('page').length === 0 || resource.data.getElementsByTagName('info').length === 0 || resource.data.getElementsByTagName('info')[0].getAttribute('face') === null) {\n next();\n\n return;\n }\n\n var xmlUrl = !resource.isDataUrl ? path.dirname(resource.url) : '';\n\n if (resource.isDataUrl) {\n if (xmlUrl === '.') {\n xmlUrl = '';\n }\n\n if (this.baseUrl && xmlUrl) {\n // if baseurl has a trailing slash then add one to xmlUrl so the replace works below\n if (this.baseUrl.charAt(this.baseUrl.length - 1) === '/') {\n xmlUrl += '/';\n }\n }\n }\n\n // remove baseUrl from xmlUrl\n xmlUrl = xmlUrl.replace(this.baseUrl, '');\n\n // if there is an xmlUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (xmlUrl && xmlUrl.charAt(xmlUrl.length - 1) !== '/') {\n xmlUrl += '/';\n }\n\n var textureUrl = xmlUrl + resource.data.getElementsByTagName('page')[0].getAttribute('file');\n\n if (_core.utils.TextureCache[textureUrl]) {\n // reuse existing texture\n parse(resource, _core.utils.TextureCache[textureUrl]);\n next();\n } else {\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n loadType: _resourceLoader.Resource.LOAD_TYPE.IMAGE,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n\n // load the texture for the font\n this.add(resource.name + '_image', textureUrl, loadOptions, function (res) {\n parse(resource, res.texture);\n next();\n });\n }\n };\n};\n\nvar _path = require('path');\n\nvar path = _interopRequireWildcard(_path);\n\nvar _core = require('../core');\n\nvar _resourceLoader = require('resource-loader');\n\nvar _extras = require('../extras');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * Register a BitmapText font from loader resource.\n *\n * @function parseBitmapFontData\n * @memberof PIXI.loaders\n * @param {PIXI.loaders.Resource} resource - Loader resource.\n * @param {PIXI.Texture} texture - Reference to texture.\n */\nfunction parse(resource, texture) {\n resource.bitmapFont = _extras.BitmapText.registerFont(resource.data, texture);\n}\n//# sourceMappingURL=bitmapFontParser.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/bitmapFontParser.js\n// module id = 264\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n return function spritesheetParser(resource, next) {\n var imageResourceName = resource.name + '_image';\n\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data || resource.type !== _resourceLoader.Resource.TYPE.JSON || !resource.data.frames || this.resources[imageResourceName]) {\n next();\n\n return;\n }\n\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n loadType: _resourceLoader.Resource.LOAD_TYPE.IMAGE,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n\n var resourcePath = getResourcePath(resource, this.baseUrl);\n\n // load the image for this sheet\n this.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n var spritesheet = new _core.Spritesheet(res.texture.baseTexture, resource.data, resource.url);\n\n spritesheet.parse(function () {\n resource.spritesheet = spritesheet;\n resource.textures = spritesheet.textures;\n next();\n });\n });\n };\n};\n\nexports.getResourcePath = getResourcePath;\n\nvar _resourceLoader = require('resource-loader');\n\nvar _url = require('url');\n\nvar _url2 = _interopRequireDefault(_url);\n\nvar _core = require('../core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getResourcePath(resource, baseUrl) {\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n return resource.data.meta.image;\n }\n\n return _url2.default.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image);\n}\n//# sourceMappingURL=spritesheetParser.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/spritesheetParser.js\n// module id = 265\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nexports.default = function () {\n return function textureParser(resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && resource.type === _resourceLoader.Resource.TYPE.IMAGE) {\n resource.texture = _Texture2.default.fromLoader(resource.data, resource.url, resource.name);\n }\n next();\n };\n};\n\nvar _resourceLoader = require('resource-loader');\n\nvar _Texture = require('../core/textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=textureParser.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/textureParser.js\n// module id = 266\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh2 = require('./Mesh');\n\nvar _Mesh3 = _interopRequireDefault(_Mesh2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The Plane allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let Plane = new PIXI.Plane(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nvar Plane = function (_Mesh) {\n _inherits(Plane, _Mesh);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the Plane.\n * @param {number} verticesX - The number of vertices in the x-axis\n * @param {number} verticesY - The number of vertices in the y-axis\n */\n function Plane(texture, verticesX, verticesY) {\n _classCallCheck(this, Plane);\n\n /**\n * Tracker for if the Plane is ready to be drawn. Needed because Mesh ctor can\n * call _onTextureUpdated which could call refresh too early.\n *\n * @member {boolean}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture));\n\n _this._ready = true;\n\n _this.verticesX = verticesX || 10;\n _this.verticesY = verticesY || 10;\n\n _this.drawMode = _Mesh3.default.DRAW_MODES.TRIANGLES;\n _this.refresh();\n return _this;\n }\n\n /**\n * Refreshes plane coordinates\n *\n */\n\n\n Plane.prototype._refresh = function _refresh() {\n var texture = this._texture;\n var total = this.verticesX * this.verticesY;\n var verts = [];\n var colors = [];\n var uvs = [];\n var indices = [];\n\n var segmentsX = this.verticesX - 1;\n var segmentsY = this.verticesY - 1;\n\n var sizeX = texture.width / segmentsX;\n var sizeY = texture.height / segmentsY;\n\n for (var i = 0; i < total; i++) {\n var x = i % this.verticesX;\n var y = i / this.verticesX | 0;\n\n verts.push(x * sizeX, y * sizeY);\n\n uvs.push(x / segmentsX, y / segmentsY);\n }\n\n // cons\n\n var totalSub = segmentsX * segmentsY;\n\n for (var _i = 0; _i < totalSub; _i++) {\n var xpos = _i % segmentsX;\n var ypos = _i / segmentsX | 0;\n\n var value = ypos * this.verticesX + xpos;\n var value2 = ypos * this.verticesX + xpos + 1;\n var value3 = (ypos + 1) * this.verticesX + xpos;\n var value4 = (ypos + 1) * this.verticesX + xpos + 1;\n\n indices.push(value, value2, value3);\n indices.push(value2, value4, value3);\n }\n\n // console.log(indices)\n this.vertices = new Float32Array(verts);\n this.uvs = new Float32Array(uvs);\n this.colors = new Float32Array(colors);\n this.indices = new Uint16Array(indices);\n this.indexDirty++;\n\n this.multiplyUvs();\n };\n\n /**\n * Clear texture UVs when new texture is set\n *\n * @private\n */\n\n\n Plane.prototype._onTextureUpdate = function _onTextureUpdate() {\n _Mesh3.default.prototype._onTextureUpdate.call(this);\n\n // wait for the Plane ctor to finish before calling refresh\n if (this._ready) {\n this.refresh();\n }\n };\n\n return Plane;\n}(_Mesh3.default);\n\nexports.default = Plane;\n//# sourceMappingURL=Plane.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/Plane.js\n// module id = 267\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.prepare.BasePrepare} to a specified\n * number of items per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar CountLimiter = function () {\n /**\n * @param {number} maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n _classCallCheck(this, CountLimiter);\n\n /**\n * The maximum number of items that can be prepared each frame.\n * @private\n */\n this.maxItemsPerFrame = maxItemsPerFrame;\n /**\n * The number of items that can be prepared in the current frame.\n * @type {number}\n * @private\n */\n this.itemsLeft = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n\n\n CountLimiter.prototype.beginFrame = function beginFrame() {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n\n\n CountLimiter.prototype.allowedToUpload = function allowedToUpload() {\n return this.itemsLeft-- > 0;\n };\n\n return CountLimiter;\n}();\n\nexports.default = CountLimiter;\n//# sourceMappingURL=CountLimiter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/limiters/CountLimiter.js\n// module id = 268\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.eachSeries = eachSeries;\nexports.queue = queue;\n/**\n * Smaller version of the async library constructs.\n *\n */\nfunction _noop() {} /* empty */\n\n/**\n * Iterates an array in series.\n *\n * @param {Array.<*>} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\nfunction eachSeries(array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n\n (function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n\n return;\n }\n\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n } else {\n iterator(array[i++], next);\n }\n })();\n}\n\n/**\n * Ensures a function is only called once.\n *\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n\n var callFn = fn;\n\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n\n/**\n * Async queue implementation,\n *\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\nfunction queue(worker, concurrency) {\n if (concurrency == null) {\n // eslint-disable-line no-eq-null,eqeqeq\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var workers = 0;\n var q = {\n _tasks: [],\n concurrency: concurrency,\n saturated: _noop,\n unsaturated: _noop,\n buffer: concurrency / 4,\n empty: _noop,\n drain: _noop,\n error: _noop,\n started: false,\n paused: false,\n push: function push(data, callback) {\n _insert(data, false, callback);\n },\n kill: function kill() {\n workers = 0;\n q.drain = _noop;\n q.started = false;\n q._tasks = [];\n },\n unshift: function unshift(data, callback) {\n _insert(data, true, callback);\n },\n process: function process() {\n while (!q.paused && workers < q.concurrency && q._tasks.length) {\n var task = q._tasks.shift();\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n workers += 1;\n\n if (workers === q.concurrency) {\n q.saturated();\n }\n\n worker(task.data, onlyOnce(_next(task)));\n }\n },\n length: function length() {\n return q._tasks.length;\n },\n running: function running() {\n return workers;\n },\n idle: function idle() {\n return q._tasks.length + workers === 0;\n },\n pause: function pause() {\n if (q.paused === true) {\n return;\n }\n\n q.paused = true;\n },\n resume: function resume() {\n if (q.paused === false) {\n return;\n }\n\n q.paused = false;\n\n // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= q.concurrency; w++) {\n q.process();\n }\n }\n };\n\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n // eslint-disable-line no-eq-null,eqeqeq\n throw new Error('task callback must be a function');\n }\n\n q.started = true;\n\n if (data == null && q.idle()) {\n // eslint-disable-line no-eq-null,eqeqeq\n // call drain immediately if there are no tasks\n setTimeout(function () {\n return q.drain();\n }, 1);\n\n return;\n }\n\n var item = {\n data: data,\n callback: typeof callback === 'function' ? callback : _noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n setTimeout(function () {\n return q.process();\n }, 1);\n }\n\n function _next(task) {\n return function next() {\n workers -= 1;\n\n task.callback.apply(task, arguments);\n\n if (arguments[0] != null) {\n // eslint-disable-line no-eq-null,eqeqeq\n q.error(arguments[0], task.data);\n }\n\n if (workers <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n\n q.process();\n };\n }\n\n return q;\n}\n//# sourceMappingURL=async.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/async.js\n// module id = 269\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.encodeBinary = encodeBinary;\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n } else {\n bytebuffer[jnx] = 0;\n }\n }\n\n // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n encodedCharIndexes[0] = bytebuffer[0] >> 2;\n\n // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n encodedCharIndexes[1] = (bytebuffer[0] & 0x3) << 4 | bytebuffer[1] >> 4;\n\n // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n encodedCharIndexes[2] = (bytebuffer[1] & 0x0f) << 2 | bytebuffer[2] >> 6;\n\n // index 3: forth 6 bits (6 least significant bits from input byte 3)\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f;\n\n // Determine whether padding happened, and adjust accordingly\n var paddingBytes = inx - (input.length - 1);\n\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n\n default:\n break; // No padding - proceed\n }\n\n // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n for (var _jnx = 0; _jnx < encodedCharIndexes.length; ++_jnx) {\n output += _keyStr.charAt(encodedCharIndexes[_jnx]);\n }\n }\n\n return output;\n}\n//# sourceMappingURL=b64.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/b64.js\n// module id = 270\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/url/url.js\n// module id = 271\n// module chunks = 0","import {loader, autoDetectRenderer} from 'pixi.js';\nimport {noop as _noop} from 'lodash/util';\nimport levels from '../data/levels.json';\nimport Stage from './Stage';\nimport sound from'./Sound';\n\nconst BLUE_SKY_COLOR = 0x64b0ff;\nconst PINK_SKY_COLOR = 0xfbb4d4;\nconst SUCCESS_RATIO = 0.6;\n\nclass Game {\n /**\n * Game Constructor\n * @param opts\n * @param {String} opts.spritesheet Path to the spritesheet file that PIXI's loader should load\n * @returns {Game}\n */\n constructor(opts) {\n this.spritesheet = opts.spritesheet;\n this.loader = loader;\n this.renderer = autoDetectRenderer(window.innerWidth, window.innerHeight, {\n backgroundColor: BLUE_SKY_COLOR\n });\n this.levelIndex = 0;\n\n this.waveEnding = false;\n this.quackingSoundId = null;\n this.levels = levels.normal;\n return this;\n }\n\n get ducksMissed() {\n return this.ducksMissedVal ? this.ducksMissedVal : 0;\n }\n\n set ducksMissed(val) {\n this.ducksMissedVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('ducksMissed')) {\n this.stage.hud.createTextureBasedCounter('ducksMissed', {\n texture: 'hud/score-live/0.png',\n spritesheet: this.spritesheet,\n location: Stage.missedDuckStatusBoxLocation()\n });\n }\n\n this.stage.hud.ducksMissed = val;\n }\n }\n\n get ducksShot() {\n return this.ducksShotVal ? this.ducksShotVal : 0;\n }\n\n set ducksShot(val) {\n this.ducksShotVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('ducksShot')) {\n this.stage.hud.createTextureBasedCounter('ducksShot', {\n texture: 'hud/score-dead/0.png',\n spritesheet: this.spritesheet,\n location: Stage.deadDuckStatusBoxLocation()\n });\n }\n\n this.stage.hud.ducksShot = val;\n }\n }\n /**\n * bullets - getter\n * @returns {Number}\n */\n get bullets() {\n return this.bulletVal ? this.bulletVal : 0;\n }\n\n /**\n * bullets - setter\n * Setter for the bullets property of the game. Also in charge of updating the HUD. In the event\n * the HUD doesn't know about displaying bullets, the property and a corresponding texture container\n * will be created in HUD.\n * @param {Number} val Number of bullets\n */\n set bullets(val) {\n this.bulletVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('bullets')) {\n this.stage.hud.createTextureBasedCounter('bullets', {\n texture: 'hud/bullet/0.png',\n spritesheet: this.spritesheet,\n location: Stage.bulletStatusBoxLocation()\n });\n }\n\n this.stage.hud.bullets = val;\n }\n\n }\n\n /**\n * score - getter\n * @returns {Number}\n */\n get score() {\n return this.scoreVal ? this.scoreVal : 0;\n }\n\n /**\n * score - setter\n * Setter for the score property of the game. Also in charge of updating the HUD. In the event\n * the HUD doesn't know about displaying the score, the property and a corresponding text box\n * will be created in HUD.\n * @param {Number} val Score value to set\n */\n set score(val) {\n this.scoreVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('score')) {\n this.stage.hud.createTextBox('score', {\n style: {\n fontFamily: 'Arial',\n fontSize: '18px',\n align: 'left',\n fill: 'white'\n },\n location: Stage.scoreBoxLocation(),\n anchor: {\n x: 1,\n y: 0\n }\n });\n }\n\n this.stage.hud.score = val;\n }\n\n }\n\n /**\n * wave - get\n * @returns {Number}\n */\n get wave() {\n return this.waveVal ? this.waveVal : 0;\n }\n\n /**\n * wave - set\n * Setter for the wave property of the game. Also in charge of updating the HUD. In the event\n * the HUD doesn't know about displaying the wave, the property and a corresponding text box\n * will be created in the HUD.\n * @param {Number} val\n */\n set wave(val) {\n this.waveVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('waveStatus')) {\n this.stage.hud.createTextBox('waveStatus', {\n style: {\n fontFamily: 'Arial',\n fontSize: '18px',\n align: 'left',\n fill: 'white'\n },\n location: Stage.waveStatusBoxLocation(),\n anchor: {\n x: 1,\n y: 1\n }\n });\n }\n\n if (!isNaN(val) && val > 0) {\n this.stage.hud.waveStatus = 'Wave ' + val + ' of ' + this.level.waves;\n } else {\n this.stage.hud.waveStatus = '';\n }\n }\n }\n\n /**\n * gameStatus - get\n * @returns {String}\n */\n get gameStatus() {\n return this.gameStatusVal ? this.gameStatusVal : '';\n }\n\n /**\n * gameStatus - set\n * @param {String} val\n */\n set gameStatus(val) {\n this.gameStatusVal = val;\n\n if (this.stage && this.stage.hud) {\n\n if (!this.stage.hud.hasOwnProperty('gameStatus')) {\n this.stage.hud.createTextBox('gameStatus', {\n style: {\n fontFamily: 'Arial',\n fontSize: '40px',\n align: 'left',\n fill: 'white'\n },\n location: Stage.gameStatusBoxLocation()\n });\n }\n\n this.stage.hud.gameStatus = val;\n }\n }\n\n load() {\n this.loader\n .add(this.spritesheet)\n .load(this.onLoad.bind(this));\n }\n\n onLoad() {\n document.body.appendChild(this.renderer.view);\n\n this.stage = new Stage({\n spritesheet: this.spritesheet\n });\n\n this.scaleToWindow();\n this.bindEvents();\n this.startLevel();\n this.animate();\n\n }\n\n bindEvents() {\n window.addEventListener('resize', this.scaleToWindow.bind(this));\n }\n\n scaleToWindow() {\n this.renderer.resize(window.innerWidth, window.innerHeight);\n this.stage.scaleToWindow();\n }\n\n startLevel() {\n this.level = this.levels[this.levelIndex];\n this.ducksShot = 0;\n this.ducksMissed = 0;\n this.wave = 0;\n\n this.gameStatus = this.level.title;\n this.stage.preLevelAnimation().then(() => {\n this.gameStatus = '';\n this.bindInteractions();\n this.startWave();\n });\n }\n\n startWave() {\n this.quackingSoundId = sound.play('quacking');\n this.wave += 1;\n this.waveStartTime = Date.now();\n this.bullets = this.level.bullets;\n this.ducksShotThisWave = 0;\n this.waveEnding = false;\n\n this.stage.addDucks(this.level.ducks, this.level.speed);\n this.bindInteractions();\n }\n\n endWave() {\n this.waveEnding = true;\n this.bullets = 0;\n sound.stop(this.quackingSoundId);\n if (this.stage.ducksAlive()) {\n this.ducksMissed += this.level.ducks - this.ducksShotThisWave;\n this.renderer.backgroundColor = PINK_SKY_COLOR;\n this.stage.flyAway().then(this.goToNextWave.bind(this));\n } else {\n this.stage.cleanUpDucks();\n this.goToNextWave();\n }\n }\n\n goToNextWave() {\n this.renderer.backgroundColor = BLUE_SKY_COLOR;\n if (this.level.waves === this.wave) {\n this.endLevel();\n } else {\n this.startWave();\n }\n }\n\n shouldWaveEnd() {\n // evaluate pre-requisites for a wave to end\n if (this.wave === 0 || this.waveEnding || this.stage.dogActive()) {\n return false;\n }\n\n return this.isWaveTimeUp() || (this.outOfAmmo() && this.stage.ducksAlive()) || !this.stage.ducksActive();\n }\n\n isWaveTimeUp() {\n return this.level ? this.waveElapsedTime() >= this.level.time : false;\n }\n\n waveElapsedTime() {\n return (Date.now() - this.waveStartTime) / 1000;\n }\n\n outOfAmmo() {\n return this.level && this.bullets === 0;\n }\n\n endLevel() {\n this.wave = 0;\n this.goToNextLevel();\n }\n\n goToNextLevel() {\n this.levelIndex++;\n if (!this.levelWon()) {\n this.loss();\n } else if (this.levelIndex < this.levels.length) {\n this.startLevel();\n } else {\n this.win();\n }\n }\n\n levelWon() {\n return this.ducksShot > SUCCESS_RATIO * this.level.ducks * this.level.waves;\n }\n\n win() {\n sound.play('champ');\n this.gameStatus = 'You Win!';\n this.showReplay(this.getScoreMessage());\n }\n\n loss() {\n sound.play('loserSound');\n this.gameStatus = 'You Lose!';\n this.showReplay(this.getScoreMessage());\n }\n\n getScoreMessage() {\n let scoreMessage;\n\n if (this.score === 9400) {\n scoreMessage = 'Flawless victory.';\n }\n\n if (this.score < 9400) {\n scoreMessage = 'Close to perfection.';\n }\n\n if (this.score <= 9000) {\n scoreMessage = 'Truly impressive score.';\n }\n\n if (this.score <= 8000) {\n scoreMessage = 'Solid score.'\n }\n\n if (this.score <= 6000) {\n scoreMessage = 'Yikes.';\n }\n\n return scoreMessage;\n }\n\n showReplay(replayText) {\n this.stage.hud.createTextBox('replayButton', {\n location: Stage.replayButtonLocation()\n });\n this.stage.hud.replayButton = replayText + ' Play Again?';\n this.bindInteractions();\n\n }\n\n handleClick(event) {\n let clickPoint = {\n x: event.data.global.x,\n y: event.data.global.y\n };\n\n if (!this.stage.hud.replayButton && !this.outOfAmmo()) {\n sound.play('gunSound');\n this.bullets -= 1;\n this.updateScore(this.stage.shotsFired(clickPoint));\n }\n\n if (this.stage.hud.replayButton && this.stage.clickedReplay(clickPoint)) {\n window.location.reload();\n }\n }\n\n updateScore(ducksShot) {\n this.ducksShot += ducksShot;\n this.ducksShotThisWave += ducksShot;\n this.score += ducksShot * this.level.pointsPerDuck;\n }\n\n bindInteractions() {\n this.stage.mousedown = this.stage.touchstart = this.handleClick.bind(this);\n }\n\n unbindInteractions() {\n this.stage.mousedown = this.stage.touchstart = _noop;\n }\n\n animate() {\n this.renderer.render(this.stage);\n\n if (this.shouldWaveEnd()) {\n this.unbindInteractions();\n this.endWave();\n }\n\n requestAnimationFrame(this.animate.bind(this));\n }\n}\n\nexport default Game;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Game.js","import Game from './src/modules/Game';\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n let game = new Game({\n spritesheet: 'sprites.json'\n }).load();\n\n}, false);\n\n\n\n// WEBPACK FOOTER //\n// ./main.js","import {TweenMax} from 'gsap';\nimport {noop as _noop} from 'lodash/util';\nimport {assign as _extend} from 'lodash/object';\nimport sound from './Sound';\nimport Character from './Character';\n\n\nclass Dog extends Character {\n /**\n * Dog Constructor\n * @param options\n * @param {String} options.spritesheet The object property to ask PIXI's resource loader for\n * @param {PIXI.Point} options.downPoint The point where the dog should sit at during active play\n * @param {PIXI.Point} options.upPoint The point the dog should rise to when retrieving ducks\n */\n constructor(options) {\n const states = [\n {\n name: 'double',\n animationSpeed: 0.1\n },\n {\n name: 'single',\n animationSpeed: 0.1\n },\n {\n name: 'find',\n animationSpeed: 0.1\n },\n {\n name: 'jump',\n animationSpeed: 0.1,\n loop: false\n },\n {\n name: 'laugh',\n animationSpeed: 0.1\n },\n {\n name: 'sniff',\n animationSpeed: 0.1\n }\n ];\n super('dog', options.spritesheet, states);\n this.toRetrieve = 0;\n this.anchor.set(0.5, 0);\n this.options = options;\n this.sniffSoundId = null;\n }\n\n /**\n * sniff\n * @param opts\n * @param {PIXI.Point} [opts.startPoint=this.position] Point the dog should start sniffing from\n * @param {PIXI.Point} [opts.endPoint=this.position] Point the dog should sniff to\n * @param {Function} [opts.onStart=_noop] Function to call at the start of the dog sniffing\n * @param {Function} [opts.onComplete=_noop] Function to call once the dog has finished sniffing\n * @returns {Dog}\n */\n sniff(opts) {\n const options = _extend({\n startPoint: this.position,\n endPoint: this.position,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.sit({\n point: options.startPoint,\n pre: () => {\n this.visible = false;\n }\n });\n\n this.timeline.to(this.position, 2, {\n x: options.endPoint.x,\n y: options.endPoint.y,\n ease: 'Linear.easeNone',\n onStart: () => {\n this.visible = true;\n this.parent.setChildIndex(this, this.parent.children.length - 1);\n this.state = 'sniff';\n this.sniffSoundId = sound.play('sniff');\n options.onStart();\n },\n onComplete: () => {\n sound.stop(this.sniffSoundId);\n options.onComplete();\n }\n });\n\n return this;\n }\n\n /**\n * upDownTween\n * @param opts\n * @param {PIXI.Point} [opts.startPoint] Lowest point the dog should go to, and where the animation starts\n * @param {PIXI.Point} [opts.endPoint] Highest point the dog should go to\n * @param {Function} [opts.onStart] Function to call at the start of the up/down animation\n * @param {Function} [opts.onComplete] Function to call once the dog has completed an up/down cycle\n * return {Dog}\n */\n upDownTween(opts) {\n const options = _extend({\n startPoint: this.options.downPoint || this.position,\n endPoint: this.options.upPoint || this.position,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.sit({\n point: options.startPoint\n });\n\n this.timeline.add(TweenMax.to(this.position, 0.4, {\n y: options.endPoint.y,\n yoyo: true,\n repeat: 1,\n repeatDelay: 0.5,\n ease: 'Linear.easeNone',\n onStart: () => {\n this.visible = true;\n options.onStart.call(this);\n },\n onComplete: options.onComplete\n }));\n return this;\n }\n\n /**\n * find\n * @param opts\n * @param {Function} [opts.onStart] Function called at the start of the animation\n * @param {Function} [opts.onComplete] Function called when the animation has completed\n * @returns {Dog}\n */\n find(opts) {\n const options = _extend({\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.timeline.add(() => {\n sound.play('barkDucks');\n this.state = 'find';\n options.onStart();\n });\n\n this.timeline.add(TweenMax.to(this.position, 0.2, {\n y: '-=100',\n ease: 'Strong.easeOut',\n delay: 0.4,\n onStart: () => {\n this.state = 'jump';\n },\n onComplete: () => {\n this.visible = false;\n options.onComplete();\n }\n }));\n\n return this;\n }\n\n /**\n * sit\n * @param opts\n * @param {PIXI.Point} [opts.point] Point the dog will go to without animation\n * @param {Function} [opts.onStart] Function called before moving the dog\n * @param {Function} [opts.onComplete] Function called after the dog has moved\n * @returns {Dog}\n */\n sit(opts) {\n const options = _extend({\n point: this.position,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.timeline.add(() => {\n options.onStart();\n this.position.set(options.point.x, options.point.y);\n options.onComplete();\n });\n return this;\n }\n\n /**\n * retrieve\n * @retuns {Dog}\n */\n retrieve() {\n this.toRetrieve++;\n\n this.upDownTween({\n onStart: () => {\n if (this.toRetrieve >= 2) {\n this.state = 'double';\n this.toRetrieve-=2;\n } else if (this.toRetrieve === 1) {\n this.state = 'single';\n this.toRetrieve-=1;\n }\n }\n });\n return this;\n }\n\n /**\n * laugh\n * @returns {Dog}\n */\n laugh() {\n this.upDownTween({\n state: 'laugh',\n onStart: () => {\n this.toRetrieve = 0;\n this.state = 'laugh';\n sound.play('laugh');\n }\n });\n\n return this;\n }\n\n /**\n * isActive\n * @returns {boolean}\n */\n isActive() {\n return super.isActive() && this.toRetrieve > 0;\n }\n}\n\nexport default Dog;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Dog.js","import {random as _random} from 'lodash/number';\nimport {assign as _extend} from 'lodash/object';\nimport {noop as _noop} from 'lodash/util';\nimport Utils from '../libs/utils';\nimport Character from './Character';\nimport sound from './Sound';\n\nconst DEATH_ANIMATION_SECONDS = 0.6;\nconst RANDOM_FLIGHT_DELTA = 300;\n\nclass Duck extends Character {\n /**\n * Duck constructor\n * Method to instantiate a new Duck character\n * @param {Object} options with various duck configuration values\n * @param {String} options.colorProfile String that is concatinated with `duck/` to generate the sprite ID\n * @param {String} options.spritesheet The object property to ask PIXI's resource loader for\n * @param {Number} [options.maxX] When randomly flying, imposes an upper bound on the X coordinate\n * @param {Number} [options.maxY] When randomly flying, imposes an upper bound on the Y coordinate\n * @param {Number} [options.randomFlightDelta] The minimum distance the duck must travel when randomly flying\n */\n constructor(options) {\n const spriteId = 'duck/' + options.colorProfile;\n const states = [\n {\n name: 'left',\n animationSpeed: 0.18\n\n },\n {\n name: 'right',\n animationSpeed: 0.18\n\n },\n {\n name: 'top-left',\n animationSpeed: 0.18\n\n },\n {\n name: 'top-right',\n animationSpeed: 0.18\n\n },\n {\n name: 'dead',\n animationSpeed: 0.18\n\n },\n {\n name: 'shot',\n animationSpeed: 0.18\n\n }\n ];\n super(spriteId, options.spritesheet, states);\n this.alive = true;\n this.visible = true;\n this.options = options;\n this.anchor.set(0.5, 0.5);\n }\n\n /**\n * randomFlight\n * Method that causes the duck the randomly fly around a specific region of its parent\n * @param {Object} opts options for the flight tween\n * @param {Number} [opts.minX=0] Lowest x value allowed\n * @param {Number} [opts.maxX=Infinity] Highest x value allowed\n * @param {Number} [opts.minY=0] Lowest Y value allowed\n * @param {Number} [opts.maxY=Infinity] Highest Y value allowed\n * @param {Number} [opts.randomFlightDelta=300] Minimum distance to the next destination\n * @param {Number} [opts.speed=1] Speed of travel on a scale of 0 (slow) to 10 (fast)\n */\n randomFlight(opts) {\n const options = _extend({\n minX: 0,\n maxX: this.options.maxX || Infinity,\n minY: 0,\n maxY: this.options.maxY || Infinity,\n randomFlightDelta: this.options.randomFilghtDelta || RANDOM_FLIGHT_DELTA,\n speed: 1\n }, opts);\n\n let distance, destination;\n do {\n destination = {\n x: _random(options.minX, options.maxX),\n y: _random(options.minY, options.maxY)\n };\n distance = Utils.pointDistance(this.position, destination);\n } while (distance < options.randomFlightDelta);\n\n this.flyTo({\n point: destination,\n speed: options.speed,\n onComplete: this.randomFlight.bind(this, options)\n });\n }\n\n /**\n * flyTo\n * Method that adds an animation to the ducks timeline for flying to a specified point.\n * @param opts\n * @param {PIXI.Point} [opts.point] Location the duck should go to\n * @param {Number} [opts.speed] Integer from 0 to 10 which determines how fast the duck flys\n * @param {Function} [opts.onStart=_noop] Method to call when the duck begins flying to the destination\n * @param {Function} [opts.onComplete_noop] Method to call when the duck has arrived at the destination\n * @returns {Duck}\n */\n flyTo(opts) {\n const options = _extend({\n point: this.position,\n speed: this.speed,\n onStart: _noop,\n onComplete: _noop\n }, opts);\n\n this.speed = options.speed;\n\n const direction = Utils.directionOfTravel(this.position, options.point);\n const tweenSeconds = (this.flightAnimationMs + _random(0, 300)) / 1000;\n\n this.timeline.to(this.position, tweenSeconds, {\n x: options.point.x,\n y: options.point.y,\n ease: 'Linear.easeNone',\n onStart: () => {\n if (!this.alive) {\n this.stopAndClearTimeline();\n }\n this.play();\n this.state = direction.replace('bottom', 'top');\n options.onStart();\n },\n onComplete: options.onComplete\n });\n\n return this;\n }\n\n /**\n * shot\n * Method that animates the duck when the player shoots it\n */\n shot() {\n if (!this.alive) {\n return;\n }\n this.alive = false;\n\n this.stopAndClearTimeline();\n this.timeline.add(() => {\n this.state = 'shot';\n sound.play('quak', _noop);\n });\n\n this.timeline.to(this.position, DEATH_ANIMATION_SECONDS, {\n y: this.options.maxY,\n ease: 'Linear.easeNone',\n delay: 0.3,\n onStart: () => {\n this.state = 'dead';\n },\n onComplete: () => {\n sound.play('thud', _noop);\n this.visible = false;\n }\n });\n\n }\n\n /**\n * isActive\n * Helper that tells whether the duck is currently or is able to be animated.\n * Because ducks have a complex death sequence, this method checks if a duck is visible\n * in addition to the standard timeline animation check. This avoids potential race conditions\n * since in Duckhunt, if you can see the duck, it's beind animated in some way even if it's\n * technically \"dead\"\n * @returns {*|boolean}\n */\n isActive() {\n return this.visible || super.isActive();\n }\n\n /**\n * speed - getter\n * This method returns the\n * @returns {Number} Returns the speed level, a number from 0 to 10\n */\n get speed() {\n return this.speedVal;\n }\n\n /**\n * speed - setter\n * Method that determines how fast the duck should fly. Uses a 0-10 scale for ease and since\n * it technically \"goes to 11\"\n * @see https://www.youtube.com/watch?v=KOO5S4vxi0o.\n * @param {Number} val A number from 0 (slow) to 10 (fast) that sets the length of the flight tween\n */\n set speed(val) {\n let flightAnimationMs;\n switch (val) {\n case 0:\n flightAnimationMs = 3000;\n break;\n case 1:\n flightAnimationMs = 2800;\n break;\n case 2:\n flightAnimationMs = 2500;\n break;\n case 3:\n flightAnimationMs = 2000;\n break;\n case 4:\n flightAnimationMs = 1800;\n break;\n case 5:\n flightAnimationMs = 1500;\n break;\n case 6:\n flightAnimationMs = 1300;\n break;\n case 7:\n flightAnimationMs = 1200;\n break;\n case 8:\n flightAnimationMs = 800;\n break;\n case 9:\n flightAnimationMs = 600;\n break;\n case 10:\n flightAnimationMs = 500;\n break;\n }\n this.speedVal = val;\n this.flightAnimationMs = flightAnimationMs;\n }\n}\n\nexport default Duck;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Duck.js","import {Container, Point, Text, loader, extras} from 'pixi.js';\nimport {assign as _extend} from 'lodash/object';\n\n/**\n * Hud\n * The heads up display class, or Hud is an abstraction that aids in the creation\n * and visual updating of text boxes that display useful information to the\n * user as they play the game.\n *\n * The instantiator of this class is responsible for displaying it at the proper\n * depth in it's parent container.\n */\nclass Hud extends Container {\n constructor() {\n super();\n }\n\n /**\n * createTextBox\n * This method defines a property key on the Hud object that when modified\n * ensures the text box is visually updated. This is accomplished using ES6 getters\n * and setters.\n * @param name string - This name becomes a property key on the Hud object,\n * modifying it will update the textBox automatically.\n * @param opts object - Object to convey style, location, anchor point, etc of the text box\n */\n createTextBox(name, opts) {\n // set defaults, and allow them to be overwritten\n const options = _extend({\n style: {\n fontFamily: 'Arial',\n fontSize: '18px',\n align: 'left',\n fill: 'white'\n },\n location: new Point(0, 0),\n anchor: {\n x: 0.5,\n y: 0.5\n }\n }, opts);\n\n this[name + 'TextBox'] = new Text('', options.style);\n const textBox = this[name + 'TextBox'];\n textBox.position.set(options.location.x, options.location.y);\n textBox.anchor.set(options.anchor.x, options.anchor.y);\n this.addChild(textBox);\n\n Object.defineProperty(this, name, {\n set: (val) => {\n textBox.text = val;\n },\n get: () => {\n return textBox.text;\n }\n });\n }\n\n createTextureBasedCounter(name, opts) {\n const options = _extend({\n texture: '',\n spritesheet: '',\n location: new Point(0, 0)\n }, opts);\n\n this[name + 'Container'] = new Container();\n const container = this[name + 'Container'];\n container.position.set(options.location.x, options.location.y);\n this.addChild(container);\n\n Object.defineProperty(this, name, {\n set: (val) => {\n const gameTextures = loader.resources[options.spritesheet].textures;\n const texture = gameTextures[options.texture];\n const childCount = container.children.length;\n if (childCount < val) {\n for (let i = childCount; i < val; i++) {\n const item = new extras.AnimatedSprite([texture]);\n item.position.set(item.width * i, 0);\n container.addChild(item);\n }\n } else if (val != childCount) {\n container.removeChildren(val, childCount);\n }\n }\n });\n }\n}\n\nexport default Hud;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Hud.js","import {Point, Graphics, Container, loader, extras} from 'pixi.js';\nimport BPromise from 'bluebird';\nimport {some as _some} from 'lodash/collection';\nimport {delay as _delay} from 'lodash/function';\nimport Utils from '../libs/utils';\nimport Duck from './Duck';\nimport Dog from './Dog';\nimport Hud from './Hud';\n\nconst MAX_X = 800;\nconst MAX_Y = 600;\n\nconst DUCK_POINTS = {\n ORIGIN: new Point(MAX_X / 2, MAX_Y)\n};\nconst DOG_POINTS = {\n DOWN: new Point(MAX_X / 2, MAX_Y),\n UP: new Point(MAX_X / 2, MAX_Y - 230),\n SNIFF_START: new Point(0, MAX_Y - 130),\n SNIFF_END: new Point(MAX_X / 2, MAX_Y - 130)\n};\nconst HUD_LOCATIONS = {\n SCORE: new Point(MAX_X - 10, 10),\n WAVE_STATUS: new Point(MAX_X - 10, MAX_Y - 20),\n GAME_STATUS: new Point(MAX_X / 2, MAX_Y * 0.45),\n REPLAY_BUTTON: new Point(MAX_X / 2, MAX_Y * 0.56),\n BULLET_STATUS: new Point(10, 10),\n DEAD_DUCK_STATUS: new Point(10, MAX_Y * 0.91),\n MISSED_DUCK_STATUS: new Point(10, MAX_Y * 0.95)\n};\n\nconst FLASH_MS = 60;\nconst FLASH_SCREEN = new Graphics();\nFLASH_SCREEN.beginFill(0xFFFFFF);\nFLASH_SCREEN.drawRect(0, 0, MAX_X, MAX_Y);\nFLASH_SCREEN.endFill();\nFLASH_SCREEN.position.x = 0;\nFLASH_SCREEN.position.y = 0;\n\nclass Stage extends Container {\n\n /**\n * Stage Constructor\n * Container for the game\n * @param opts\n * @param opts.spritesheet - String representing the path to the spritesheet file\n */\n constructor(opts) {\n super();\n this.spritesheet = opts.spritesheet;\n this.interactive = true;\n this.ducks = [];\n this.dog = new Dog({\n spritesheet: opts.spritesheet,\n downPoint: DOG_POINTS.DOWN,\n upPoint: DOG_POINTS.UP\n });\n this.dog.visible = false;\n this.flashScreen = FLASH_SCREEN;\n this.flashScreen.visible = false;\n this.hud = new Hud();\n\n this._setStage();\n this.scaleToWindow();\n }\n\n static scoreBoxLocation() {\n return HUD_LOCATIONS.SCORE;\n }\n\n static waveStatusBoxLocation() {\n return HUD_LOCATIONS.WAVE_STATUS;\n }\n\n static gameStatusBoxLocation() {\n return HUD_LOCATIONS.GAME_STATUS;\n }\n\n static replayButtonLocation() {\n return HUD_LOCATIONS.REPLAY_BUTTON;\n }\n\n static bulletStatusBoxLocation() {\n return HUD_LOCATIONS.BULLET_STATUS;\n }\n\n static deadDuckStatusBoxLocation() {\n return HUD_LOCATIONS.DEAD_DUCK_STATUS;\n }\n\n static missedDuckStatusBoxLocation() {\n return HUD_LOCATIONS.MISSED_DUCK_STATUS;\n }\n /**\n * scaleToWindow\n * Helper method that scales the stage container to the window size\n */\n scaleToWindow() {\n this.scale.set(window.innerWidth / MAX_X, window.innerHeight / MAX_Y);\n }\n\n /**\n * _setStage\n * Private method that adds all of the main pieces to the scene\n * @returns {Stage}\n * @private\n */\n _setStage() {\n const background = new extras.AnimatedSprite([\n loader.resources[this.spritesheet].textures['scene/back/0.png']\n ]);\n background.position.set(0, 0);\n\n const tree = new extras.AnimatedSprite([loader.resources[this.spritesheet].textures['scene/tree/0.png']]);\n tree.position.set(100, 237);\n\n this.addChild(tree);\n this.addChild(background);\n this.addChild(this.dog);\n this.addChild(this.flashScreen);\n this.addChild(this.hud);\n\n return this;\n }\n\n /**\n * preLevelAnimation\n * Helper method that runs the level intro animation with the dog and returns a promise that resolves\n * when it's complete.\n * @returns {Promise}\n */\n preLevelAnimation() {\n return new BPromise((resolve) => {\n this.cleanUpDucks();\n\n const sniffOpts = {\n startPoint: DOG_POINTS.SNIFF_START,\n endPoint: DOG_POINTS.SNIFF_END\n };\n\n const findOpts = {\n onComplete: () => {\n this.setChildIndex(this.dog, 0);\n resolve();\n }\n };\n\n this.dog.sniff(sniffOpts).find(findOpts);\n });\n }\n\n /**\n * addDucks\n * Helper method that adds ducks to the container and causes them to fly around randomly.\n * @param {Number} numDucks - How many ducks to add to the stage\n * @param {Number} speed - Value from 0 (slow) to 10 (fast) that determines how fast the ducks will fly\n */\n addDucks(numDucks, speed) {\n for (let i = 0; i < numDucks; i++) {\n const duckColor = i % 2 === 0 ? 'red' : 'black';\n\n // Al was here.\n const newDuck = new Duck({\n spritesheet: this.spritesheet,\n colorProfile: duckColor,\n maxX: MAX_X,\n maxY: MAX_Y\n });\n newDuck.position.set(DUCK_POINTS.ORIGIN.x, DUCK_POINTS.ORIGIN.y);\n this.addChildAt(newDuck, 0);\n newDuck.randomFlight({\n speed\n });\n\n this.ducks.push(newDuck);\n }\n }\n\n /**\n * shotsFired\n * Click handler for the stage, scale's the location of the click to ensure coordinate system\n * alignment and then calculates if any of the ducks were hit and should be shot.\n * @param {{x:Number, y:Number}} clickPoint - Point where the container was clicked in real coordinates\n * @returns {Number} - The number of ducks hit with the shot\n */\n shotsFired(clickPoint) {\n // flash the screen\n this.flashScreen.visible = true;\n _delay(() => {\n this.flashScreen.visible = false;\n }, FLASH_MS);\n\n let ducksShot = 0;\n for (let i = 0; i < this.ducks.length; i++) {\n const duck = this.ducks[i];\n if (duck.alive && Utils.pointDistance(duck.position, this.getScaledClickLocation(clickPoint)) < 60) {\n ducksShot++;\n duck.shot();\n duck.timeline.add(() => {\n this.dog.retrieve();\n });\n }\n }\n return ducksShot;\n }\n\n clickedReplay(clickPoint) {\n return Utils.pointDistance(this.getScaledClickLocation(clickPoint), HUD_LOCATIONS.REPLAY_BUTTON) < 200;\n }\n\n getScaledClickLocation(clickPoint) {\n return {\n x: clickPoint.x / this.scale.x,\n y: clickPoint.y / this.scale.y\n };\n }\n /**\n * flyAway\n * Helper method that causes the sky to change color and the ducks to fly away\n * @returns {Promise} - This promise is resolved when all the ducks have flown away\n */\n flyAway() {\n this.dog.laugh();\n\n const duckPromises = [];\n\n for (let i = 0; i < this.ducks.length; i++) {\n const duck = this.ducks[i];\n if (duck.alive) {\n duckPromises.push(new BPromise((resolve) => {\n duck.stopAndClearTimeline();\n duck.flyTo({\n point: new Point(MAX_X / 2, -500),\n onComplete: resolve\n });\n }));\n }\n }\n\n return BPromise.all(duckPromises).then(this.cleanUpDucks.bind(this));\n }\n\n /**\n * cleanUpDucks\n * Helper that removes all ducks from the container and object\n */\n cleanUpDucks() {\n for (let i = 0; i < this.ducks.length; i++) {\n this.removeChild(this.ducks[i]);\n }\n this.ducks = [];\n }\n\n /**\n * ducksAlive\n * Helper that returns a boolean value depending on whether or not ducks are alive. The distinction\n * is that even dead ducks may be animating and still \"active\"\n * @returns {Boolean}\n */\n ducksAlive() {\n return _some(this.ducks, (duck) => {\n return duck.alive;\n });\n }\n\n /**\n * ducksActive\n * Helper that returns a boolean value depending on whether or not ducks are animating. Both live\n * and dead ducks may be animating.\n * @returns {Boolean}\n */\n ducksActive() {\n return _some(this.ducks, (duck) => {\n return duck.isActive();\n });\n }\n\n /**\n * dogActive\n * Helper proxy method that returns a boolean depending on whether the dog is animating\n * @returns {boolean}\n */\n dogActive() {\n return this.dog.isActive();\n }\n\n /**\n * isActive\n * High level helper to determine if things are animating on the stage\n * @returns {boolean|Boolean}\n */\n isActive() {\n return this.dogActive() || this.ducksAlive() || this.ducksActive();\n }\n}\n\nexport default Stage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/modules/Stage.js","/* @preserve\n * The MIT License (MIT)\n * \n * Copyright (c) 2013-2017 Petka Antonov\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n * \n */\n/**\n * bluebird build version 3.5.0\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n*/\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var f;\"undefined\"!=typeof window?f=window:\"undefined\"!=typeof global?f=global:\"undefined\"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_==\"function\"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_==\"function\"&&_dereq_;for(var o=0;o 0) {\n var fn = queue.shift();\n if (typeof fn !== \"function\") {\n fn._settlePromises();\n continue;\n }\n var receiver = queue.shift();\n var arg = queue.shift();\n fn.call(receiver, arg);\n }\n};\n\nAsync.prototype._drainQueues = function () {\n this._drainQueue(this._normalQueue);\n this._reset();\n this._haveDrainedQueues = true;\n this._drainQueue(this._lateQueue);\n};\n\nAsync.prototype._queueTick = function () {\n if (!this._isTickUsed) {\n this._isTickUsed = true;\n this._schedule(this.drainQueues);\n }\n};\n\nAsync.prototype._reset = function () {\n this._isTickUsed = false;\n};\n\nmodule.exports = Async;\nmodule.exports.firstLineError = firstLineError;\n\n},{\"./queue\":26,\"./schedule\":29,\"./util\":36}],3:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\nvar calledBind = false;\nvar rejectThis = function(_, e) {\n this._reject(e);\n};\n\nvar targetRejected = function(e, context) {\n context.promiseRejectionQueued = true;\n context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\n};\n\nvar bindingResolved = function(thisArg, context) {\n if (((this._bitField & 50397184) === 0)) {\n this._resolveCallback(context.target);\n }\n};\n\nvar bindingRejected = function(e, context) {\n if (!context.promiseRejectionQueued) this._reject(e);\n};\n\nPromise.prototype.bind = function (thisArg) {\n if (!calledBind) {\n calledBind = true;\n Promise.prototype._propagateFrom = debug.propagateFromFunction();\n Promise.prototype._boundValue = debug.boundValueFunction();\n }\n var maybePromise = tryConvertToPromise(thisArg);\n var ret = new Promise(INTERNAL);\n ret._propagateFrom(this, 1);\n var target = this._target();\n ret._setBoundTo(maybePromise);\n if (maybePromise instanceof Promise) {\n var context = {\n promiseRejectionQueued: false,\n promise: ret,\n target: target,\n bindingPromise: maybePromise\n };\n target._then(INTERNAL, targetRejected, undefined, ret, context);\n maybePromise._then(\n bindingResolved, bindingRejected, undefined, ret, context);\n ret._setOnCancel(maybePromise);\n } else {\n ret._resolveCallback(target);\n }\n return ret;\n};\n\nPromise.prototype._setBoundTo = function (obj) {\n if (obj !== undefined) {\n this._bitField = this._bitField | 2097152;\n this._boundTo = obj;\n } else {\n this._bitField = this._bitField & (~2097152);\n }\n};\n\nPromise.prototype._isBound = function () {\n return (this._bitField & 2097152) === 2097152;\n};\n\nPromise.bind = function (thisArg, value) {\n return Promise.resolve(value).bind(thisArg);\n};\n};\n\n},{}],4:[function(_dereq_,module,exports){\n\"use strict\";\nvar old;\nif (typeof Promise !== \"undefined\") old = Promise;\nfunction noConflict() {\n try { if (Promise === bluebird) Promise = old; }\n catch (e) {}\n return bluebird;\n}\nvar bluebird = _dereq_(\"./promise\")();\nbluebird.noConflict = noConflict;\nmodule.exports = bluebird;\n\n},{\"./promise\":22}],5:[function(_dereq_,module,exports){\n\"use strict\";\nvar cr = Object.create;\nif (cr) {\n var callerCache = cr(null);\n var getterCache = cr(null);\n callerCache[\" size\"] = getterCache[\" size\"] = 0;\n}\n\nmodule.exports = function(Promise) {\nvar util = _dereq_(\"./util\");\nvar canEvaluate = util.canEvaluate;\nvar isIdentifier = util.isIdentifier;\n\nvar getMethodCaller;\nvar getGetter;\nif (!true) {\nvar makeMethodCaller = function (methodName) {\n return new Function(\"ensureMethod\", \" \\n\\\n return function(obj) { \\n\\\n 'use strict' \\n\\\n var len = this.length; \\n\\\n ensureMethod(obj, 'methodName'); \\n\\\n switch(len) { \\n\\\n case 1: return obj.methodName(this[0]); \\n\\\n case 2: return obj.methodName(this[0], this[1]); \\n\\\n case 3: return obj.methodName(this[0], this[1], this[2]); \\n\\\n case 0: return obj.methodName(); \\n\\\n default: \\n\\\n return obj.methodName.apply(obj, this); \\n\\\n } \\n\\\n }; \\n\\\n \".replace(/methodName/g, methodName))(ensureMethod);\n};\n\nvar makeGetter = function (propertyName) {\n return new Function(\"obj\", \" \\n\\\n 'use strict'; \\n\\\n return obj.propertyName; \\n\\\n \".replace(\"propertyName\", propertyName));\n};\n\nvar getCompiled = function(name, compiler, cache) {\n var ret = cache[name];\n if (typeof ret !== \"function\") {\n if (!isIdentifier(name)) {\n return null;\n }\n ret = compiler(name);\n cache[name] = ret;\n cache[\" size\"]++;\n if (cache[\" size\"] > 512) {\n var keys = Object.keys(cache);\n for (var i = 0; i < 256; ++i) delete cache[keys[i]];\n cache[\" size\"] = keys.length - 256;\n }\n }\n return ret;\n};\n\ngetMethodCaller = function(name) {\n return getCompiled(name, makeMethodCaller, callerCache);\n};\n\ngetGetter = function(name) {\n return getCompiled(name, makeGetter, getterCache);\n};\n}\n\nfunction ensureMethod(obj, methodName) {\n var fn;\n if (obj != null) fn = obj[methodName];\n if (typeof fn !== \"function\") {\n var message = \"Object \" + util.classString(obj) + \" has no method '\" +\n util.toString(methodName) + \"'\";\n throw new Promise.TypeError(message);\n }\n return fn;\n}\n\nfunction caller(obj) {\n var methodName = this.pop();\n var fn = ensureMethod(obj, methodName);\n return fn.apply(obj, this);\n}\nPromise.prototype.call = function (methodName) {\n var args = [].slice.call(arguments, 1);;\n if (!true) {\n if (canEvaluate) {\n var maybeCaller = getMethodCaller(methodName);\n if (maybeCaller !== null) {\n return this._then(\n maybeCaller, undefined, undefined, args, undefined);\n }\n }\n }\n args.push(methodName);\n return this._then(caller, undefined, undefined, args, undefined);\n};\n\nfunction namedGetter(obj) {\n return obj[this];\n}\nfunction indexedGetter(obj) {\n var index = +this;\n if (index < 0) index = Math.max(0, index + obj.length);\n return obj[index];\n}\nPromise.prototype.get = function (propertyName) {\n var isIndex = (typeof propertyName === \"number\");\n var getter;\n if (!isIndex) {\n if (canEvaluate) {\n var maybeGetter = getGetter(propertyName);\n getter = maybeGetter !== null ? maybeGetter : namedGetter;\n } else {\n getter = namedGetter;\n }\n } else {\n getter = indexedGetter;\n }\n return this._then(getter, undefined, undefined, propertyName, undefined);\n};\n};\n\n},{\"./util\":36}],6:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nPromise.prototype[\"break\"] = Promise.prototype.cancel = function() {\n if (!debug.cancellation()) return this._warn(\"cancellation is disabled\");\n\n var promise = this;\n var child = promise;\n while (promise._isCancellable()) {\n if (!promise._cancelBy(child)) {\n if (child._isFollowing()) {\n child._followee().cancel();\n } else {\n child._cancelBranched();\n }\n break;\n }\n\n var parent = promise._cancellationParent;\n if (parent == null || !parent._isCancellable()) {\n if (promise._isFollowing()) {\n promise._followee().cancel();\n } else {\n promise._cancelBranched();\n }\n break;\n } else {\n if (promise._isFollowing()) promise._followee().cancel();\n promise._setWillBeCancelled();\n child = promise;\n promise = parent;\n }\n }\n};\n\nPromise.prototype._branchHasCancelled = function() {\n this._branchesRemainingToCancel--;\n};\n\nPromise.prototype._enoughBranchesHaveCancelled = function() {\n return this._branchesRemainingToCancel === undefined ||\n this._branchesRemainingToCancel <= 0;\n};\n\nPromise.prototype._cancelBy = function(canceller) {\n if (canceller === this) {\n this._branchesRemainingToCancel = 0;\n this._invokeOnCancel();\n return true;\n } else {\n this._branchHasCancelled();\n if (this._enoughBranchesHaveCancelled()) {\n this._invokeOnCancel();\n return true;\n }\n }\n return false;\n};\n\nPromise.prototype._cancelBranched = function() {\n if (this._enoughBranchesHaveCancelled()) {\n this._cancel();\n }\n};\n\nPromise.prototype._cancel = function() {\n if (!this._isCancellable()) return;\n this._setCancelled();\n async.invoke(this._cancelPromises, this, undefined);\n};\n\nPromise.prototype._cancelPromises = function() {\n if (this._length() > 0) this._settlePromises();\n};\n\nPromise.prototype._unsetOnCancel = function() {\n this._onCancelField = undefined;\n};\n\nPromise.prototype._isCancellable = function() {\n return this.isPending() && !this._isCancelled();\n};\n\nPromise.prototype.isCancellable = function() {\n return this.isPending() && !this.isCancelled();\n};\n\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\n if (util.isArray(onCancelCallback)) {\n for (var i = 0; i < onCancelCallback.length; ++i) {\n this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\n }\n } else if (onCancelCallback !== undefined) {\n if (typeof onCancelCallback === \"function\") {\n if (!internalOnly) {\n var e = tryCatch(onCancelCallback).call(this._boundValue());\n if (e === errorObj) {\n this._attachExtraTrace(e.e);\n async.throwLater(e.e);\n }\n }\n } else {\n onCancelCallback._resultCancelled(this);\n }\n }\n};\n\nPromise.prototype._invokeOnCancel = function() {\n var onCancelCallback = this._onCancel();\n this._unsetOnCancel();\n async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\n};\n\nPromise.prototype._invokeInternalOnCancel = function() {\n if (this._isCancellable()) {\n this._doInvokeOnCancel(this._onCancel(), true);\n this._unsetOnCancel();\n }\n};\n\nPromise.prototype._resultCancelled = function() {\n this.cancel();\n};\n\n};\n\n},{\"./util\":36}],7:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(NEXT_FILTER) {\nvar util = _dereq_(\"./util\");\nvar getKeys = _dereq_(\"./es5\").keys;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction catchFilter(instances, cb, promise) {\n return function(e) {\n var boundTo = promise._boundValue();\n predicateLoop: for (var i = 0; i < instances.length; ++i) {\n var item = instances[i];\n\n if (item === Error ||\n (item != null && item.prototype instanceof Error)) {\n if (e instanceof item) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (typeof item === \"function\") {\n var matchesPredicate = tryCatch(item).call(boundTo, e);\n if (matchesPredicate === errorObj) {\n return matchesPredicate;\n } else if (matchesPredicate) {\n return tryCatch(cb).call(boundTo, e);\n }\n } else if (util.isObject(e)) {\n var keys = getKeys(item);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n if (item[key] != e[key]) {\n continue predicateLoop;\n }\n }\n return tryCatch(cb).call(boundTo, e);\n }\n }\n return NEXT_FILTER;\n };\n}\n\nreturn catchFilter;\n};\n\n},{\"./es5\":13,\"./util\":36}],8:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar longStackTraces = false;\nvar contextStack = [];\n\nPromise.prototype._promiseCreated = function() {};\nPromise.prototype._pushContext = function() {};\nPromise.prototype._popContext = function() {return null;};\nPromise._peekContext = Promise.prototype._peekContext = function() {};\n\nfunction Context() {\n this._trace = new Context.CapturedTrace(peekContext());\n}\nContext.prototype._pushContext = function () {\n if (this._trace !== undefined) {\n this._trace._promiseCreated = null;\n contextStack.push(this._trace);\n }\n};\n\nContext.prototype._popContext = function () {\n if (this._trace !== undefined) {\n var trace = contextStack.pop();\n var ret = trace._promiseCreated;\n trace._promiseCreated = null;\n return ret;\n }\n return null;\n};\n\nfunction createContext() {\n if (longStackTraces) return new Context();\n}\n\nfunction peekContext() {\n var lastIndex = contextStack.length - 1;\n if (lastIndex >= 0) {\n return contextStack[lastIndex];\n }\n return undefined;\n}\nContext.CapturedTrace = null;\nContext.create = createContext;\nContext.deactivateLongStackTraces = function() {};\nContext.activateLongStackTraces = function() {\n var Promise_pushContext = Promise.prototype._pushContext;\n var Promise_popContext = Promise.prototype._popContext;\n var Promise_PeekContext = Promise._peekContext;\n var Promise_peekContext = Promise.prototype._peekContext;\n var Promise_promiseCreated = Promise.prototype._promiseCreated;\n Context.deactivateLongStackTraces = function() {\n Promise.prototype._pushContext = Promise_pushContext;\n Promise.prototype._popContext = Promise_popContext;\n Promise._peekContext = Promise_PeekContext;\n Promise.prototype._peekContext = Promise_peekContext;\n Promise.prototype._promiseCreated = Promise_promiseCreated;\n longStackTraces = false;\n };\n longStackTraces = true;\n Promise.prototype._pushContext = Context.prototype._pushContext;\n Promise.prototype._popContext = Context.prototype._popContext;\n Promise._peekContext = Promise.prototype._peekContext = peekContext;\n Promise.prototype._promiseCreated = function() {\n var ctx = this._peekContext();\n if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\n };\n};\nreturn Context;\n};\n\n},{}],9:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, Context) {\nvar getDomain = Promise._getDomain;\nvar async = Promise._async;\nvar Warning = _dereq_(\"./errors\").Warning;\nvar util = _dereq_(\"./util\");\nvar canAttachTrace = util.canAttachTrace;\nvar unhandledRejectionHandled;\nvar possiblyUnhandledRejection;\nvar bluebirdFramePattern =\n /[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/;\nvar nodeFramePattern = /\\((?:timers\\.js):\\d+:\\d+\\)/;\nvar parseLinePattern = /[\\/<\\(](.+?):(\\d+):(\\d+)\\)?\\s*$/;\nvar stackFramePattern = null;\nvar formatStack = null;\nvar indentStackFrames = false;\nvar printWarning;\nvar debugging = !!(util.env(\"BLUEBIRD_DEBUG\") != 0 &&\n (true ||\n util.env(\"BLUEBIRD_DEBUG\") ||\n util.env(\"NODE_ENV\") === \"development\"));\n\nvar warnings = !!(util.env(\"BLUEBIRD_WARNINGS\") != 0 &&\n (debugging || util.env(\"BLUEBIRD_WARNINGS\")));\n\nvar longStackTraces = !!(util.env(\"BLUEBIRD_LONG_STACK_TRACES\") != 0 &&\n (debugging || util.env(\"BLUEBIRD_LONG_STACK_TRACES\")));\n\nvar wForgottenReturn = util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\") != 0 &&\n (warnings || !!util.env(\"BLUEBIRD_W_FORGOTTEN_RETURN\"));\n\nPromise.prototype.suppressUnhandledRejections = function() {\n var target = this._target();\n target._bitField = ((target._bitField & (~1048576)) |\n 524288);\n};\n\nPromise.prototype._ensurePossibleRejectionHandled = function () {\n if ((this._bitField & 524288) !== 0) return;\n this._setRejectionIsUnhandled();\n async.invokeLater(this._notifyUnhandledRejection, this, undefined);\n};\n\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\n fireRejectionEvent(\"rejectionHandled\",\n unhandledRejectionHandled, undefined, this);\n};\n\nPromise.prototype._setReturnedNonUndefined = function() {\n this._bitField = this._bitField | 268435456;\n};\n\nPromise.prototype._returnedNonUndefined = function() {\n return (this._bitField & 268435456) !== 0;\n};\n\nPromise.prototype._notifyUnhandledRejection = function () {\n if (this._isRejectionUnhandled()) {\n var reason = this._settledValue();\n this._setUnhandledRejectionIsNotified();\n fireRejectionEvent(\"unhandledRejection\",\n possiblyUnhandledRejection, reason, this);\n }\n};\n\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField | 262144;\n};\n\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\n this._bitField = this._bitField & (~262144);\n};\n\nPromise.prototype._isUnhandledRejectionNotified = function () {\n return (this._bitField & 262144) > 0;\n};\n\nPromise.prototype._setRejectionIsUnhandled = function () {\n this._bitField = this._bitField | 1048576;\n};\n\nPromise.prototype._unsetRejectionIsUnhandled = function () {\n this._bitField = this._bitField & (~1048576);\n if (this._isUnhandledRejectionNotified()) {\n this._unsetUnhandledRejectionIsNotified();\n this._notifyUnhandledRejectionIsHandled();\n }\n};\n\nPromise.prototype._isRejectionUnhandled = function () {\n return (this._bitField & 1048576) > 0;\n};\n\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\n return warn(message, shouldUseOwnTrace, promise || this);\n};\n\nPromise.onPossiblyUnhandledRejection = function (fn) {\n var domain = getDomain();\n possiblyUnhandledRejection =\n typeof fn === \"function\" ? (domain === null ?\n fn : util.domainBind(domain, fn))\n : undefined;\n};\n\nPromise.onUnhandledRejectionHandled = function (fn) {\n var domain = getDomain();\n unhandledRejectionHandled =\n typeof fn === \"function\" ? (domain === null ?\n fn : util.domainBind(domain, fn))\n : undefined;\n};\n\nvar disableLongStackTraces = function() {};\nPromise.longStackTraces = function () {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n if (!config.longStackTraces && longStackTracesIsSupported()) {\n var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\n var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\n config.longStackTraces = true;\n disableLongStackTraces = function() {\n if (async.haveItemsQueued() && !config.longStackTraces) {\n throw new Error(\"cannot enable long stack traces after promises have been created\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n Promise.prototype._captureStackTrace = Promise_captureStackTrace;\n Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\n Context.deactivateLongStackTraces();\n async.enableTrampoline();\n config.longStackTraces = false;\n };\n Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\n Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\n Context.activateLongStackTraces();\n async.disableTrampolineIfNecessary();\n }\n};\n\nPromise.hasLongStackTraces = function () {\n return config.longStackTraces && longStackTracesIsSupported();\n};\n\nvar fireDomEvent = (function() {\n try {\n if (typeof CustomEvent === \"function\") {\n var event = new CustomEvent(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = new CustomEvent(name.toLowerCase(), {\n detail: event,\n cancelable: true\n });\n return !util.global.dispatchEvent(domEvent);\n };\n } else if (typeof Event === \"function\") {\n var event = new Event(\"CustomEvent\");\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = new Event(name.toLowerCase(), {\n cancelable: true\n });\n domEvent.detail = event;\n return !util.global.dispatchEvent(domEvent);\n };\n } else {\n var event = document.createEvent(\"CustomEvent\");\n event.initCustomEvent(\"testingtheevent\", false, true, {});\n util.global.dispatchEvent(event);\n return function(name, event) {\n var domEvent = document.createEvent(\"CustomEvent\");\n domEvent.initCustomEvent(name.toLowerCase(), false, true,\n event);\n return !util.global.dispatchEvent(domEvent);\n };\n }\n } catch (e) {}\n return function() {\n return false;\n };\n})();\n\nvar fireGlobalEvent = (function() {\n if (util.isNode) {\n return function() {\n return process.emit.apply(process, arguments);\n };\n } else {\n if (!util.global) {\n return function() {\n return false;\n };\n }\n return function(name) {\n var methodName = \"on\" + name.toLowerCase();\n var method = util.global[methodName];\n if (!method) return false;\n method.apply(util.global, [].slice.call(arguments, 1));\n return true;\n };\n }\n})();\n\nfunction generatePromiseLifecycleEventObject(name, promise) {\n return {promise: promise};\n}\n\nvar eventToObjectGenerator = {\n promiseCreated: generatePromiseLifecycleEventObject,\n promiseFulfilled: generatePromiseLifecycleEventObject,\n promiseRejected: generatePromiseLifecycleEventObject,\n promiseResolved: generatePromiseLifecycleEventObject,\n promiseCancelled: generatePromiseLifecycleEventObject,\n promiseChained: function(name, promise, child) {\n return {promise: promise, child: child};\n },\n warning: function(name, warning) {\n return {warning: warning};\n },\n unhandledRejection: function (name, reason, promise) {\n return {reason: reason, promise: promise};\n },\n rejectionHandled: generatePromiseLifecycleEventObject\n};\n\nvar activeFireEvent = function (name) {\n var globalEventFired = false;\n try {\n globalEventFired = fireGlobalEvent.apply(null, arguments);\n } catch (e) {\n async.throwLater(e);\n globalEventFired = true;\n }\n\n var domEventFired = false;\n try {\n domEventFired = fireDomEvent(name,\n eventToObjectGenerator[name].apply(null, arguments));\n } catch (e) {\n async.throwLater(e);\n domEventFired = true;\n }\n\n return domEventFired || globalEventFired;\n};\n\nPromise.config = function(opts) {\n opts = Object(opts);\n if (\"longStackTraces\" in opts) {\n if (opts.longStackTraces) {\n Promise.longStackTraces();\n } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\n disableLongStackTraces();\n }\n }\n if (\"warnings\" in opts) {\n var warningsOption = opts.warnings;\n config.warnings = !!warningsOption;\n wForgottenReturn = config.warnings;\n\n if (util.isObject(warningsOption)) {\n if (\"wForgottenReturn\" in warningsOption) {\n wForgottenReturn = !!warningsOption.wForgottenReturn;\n }\n }\n }\n if (\"cancellation\" in opts && opts.cancellation && !config.cancellation) {\n if (async.haveItemsQueued()) {\n throw new Error(\n \"cannot enable cancellation after promises are in use\");\n }\n Promise.prototype._clearCancellationData =\n cancellationClearCancellationData;\n Promise.prototype._propagateFrom = cancellationPropagateFrom;\n Promise.prototype._onCancel = cancellationOnCancel;\n Promise.prototype._setOnCancel = cancellationSetOnCancel;\n Promise.prototype._attachCancellationCallback =\n cancellationAttachCancellationCallback;\n Promise.prototype._execute = cancellationExecute;\n propagateFromFunction = cancellationPropagateFrom;\n config.cancellation = true;\n }\n if (\"monitoring\" in opts) {\n if (opts.monitoring && !config.monitoring) {\n config.monitoring = true;\n Promise.prototype._fireEvent = activeFireEvent;\n } else if (!opts.monitoring && config.monitoring) {\n config.monitoring = false;\n Promise.prototype._fireEvent = defaultFireEvent;\n }\n }\n return Promise;\n};\n\nfunction defaultFireEvent() { return false; }\n\nPromise.prototype._fireEvent = defaultFireEvent;\nPromise.prototype._execute = function(executor, resolve, reject) {\n try {\n executor(resolve, reject);\n } catch (e) {\n return e;\n }\n};\nPromise.prototype._onCancel = function () {};\nPromise.prototype._setOnCancel = function (handler) { ; };\nPromise.prototype._attachCancellationCallback = function(onCancel) {\n ;\n};\nPromise.prototype._captureStackTrace = function () {};\nPromise.prototype._attachExtraTrace = function () {};\nPromise.prototype._clearCancellationData = function() {};\nPromise.prototype._propagateFrom = function (parent, flags) {\n ;\n ;\n};\n\nfunction cancellationExecute(executor, resolve, reject) {\n var promise = this;\n try {\n executor(resolve, reject, function(onCancel) {\n if (typeof onCancel !== \"function\") {\n throw new TypeError(\"onCancel must be a function, got: \" +\n util.toString(onCancel));\n }\n promise._attachCancellationCallback(onCancel);\n });\n } catch (e) {\n return e;\n }\n}\n\nfunction cancellationAttachCancellationCallback(onCancel) {\n if (!this._isCancellable()) return this;\n\n var previousOnCancel = this._onCancel();\n if (previousOnCancel !== undefined) {\n if (util.isArray(previousOnCancel)) {\n previousOnCancel.push(onCancel);\n } else {\n this._setOnCancel([previousOnCancel, onCancel]);\n }\n } else {\n this._setOnCancel(onCancel);\n }\n}\n\nfunction cancellationOnCancel() {\n return this._onCancelField;\n}\n\nfunction cancellationSetOnCancel(onCancel) {\n this._onCancelField = onCancel;\n}\n\nfunction cancellationClearCancellationData() {\n this._cancellationParent = undefined;\n this._onCancelField = undefined;\n}\n\nfunction cancellationPropagateFrom(parent, flags) {\n if ((flags & 1) !== 0) {\n this._cancellationParent = parent;\n var branchesRemainingToCancel = parent._branchesRemainingToCancel;\n if (branchesRemainingToCancel === undefined) {\n branchesRemainingToCancel = 0;\n }\n parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\n }\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n}\n\nfunction bindingPropagateFrom(parent, flags) {\n if ((flags & 2) !== 0 && parent._isBound()) {\n this._setBoundTo(parent._boundTo);\n }\n}\nvar propagateFromFunction = bindingPropagateFrom;\n\nfunction boundValueFunction() {\n var ret = this._boundTo;\n if (ret !== undefined) {\n if (ret instanceof Promise) {\n if (ret.isFulfilled()) {\n return ret.value();\n } else {\n return undefined;\n }\n }\n }\n return ret;\n}\n\nfunction longStackTracesCaptureStackTrace() {\n this._trace = new CapturedTrace(this._peekContext());\n}\n\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\n if (canAttachTrace(error)) {\n var trace = this._trace;\n if (trace !== undefined) {\n if (ignoreSelf) trace = trace._parent;\n }\n if (trace !== undefined) {\n trace.attachExtraTrace(error);\n } else if (!error.__stackCleaned__) {\n var parsed = parseStackAndMessage(error);\n util.notEnumerableProp(error, \"stack\",\n parsed.message + \"\\n\" + parsed.stack.join(\"\\n\"));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n }\n }\n}\n\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\n parent) {\n if (returnValue === undefined && promiseCreated !== null &&\n wForgottenReturn) {\n if (parent !== undefined && parent._returnedNonUndefined()) return;\n if ((promise._bitField & 65535) === 0) return;\n\n if (name) name = name + \" \";\n var handlerLine = \"\";\n var creatorLine = \"\";\n if (promiseCreated._trace) {\n var traceLines = promiseCreated._trace.stack.split(\"\\n\");\n var stack = cleanStack(traceLines);\n for (var i = stack.length - 1; i >= 0; --i) {\n var line = stack[i];\n if (!nodeFramePattern.test(line)) {\n var lineMatches = line.match(parseLinePattern);\n if (lineMatches) {\n handlerLine = \"at \" + lineMatches[1] +\n \":\" + lineMatches[2] + \":\" + lineMatches[3] + \" \";\n }\n break;\n }\n }\n\n if (stack.length > 0) {\n var firstUserLine = stack[0];\n for (var i = 0; i < traceLines.length; ++i) {\n\n if (traceLines[i] === firstUserLine) {\n if (i > 0) {\n creatorLine = \"\\n\" + traceLines[i - 1];\n }\n break;\n }\n }\n\n }\n }\n var msg = \"a promise was created in a \" + name +\n \"handler \" + handlerLine + \"but was not returned from it, \" +\n \"see http://goo.gl/rRqMUw\" +\n creatorLine;\n promise._warn(msg, true, promiseCreated);\n }\n}\n\nfunction deprecated(name, replacement) {\n var message = name +\n \" is deprecated and will be removed in a future version.\";\n if (replacement) message += \" Use \" + replacement + \" instead.\";\n return warn(message);\n}\n\nfunction warn(message, shouldUseOwnTrace, promise) {\n if (!config.warnings) return;\n var warning = new Warning(message);\n var ctx;\n if (shouldUseOwnTrace) {\n promise._attachExtraTrace(warning);\n } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\n ctx.attachExtraTrace(warning);\n } else {\n var parsed = parseStackAndMessage(warning);\n warning.stack = parsed.message + \"\\n\" + parsed.stack.join(\"\\n\");\n }\n\n if (!activeFireEvent(\"warning\", warning)) {\n formatAndLogError(warning, \"\", true);\n }\n}\n\nfunction reconstructStack(message, stacks) {\n for (var i = 0; i < stacks.length - 1; ++i) {\n stacks[i].push(\"From previous event:\");\n stacks[i] = stacks[i].join(\"\\n\");\n }\n if (i < stacks.length) {\n stacks[i] = stacks[i].join(\"\\n\");\n }\n return message + \"\\n\" + stacks.join(\"\\n\");\n}\n\nfunction removeDuplicateOrEmptyJumps(stacks) {\n for (var i = 0; i < stacks.length; ++i) {\n if (stacks[i].length === 0 ||\n ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\n stacks.splice(i, 1);\n i--;\n }\n }\n}\n\nfunction removeCommonRoots(stacks) {\n var current = stacks[0];\n for (var i = 1; i < stacks.length; ++i) {\n var prev = stacks[i];\n var currentLastIndex = current.length - 1;\n var currentLastLine = current[currentLastIndex];\n var commonRootMeetPoint = -1;\n\n for (var j = prev.length - 1; j >= 0; --j) {\n if (prev[j] === currentLastLine) {\n commonRootMeetPoint = j;\n break;\n }\n }\n\n for (var j = commonRootMeetPoint; j >= 0; --j) {\n var line = prev[j];\n if (current[currentLastIndex] === line) {\n current.pop();\n currentLastIndex--;\n } else {\n break;\n }\n }\n current = prev;\n }\n}\n\nfunction cleanStack(stack) {\n var ret = [];\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n var isTraceLine = \" (No stack trace)\" === line ||\n stackFramePattern.test(line);\n var isInternalFrame = isTraceLine && shouldIgnore(line);\n if (isTraceLine && !isInternalFrame) {\n if (indentStackFrames && line.charAt(0) !== \" \") {\n line = \" \" + line;\n }\n ret.push(line);\n }\n }\n return ret;\n}\n\nfunction stackFramesAsArray(error) {\n var stack = error.stack.replace(/\\s+$/g, \"\").split(\"\\n\");\n for (var i = 0; i < stack.length; ++i) {\n var line = stack[i];\n if (\" (No stack trace)\" === line || stackFramePattern.test(line)) {\n break;\n }\n }\n if (i > 0 && error.name != \"SyntaxError\") {\n stack = stack.slice(i);\n }\n return stack;\n}\n\nfunction parseStackAndMessage(error) {\n var stack = error.stack;\n var message = error.toString();\n stack = typeof stack === \"string\" && stack.length > 0\n ? stackFramesAsArray(error) : [\" (No stack trace)\"];\n return {\n message: message,\n stack: error.name == \"SyntaxError\" ? stack : cleanStack(stack)\n };\n}\n\nfunction formatAndLogError(error, title, isSoft) {\n if (typeof console !== \"undefined\") {\n var message;\n if (util.isObject(error)) {\n var stack = error.stack;\n message = title + formatStack(stack, error);\n } else {\n message = title + String(error);\n }\n if (typeof printWarning === \"function\") {\n printWarning(message, isSoft);\n } else if (typeof console.log === \"function\" ||\n typeof console.log === \"object\") {\n console.log(message);\n }\n }\n}\n\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\n var localEventFired = false;\n try {\n if (typeof localHandler === \"function\") {\n localEventFired = true;\n if (name === \"rejectionHandled\") {\n localHandler(promise);\n } else {\n localHandler(reason, promise);\n }\n }\n } catch (e) {\n async.throwLater(e);\n }\n\n if (name === \"unhandledRejection\") {\n if (!activeFireEvent(name, reason, promise) && !localEventFired) {\n formatAndLogError(reason, \"Unhandled rejection \");\n }\n } else {\n activeFireEvent(name, promise);\n }\n}\n\nfunction formatNonError(obj) {\n var str;\n if (typeof obj === \"function\") {\n str = \"[function \" +\n (obj.name || \"anonymous\") +\n \"]\";\n } else {\n str = obj && typeof obj.toString === \"function\"\n ? obj.toString() : util.toString(obj);\n var ruselessToString = /\\[object [a-zA-Z0-9$_]+\\]/;\n if (ruselessToString.test(str)) {\n try {\n var newStr = JSON.stringify(obj);\n str = newStr;\n }\n catch(e) {\n\n }\n }\n if (str.length === 0) {\n str = \"(empty array)\";\n }\n }\n return (\"(<\" + snip(str) + \">, no stack trace)\");\n}\n\nfunction snip(str) {\n var maxChars = 41;\n if (str.length < maxChars) {\n return str;\n }\n return str.substr(0, maxChars - 3) + \"...\";\n}\n\nfunction longStackTracesIsSupported() {\n return typeof captureStackTrace === \"function\";\n}\n\nvar shouldIgnore = function() { return false; };\nvar parseLineInfoRegex = /[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;\nfunction parseLineInfo(line) {\n var matches = line.match(parseLineInfoRegex);\n if (matches) {\n return {\n fileName: matches[1],\n line: parseInt(matches[2], 10)\n };\n }\n}\n\nfunction setBounds(firstLineError, lastLineError) {\n if (!longStackTracesIsSupported()) return;\n var firstStackLines = firstLineError.stack.split(\"\\n\");\n var lastStackLines = lastLineError.stack.split(\"\\n\");\n var firstIndex = -1;\n var lastIndex = -1;\n var firstFileName;\n var lastFileName;\n for (var i = 0; i < firstStackLines.length; ++i) {\n var result = parseLineInfo(firstStackLines[i]);\n if (result) {\n firstFileName = result.fileName;\n firstIndex = result.line;\n break;\n }\n }\n for (var i = 0; i < lastStackLines.length; ++i) {\n var result = parseLineInfo(lastStackLines[i]);\n if (result) {\n lastFileName = result.fileName;\n lastIndex = result.line;\n break;\n }\n }\n if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\n firstFileName !== lastFileName || firstIndex >= lastIndex) {\n return;\n }\n\n shouldIgnore = function(line) {\n if (bluebirdFramePattern.test(line)) return true;\n var info = parseLineInfo(line);\n if (info) {\n if (info.fileName === firstFileName &&\n (firstIndex <= info.line && info.line <= lastIndex)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction CapturedTrace(parent) {\n this._parent = parent;\n this._promisesCreated = 0;\n var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\n captureStackTrace(this, CapturedTrace);\n if (length > 32) this.uncycle();\n}\nutil.inherits(CapturedTrace, Error);\nContext.CapturedTrace = CapturedTrace;\n\nCapturedTrace.prototype.uncycle = function() {\n var length = this._length;\n if (length < 2) return;\n var nodes = [];\n var stackToIndex = {};\n\n for (var i = 0, node = this; node !== undefined; ++i) {\n nodes.push(node);\n node = node._parent;\n }\n length = this._length = i;\n for (var i = length - 1; i >= 0; --i) {\n var stack = nodes[i].stack;\n if (stackToIndex[stack] === undefined) {\n stackToIndex[stack] = i;\n }\n }\n for (var i = 0; i < length; ++i) {\n var currentStack = nodes[i].stack;\n var index = stackToIndex[currentStack];\n if (index !== undefined && index !== i) {\n if (index > 0) {\n nodes[index - 1]._parent = undefined;\n nodes[index - 1]._length = 1;\n }\n nodes[i]._parent = undefined;\n nodes[i]._length = 1;\n var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\n\n if (index < length - 1) {\n cycleEdgeNode._parent = nodes[index + 1];\n cycleEdgeNode._parent.uncycle();\n cycleEdgeNode._length =\n cycleEdgeNode._parent._length + 1;\n } else {\n cycleEdgeNode._parent = undefined;\n cycleEdgeNode._length = 1;\n }\n var currentChildLength = cycleEdgeNode._length + 1;\n for (var j = i - 2; j >= 0; --j) {\n nodes[j]._length = currentChildLength;\n currentChildLength++;\n }\n return;\n }\n }\n};\n\nCapturedTrace.prototype.attachExtraTrace = function(error) {\n if (error.__stackCleaned__) return;\n this.uncycle();\n var parsed = parseStackAndMessage(error);\n var message = parsed.message;\n var stacks = [parsed.stack];\n\n var trace = this;\n while (trace !== undefined) {\n stacks.push(cleanStack(trace.stack.split(\"\\n\")));\n trace = trace._parent;\n }\n removeCommonRoots(stacks);\n removeDuplicateOrEmptyJumps(stacks);\n util.notEnumerableProp(error, \"stack\", reconstructStack(message, stacks));\n util.notEnumerableProp(error, \"__stackCleaned__\", true);\n};\n\nvar captureStackTrace = (function stackDetection() {\n var v8stackFramePattern = /^\\s*at\\s*/;\n var v8stackFormatter = function(stack, error) {\n if (typeof stack === \"string\") return stack;\n\n if (error.name !== undefined &&\n error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n\n if (typeof Error.stackTraceLimit === \"number\" &&\n typeof Error.captureStackTrace === \"function\") {\n Error.stackTraceLimit += 6;\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n var captureStackTrace = Error.captureStackTrace;\n\n shouldIgnore = function(line) {\n return bluebirdFramePattern.test(line);\n };\n return function(receiver, ignoreUntil) {\n Error.stackTraceLimit += 6;\n captureStackTrace(receiver, ignoreUntil);\n Error.stackTraceLimit -= 6;\n };\n }\n var err = new Error();\n\n if (typeof err.stack === \"string\" &&\n err.stack.split(\"\\n\")[0].indexOf(\"stackDetection@\") >= 0) {\n stackFramePattern = /@/;\n formatStack = v8stackFormatter;\n indentStackFrames = true;\n return function captureStackTrace(o) {\n o.stack = new Error().stack;\n };\n }\n\n var hasStackAfterThrow;\n try { throw new Error(); }\n catch(e) {\n hasStackAfterThrow = (\"stack\" in e);\n }\n if (!(\"stack\" in err) && hasStackAfterThrow &&\n typeof Error.stackTraceLimit === \"number\") {\n stackFramePattern = v8stackFramePattern;\n formatStack = v8stackFormatter;\n return function captureStackTrace(o) {\n Error.stackTraceLimit += 6;\n try { throw new Error(); }\n catch(e) { o.stack = e.stack; }\n Error.stackTraceLimit -= 6;\n };\n }\n\n formatStack = function(stack, error) {\n if (typeof stack === \"string\") return stack;\n\n if ((typeof error === \"object\" ||\n typeof error === \"function\") &&\n error.name !== undefined &&\n error.message !== undefined) {\n return error.toString();\n }\n return formatNonError(error);\n };\n\n return null;\n\n})([]);\n\nif (typeof console !== \"undefined\" && typeof console.warn !== \"undefined\") {\n printWarning = function (message) {\n console.warn(message);\n };\n if (util.isNode && process.stderr.isTTY) {\n printWarning = function(message, isSoft) {\n var color = isSoft ? \"\\u001b[33m\" : \"\\u001b[31m\";\n console.warn(color + message + \"\\u001b[0m\\n\");\n };\n } else if (!util.isNode && typeof (new Error().stack) === \"string\") {\n printWarning = function(message, isSoft) {\n console.warn(\"%c\" + message,\n isSoft ? \"color: darkorange\" : \"color: red\");\n };\n }\n}\n\nvar config = {\n warnings: warnings,\n longStackTraces: false,\n cancellation: false,\n monitoring: false\n};\n\nif (longStackTraces) Promise.longStackTraces();\n\nreturn {\n longStackTraces: function() {\n return config.longStackTraces;\n },\n warnings: function() {\n return config.warnings;\n },\n cancellation: function() {\n return config.cancellation;\n },\n monitoring: function() {\n return config.monitoring;\n },\n propagateFromFunction: function() {\n return propagateFromFunction;\n },\n boundValueFunction: function() {\n return boundValueFunction;\n },\n checkForgottenReturns: checkForgottenReturns,\n setBounds: setBounds,\n warn: warn,\n deprecated: deprecated,\n CapturedTrace: CapturedTrace,\n fireDomEvent: fireDomEvent,\n fireGlobalEvent: fireGlobalEvent\n};\n};\n\n},{\"./errors\":12,\"./util\":36}],10:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nfunction returner() {\n return this.value;\n}\nfunction thrower() {\n throw this.reason;\n}\n\nPromise.prototype[\"return\"] =\nPromise.prototype.thenReturn = function (value) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(\n returner, undefined, undefined, {value: value}, undefined);\n};\n\nPromise.prototype[\"throw\"] =\nPromise.prototype.thenThrow = function (reason) {\n return this._then(\n thrower, undefined, undefined, {reason: reason}, undefined);\n};\n\nPromise.prototype.catchThrow = function (reason) {\n if (arguments.length <= 1) {\n return this._then(\n undefined, thrower, undefined, {reason: reason}, undefined);\n } else {\n var _reason = arguments[1];\n var handler = function() {throw _reason;};\n return this.caught(reason, handler);\n }\n};\n\nPromise.prototype.catchReturn = function (value) {\n if (arguments.length <= 1) {\n if (value instanceof Promise) value.suppressUnhandledRejections();\n return this._then(\n undefined, returner, undefined, {value: value}, undefined);\n } else {\n var _value = arguments[1];\n if (_value instanceof Promise) _value.suppressUnhandledRejections();\n var handler = function() {return _value;};\n return this.caught(value, handler);\n }\n};\n};\n\n},{}],11:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseReduce = Promise.reduce;\nvar PromiseAll = Promise.all;\n\nfunction promiseAllThis() {\n return PromiseAll(this);\n}\n\nfunction PromiseMapSeries(promises, fn) {\n return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\n}\n\nPromise.prototype.each = function (fn) {\n return PromiseReduce(this, fn, INTERNAL, 0)\n ._then(promiseAllThis, undefined, undefined, this, undefined);\n};\n\nPromise.prototype.mapSeries = function (fn) {\n return PromiseReduce(this, fn, INTERNAL, INTERNAL);\n};\n\nPromise.each = function (promises, fn) {\n return PromiseReduce(promises, fn, INTERNAL, 0)\n ._then(promiseAllThis, undefined, undefined, promises, undefined);\n};\n\nPromise.mapSeries = PromiseMapSeries;\n};\n\n\n},{}],12:[function(_dereq_,module,exports){\n\"use strict\";\nvar es5 = _dereq_(\"./es5\");\nvar Objectfreeze = es5.freeze;\nvar util = _dereq_(\"./util\");\nvar inherits = util.inherits;\nvar notEnumerableProp = util.notEnumerableProp;\n\nfunction subError(nameProperty, defaultMessage) {\n function SubError(message) {\n if (!(this instanceof SubError)) return new SubError(message);\n notEnumerableProp(this, \"message\",\n typeof message === \"string\" ? message : defaultMessage);\n notEnumerableProp(this, \"name\", nameProperty);\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n Error.call(this);\n }\n }\n inherits(SubError, Error);\n return SubError;\n}\n\nvar _TypeError, _RangeError;\nvar Warning = subError(\"Warning\", \"warning\");\nvar CancellationError = subError(\"CancellationError\", \"cancellation error\");\nvar TimeoutError = subError(\"TimeoutError\", \"timeout error\");\nvar AggregateError = subError(\"AggregateError\", \"aggregate error\");\ntry {\n _TypeError = TypeError;\n _RangeError = RangeError;\n} catch(e) {\n _TypeError = subError(\"TypeError\", \"type error\");\n _RangeError = subError(\"RangeError\", \"range error\");\n}\n\nvar methods = (\"join pop push shift unshift slice filter forEach some \" +\n \"every map indexOf lastIndexOf reduce reduceRight sort reverse\").split(\" \");\n\nfor (var i = 0; i < methods.length; ++i) {\n if (typeof Array.prototype[methods[i]] === \"function\") {\n AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\n }\n}\n\nes5.defineProperty(AggregateError.prototype, \"length\", {\n value: 0,\n configurable: false,\n writable: true,\n enumerable: true\n});\nAggregateError.prototype[\"isOperational\"] = true;\nvar level = 0;\nAggregateError.prototype.toString = function() {\n var indent = Array(level * 4 + 1).join(\" \");\n var ret = \"\\n\" + indent + \"AggregateError of:\" + \"\\n\";\n level++;\n indent = Array(level * 4 + 1).join(\" \");\n for (var i = 0; i < this.length; ++i) {\n var str = this[i] === this ? \"[Circular AggregateError]\" : this[i] + \"\";\n var lines = str.split(\"\\n\");\n for (var j = 0; j < lines.length; ++j) {\n lines[j] = indent + lines[j];\n }\n str = lines.join(\"\\n\");\n ret += str + \"\\n\";\n }\n level--;\n return ret;\n};\n\nfunction OperationalError(message) {\n if (!(this instanceof OperationalError))\n return new OperationalError(message);\n notEnumerableProp(this, \"name\", \"OperationalError\");\n notEnumerableProp(this, \"message\", message);\n this.cause = message;\n this[\"isOperational\"] = true;\n\n if (message instanceof Error) {\n notEnumerableProp(this, \"message\", message.message);\n notEnumerableProp(this, \"stack\", message.stack);\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n}\ninherits(OperationalError, Error);\n\nvar errorTypes = Error[\"__BluebirdErrorTypes__\"];\nif (!errorTypes) {\n errorTypes = Objectfreeze({\n CancellationError: CancellationError,\n TimeoutError: TimeoutError,\n OperationalError: OperationalError,\n RejectionError: OperationalError,\n AggregateError: AggregateError\n });\n es5.defineProperty(Error, \"__BluebirdErrorTypes__\", {\n value: errorTypes,\n writable: false,\n enumerable: false,\n configurable: false\n });\n}\n\nmodule.exports = {\n Error: Error,\n TypeError: _TypeError,\n RangeError: _RangeError,\n CancellationError: errorTypes.CancellationError,\n OperationalError: errorTypes.OperationalError,\n TimeoutError: errorTypes.TimeoutError,\n AggregateError: errorTypes.AggregateError,\n Warning: Warning\n};\n\n},{\"./es5\":13,\"./util\":36}],13:[function(_dereq_,module,exports){\nvar isES5 = (function(){\n \"use strict\";\n return this === undefined;\n})();\n\nif (isES5) {\n module.exports = {\n freeze: Object.freeze,\n defineProperty: Object.defineProperty,\n getDescriptor: Object.getOwnPropertyDescriptor,\n keys: Object.keys,\n names: Object.getOwnPropertyNames,\n getPrototypeOf: Object.getPrototypeOf,\n isArray: Array.isArray,\n isES5: isES5,\n propertyIsWritable: function(obj, prop) {\n var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n return !!(!descriptor || descriptor.writable || descriptor.set);\n }\n };\n} else {\n var has = {}.hasOwnProperty;\n var str = {}.toString;\n var proto = {}.constructor.prototype;\n\n var ObjectKeys = function (o) {\n var ret = [];\n for (var key in o) {\n if (has.call(o, key)) {\n ret.push(key);\n }\n }\n return ret;\n };\n\n var ObjectGetDescriptor = function(o, key) {\n return {value: o[key]};\n };\n\n var ObjectDefineProperty = function (o, key, desc) {\n o[key] = desc.value;\n return o;\n };\n\n var ObjectFreeze = function (obj) {\n return obj;\n };\n\n var ObjectGetPrototypeOf = function (obj) {\n try {\n return Object(obj).constructor.prototype;\n }\n catch (e) {\n return proto;\n }\n };\n\n var ArrayIsArray = function (obj) {\n try {\n return str.call(obj) === \"[object Array]\";\n }\n catch(e) {\n return false;\n }\n };\n\n module.exports = {\n isArray: ArrayIsArray,\n keys: ObjectKeys,\n names: ObjectKeys,\n defineProperty: ObjectDefineProperty,\n getDescriptor: ObjectGetDescriptor,\n freeze: ObjectFreeze,\n getPrototypeOf: ObjectGetPrototypeOf,\n isES5: isES5,\n propertyIsWritable: function() {\n return true;\n }\n };\n}\n\n},{}],14:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseMap = Promise.map;\n\nPromise.prototype.filter = function (fn, options) {\n return PromiseMap(this, fn, options, INTERNAL);\n};\n\nPromise.filter = function (promises, fn, options) {\n return PromiseMap(promises, fn, options, INTERNAL);\n};\n};\n\n},{}],15:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) {\nvar util = _dereq_(\"./util\");\nvar CancellationError = Promise.CancellationError;\nvar errorObj = util.errorObj;\nvar catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\n\nfunction PassThroughHandlerContext(promise, type, handler) {\n this.promise = promise;\n this.type = type;\n this.handler = handler;\n this.called = false;\n this.cancelPromise = null;\n}\n\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\n return this.type === 0;\n};\n\nfunction FinallyHandlerCancelReaction(finallyHandler) {\n this.finallyHandler = finallyHandler;\n}\n\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\n checkCancel(this.finallyHandler);\n};\n\nfunction checkCancel(ctx, reason) {\n if (ctx.cancelPromise != null) {\n if (arguments.length > 1) {\n ctx.cancelPromise._reject(reason);\n } else {\n ctx.cancelPromise._cancel();\n }\n ctx.cancelPromise = null;\n return true;\n }\n return false;\n}\n\nfunction succeed() {\n return finallyHandler.call(this, this.promise._target()._settledValue());\n}\nfunction fail(reason) {\n if (checkCancel(this, reason)) return;\n errorObj.e = reason;\n return errorObj;\n}\nfunction finallyHandler(reasonOrValue) {\n var promise = this.promise;\n var handler = this.handler;\n\n if (!this.called) {\n this.called = true;\n var ret = this.isFinallyHandler()\n ? handler.call(promise._boundValue())\n : handler.call(promise._boundValue(), reasonOrValue);\n if (ret === NEXT_FILTER) {\n return ret;\n } else if (ret !== undefined) {\n promise._setReturnedNonUndefined();\n var maybePromise = tryConvertToPromise(ret, promise);\n if (maybePromise instanceof Promise) {\n if (this.cancelPromise != null) {\n if (maybePromise._isCancelled()) {\n var reason =\n new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n errorObj.e = reason;\n return errorObj;\n } else if (maybePromise.isPending()) {\n maybePromise._attachCancellationCallback(\n new FinallyHandlerCancelReaction(this));\n }\n }\n return maybePromise._then(\n succeed, fail, undefined, this, undefined);\n }\n }\n }\n\n if (promise.isRejected()) {\n checkCancel(this);\n errorObj.e = reasonOrValue;\n return errorObj;\n } else {\n checkCancel(this);\n return reasonOrValue;\n }\n}\n\nPromise.prototype._passThrough = function(handler, type, success, fail) {\n if (typeof handler !== \"function\") return this.then();\n return this._then(success,\n fail,\n undefined,\n new PassThroughHandlerContext(this, type, handler),\n undefined);\n};\n\nPromise.prototype.lastly =\nPromise.prototype[\"finally\"] = function (handler) {\n return this._passThrough(handler,\n 0,\n finallyHandler,\n finallyHandler);\n};\n\n\nPromise.prototype.tap = function (handler) {\n return this._passThrough(handler, 1, finallyHandler);\n};\n\nPromise.prototype.tapCatch = function (handlerOrPredicate) {\n var len = arguments.length;\n if(len === 1) {\n return this._passThrough(handlerOrPredicate,\n 1,\n undefined,\n finallyHandler);\n } else {\n var catchInstances = new Array(len - 1),\n j = 0, i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return Promise.reject(new TypeError(\n \"tapCatch statement predicate: \"\n + \"expecting an object but got \" + util.classString(item)\n ));\n }\n }\n catchInstances.length = j;\n var handler = arguments[i];\n return this._passThrough(catchFilter(catchInstances, handler, this),\n 1,\n undefined,\n finallyHandler);\n }\n\n};\n\nreturn PassThroughHandlerContext;\n};\n\n},{\"./catch_filter\":7,\"./util\":36}],16:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n apiRejection,\n INTERNAL,\n tryConvertToPromise,\n Proxyable,\n debug) {\nvar errors = _dereq_(\"./errors\");\nvar TypeError = errors.TypeError;\nvar util = _dereq_(\"./util\");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nvar yieldHandlers = [];\n\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\n for (var i = 0; i < yieldHandlers.length; ++i) {\n traceParent._pushContext();\n var result = tryCatch(yieldHandlers[i])(value);\n traceParent._popContext();\n if (result === errorObj) {\n traceParent._pushContext();\n var ret = Promise.reject(errorObj.e);\n traceParent._popContext();\n return ret;\n }\n var maybePromise = tryConvertToPromise(result, traceParent);\n if (maybePromise instanceof Promise) return maybePromise;\n }\n return null;\n}\n\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\n if (debug.cancellation()) {\n var internal = new Promise(INTERNAL);\n var _finallyPromise = this._finallyPromise = new Promise(INTERNAL);\n this._promise = internal.lastly(function() {\n return _finallyPromise;\n });\n internal._captureStackTrace();\n internal._setOnCancel(this);\n } else {\n var promise = this._promise = new Promise(INTERNAL);\n promise._captureStackTrace();\n }\n this._stack = stack;\n this._generatorFunction = generatorFunction;\n this._receiver = receiver;\n this._generator = undefined;\n this._yieldHandlers = typeof yieldHandler === \"function\"\n ? [yieldHandler].concat(yieldHandlers)\n : yieldHandlers;\n this._yieldedPromise = null;\n this._cancellationPhase = false;\n}\nutil.inherits(PromiseSpawn, Proxyable);\n\nPromiseSpawn.prototype._isResolved = function() {\n return this._promise === null;\n};\n\nPromiseSpawn.prototype._cleanup = function() {\n this._promise = this._generator = null;\n if (debug.cancellation() && this._finallyPromise !== null) {\n this._finallyPromise._fulfill();\n this._finallyPromise = null;\n }\n};\n\nPromiseSpawn.prototype._promiseCancelled = function() {\n if (this._isResolved()) return;\n var implementsReturn = typeof this._generator[\"return\"] !== \"undefined\";\n\n var result;\n if (!implementsReturn) {\n var reason = new Promise.CancellationError(\n \"generator .return() sentinel\");\n Promise.coroutine.returnSentinel = reason;\n this._promise._attachExtraTrace(reason);\n this._promise._pushContext();\n result = tryCatch(this._generator[\"throw\"]).call(this._generator,\n reason);\n this._promise._popContext();\n } else {\n this._promise._pushContext();\n result = tryCatch(this._generator[\"return\"]).call(this._generator,\n undefined);\n this._promise._popContext();\n }\n this._cancellationPhase = true;\n this._yieldedPromise = null;\n this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\n this._yieldedPromise = null;\n this._promise._pushContext();\n var result = tryCatch(this._generator.next).call(this._generator, value);\n this._promise._popContext();\n this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseRejected = function(reason) {\n this._yieldedPromise = null;\n this._promise._attachExtraTrace(reason);\n this._promise._pushContext();\n var result = tryCatch(this._generator[\"throw\"])\n .call(this._generator, reason);\n this._promise._popContext();\n this._continue(result);\n};\n\nPromiseSpawn.prototype._resultCancelled = function() {\n if (this._yieldedPromise instanceof Promise) {\n var promise = this._yieldedPromise;\n this._yieldedPromise = null;\n promise.cancel();\n }\n};\n\nPromiseSpawn.prototype.promise = function () {\n return this._promise;\n};\n\nPromiseSpawn.prototype._run = function () {\n this._generator = this._generatorFunction.call(this._receiver);\n this._receiver =\n this._generatorFunction = undefined;\n this._promiseFulfilled(undefined);\n};\n\nPromiseSpawn.prototype._continue = function (result) {\n var promise = this._promise;\n if (result === errorObj) {\n this._cleanup();\n if (this._cancellationPhase) {\n return promise.cancel();\n } else {\n return promise._rejectCallback(result.e, false);\n }\n }\n\n var value = result.value;\n if (result.done === true) {\n this._cleanup();\n if (this._cancellationPhase) {\n return promise.cancel();\n } else {\n return promise._resolveCallback(value);\n }\n } else {\n var maybePromise = tryConvertToPromise(value, this._promise);\n if (!(maybePromise instanceof Promise)) {\n maybePromise =\n promiseFromYieldHandler(maybePromise,\n this._yieldHandlers,\n this._promise);\n if (maybePromise === null) {\n this._promiseRejected(\n new TypeError(\n \"A value %s was yielded that could not be treated as a promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\\u000a\".replace(\"%s\", String(value)) +\n \"From coroutine:\\u000a\" +\n this._stack.split(\"\\n\").slice(1, -7).join(\"\\n\")\n )\n );\n return;\n }\n }\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n this._yieldedPromise = maybePromise;\n maybePromise._proxy(this, null);\n } else if (((bitField & 33554432) !== 0)) {\n Promise._async.invoke(\n this._promiseFulfilled, this, maybePromise._value()\n );\n } else if (((bitField & 16777216) !== 0)) {\n Promise._async.invoke(\n this._promiseRejected, this, maybePromise._reason()\n );\n } else {\n this._promiseCancelled();\n }\n }\n};\n\nPromise.coroutine = function (generatorFunction, options) {\n if (typeof generatorFunction !== \"function\") {\n throw new TypeError(\"generatorFunction must be a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var yieldHandler = Object(options).yieldHandler;\n var PromiseSpawn$ = PromiseSpawn;\n var stack = new Error().stack;\n return function () {\n var generator = generatorFunction.apply(this, arguments);\n var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\n stack);\n var ret = spawn.promise();\n spawn._generator = generator;\n spawn._promiseFulfilled(undefined);\n return ret;\n };\n};\n\nPromise.coroutine.addYieldHandler = function(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n yieldHandlers.push(fn);\n};\n\nPromise.spawn = function (generatorFunction) {\n debug.deprecated(\"Promise.spawn()\", \"Promise.coroutine()\");\n if (typeof generatorFunction !== \"function\") {\n return apiRejection(\"generatorFunction must be a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var spawn = new PromiseSpawn(generatorFunction, this);\n var ret = spawn.promise();\n spawn._run(Promise.spawn);\n return ret;\n};\n};\n\n},{\"./errors\":12,\"./util\":36}],17:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async,\n getDomain) {\nvar util = _dereq_(\"./util\");\nvar canEvaluate = util.canEvaluate;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar reject;\n\nif (!true) {\nif (canEvaluate) {\n var thenCallback = function(i) {\n return new Function(\"value\", \"holder\", \" \\n\\\n 'use strict'; \\n\\\n holder.pIndex = value; \\n\\\n holder.checkFulfillment(this); \\n\\\n \".replace(/Index/g, i));\n };\n\n var promiseSetter = function(i) {\n return new Function(\"promise\", \"holder\", \" \\n\\\n 'use strict'; \\n\\\n holder.pIndex = promise; \\n\\\n \".replace(/Index/g, i));\n };\n\n var generateHolderClass = function(total) {\n var props = new Array(total);\n for (var i = 0; i < props.length; ++i) {\n props[i] = \"this.p\" + (i+1);\n }\n var assignment = props.join(\" = \") + \" = null;\";\n var cancellationCode= \"var promise;\\n\" + props.map(function(prop) {\n return \" \\n\\\n promise = \" + prop + \"; \\n\\\n if (promise instanceof Promise) { \\n\\\n promise.cancel(); \\n\\\n } \\n\\\n \";\n }).join(\"\\n\");\n var passedArguments = props.join(\", \");\n var name = \"Holder$\" + total;\n\n\n var code = \"return function(tryCatch, errorObj, Promise, async) { \\n\\\n 'use strict'; \\n\\\n function [TheName](fn) { \\n\\\n [TheProperties] \\n\\\n this.fn = fn; \\n\\\n this.asyncNeeded = true; \\n\\\n this.now = 0; \\n\\\n } \\n\\\n \\n\\\n [TheName].prototype._callFunction = function(promise) { \\n\\\n promise._pushContext(); \\n\\\n var ret = tryCatch(this.fn)([ThePassedArguments]); \\n\\\n promise._popContext(); \\n\\\n if (ret === errorObj) { \\n\\\n promise._rejectCallback(ret.e, false); \\n\\\n } else { \\n\\\n promise._resolveCallback(ret); \\n\\\n } \\n\\\n }; \\n\\\n \\n\\\n [TheName].prototype.checkFulfillment = function(promise) { \\n\\\n var now = ++this.now; \\n\\\n if (now === [TheTotal]) { \\n\\\n if (this.asyncNeeded) { \\n\\\n async.invoke(this._callFunction, this, promise); \\n\\\n } else { \\n\\\n this._callFunction(promise); \\n\\\n } \\n\\\n \\n\\\n } \\n\\\n }; \\n\\\n \\n\\\n [TheName].prototype._resultCancelled = function() { \\n\\\n [CancellationCode] \\n\\\n }; \\n\\\n \\n\\\n return [TheName]; \\n\\\n }(tryCatch, errorObj, Promise, async); \\n\\\n \";\n\n code = code.replace(/\\[TheName\\]/g, name)\n .replace(/\\[TheTotal\\]/g, total)\n .replace(/\\[ThePassedArguments\\]/g, passedArguments)\n .replace(/\\[TheProperties\\]/g, assignment)\n .replace(/\\[CancellationCode\\]/g, cancellationCode);\n\n return new Function(\"tryCatch\", \"errorObj\", \"Promise\", \"async\", code)\n (tryCatch, errorObj, Promise, async);\n };\n\n var holderClasses = [];\n var thenCallbacks = [];\n var promiseSetters = [];\n\n for (var i = 0; i < 8; ++i) {\n holderClasses.push(generateHolderClass(i + 1));\n thenCallbacks.push(thenCallback(i + 1));\n promiseSetters.push(promiseSetter(i + 1));\n }\n\n reject = function (reason) {\n this._reject(reason);\n };\n}}\n\nPromise.join = function () {\n var last = arguments.length - 1;\n var fn;\n if (last > 0 && typeof arguments[last] === \"function\") {\n fn = arguments[last];\n if (!true) {\n if (last <= 8 && canEvaluate) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var HolderClass = holderClasses[last - 1];\n var holder = new HolderClass(fn);\n var callbacks = thenCallbacks;\n\n for (var i = 0; i < last; ++i) {\n var maybePromise = tryConvertToPromise(arguments[i], ret);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n maybePromise._then(callbacks[i], reject,\n undefined, ret, holder);\n promiseSetters[i](maybePromise, holder);\n holder.asyncNeeded = false;\n } else if (((bitField & 33554432) !== 0)) {\n callbacks[i].call(ret,\n maybePromise._value(), holder);\n } else if (((bitField & 16777216) !== 0)) {\n ret._reject(maybePromise._reason());\n } else {\n ret._cancel();\n }\n } else {\n callbacks[i].call(ret, maybePromise, holder);\n }\n }\n\n if (!ret._isFateSealed()) {\n if (holder.asyncNeeded) {\n var domain = getDomain();\n if (domain !== null) {\n holder.fn = util.domainBind(domain, holder.fn);\n }\n }\n ret._setAsyncGuaranteed();\n ret._setOnCancel(holder);\n }\n return ret;\n }\n }\n }\n var args = [].slice.call(arguments);;\n if (fn) args.pop();\n var ret = new PromiseArray(args).promise();\n return fn !== undefined ? ret.spread(fn) : ret;\n};\n\n};\n\n},{\"./util\":36}],18:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n PromiseArray,\n apiRejection,\n tryConvertToPromise,\n INTERNAL,\n debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\n this.constructor$(promises);\n this._promise._captureStackTrace();\n var domain = getDomain();\n this._callback = domain === null ? fn : util.domainBind(domain, fn);\n this._preservedValues = _filter === INTERNAL\n ? new Array(this.length())\n : null;\n this._limit = limit;\n this._inFlight = 0;\n this._queue = [];\n async.invoke(this._asyncInit, this, undefined);\n}\nutil.inherits(MappingPromiseArray, PromiseArray);\n\nMappingPromiseArray.prototype._asyncInit = function() {\n this._init$(undefined, -2);\n};\n\nMappingPromiseArray.prototype._init = function () {};\n\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\n var values = this._values;\n var length = this.length();\n var preservedValues = this._preservedValues;\n var limit = this._limit;\n\n if (index < 0) {\n index = (index * -1) - 1;\n values[index] = value;\n if (limit >= 1) {\n this._inFlight--;\n this._drainQueue();\n if (this._isResolved()) return true;\n }\n } else {\n if (limit >= 1 && this._inFlight >= limit) {\n values[index] = value;\n this._queue.push(index);\n return false;\n }\n if (preservedValues !== null) preservedValues[index] = value;\n\n var promise = this._promise;\n var callback = this._callback;\n var receiver = promise._boundValue();\n promise._pushContext();\n var ret = tryCatch(callback).call(receiver, value, index, length);\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret,\n promiseCreated,\n preservedValues !== null ? \"Promise.filter\" : \"Promise.map\",\n promise\n );\n if (ret === errorObj) {\n this._reject(ret.e);\n return true;\n }\n\n var maybePromise = tryConvertToPromise(ret, this._promise);\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n var bitField = maybePromise._bitField;\n ;\n if (((bitField & 50397184) === 0)) {\n if (limit >= 1) this._inFlight++;\n values[index] = maybePromise;\n maybePromise._proxy(this, (index + 1) * -1);\n return false;\n } else if (((bitField & 33554432) !== 0)) {\n ret = maybePromise._value();\n } else if (((bitField & 16777216) !== 0)) {\n this._reject(maybePromise._reason());\n return true;\n } else {\n this._cancel();\n return true;\n }\n }\n values[index] = ret;\n }\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= length) {\n if (preservedValues !== null) {\n this._filter(values, preservedValues);\n } else {\n this._resolve(values);\n }\n return true;\n }\n return false;\n};\n\nMappingPromiseArray.prototype._drainQueue = function () {\n var queue = this._queue;\n var limit = this._limit;\n var values = this._values;\n while (queue.length > 0 && this._inFlight < limit) {\n if (this._isResolved()) return;\n var index = queue.pop();\n this._promiseFulfilled(values[index], index);\n }\n};\n\nMappingPromiseArray.prototype._filter = function (booleans, values) {\n var len = values.length;\n var ret = new Array(len);\n var j = 0;\n for (var i = 0; i < len; ++i) {\n if (booleans[i]) ret[j++] = values[i];\n }\n ret.length = j;\n this._resolve(ret);\n};\n\nMappingPromiseArray.prototype.preservedValues = function () {\n return this._preservedValues;\n};\n\nfunction map(promises, fn, options, _filter) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n\n var limit = 0;\n if (options !== undefined) {\n if (typeof options === \"object\" && options !== null) {\n if (typeof options.concurrency !== \"number\") {\n return Promise.reject(\n new TypeError(\"'concurrency' must be a number but it is \" +\n util.classString(options.concurrency)));\n }\n limit = options.concurrency;\n } else {\n return Promise.reject(new TypeError(\n \"options argument must be an object but it is \" +\n util.classString(options)));\n }\n }\n limit = typeof limit === \"number\" &&\n isFinite(limit) && limit >= 1 ? limit : 0;\n return new MappingPromiseArray(promises, fn, limit, _filter).promise();\n}\n\nPromise.prototype.map = function (fn, options) {\n return map(this, fn, options, null);\n};\n\nPromise.map = function (promises, fn, options, _filter) {\n return map(promises, fn, options, _filter);\n};\n\n\n};\n\n},{\"./util\":36}],19:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\n\nPromise.method = function (fn) {\n if (typeof fn !== \"function\") {\n throw new Promise.TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return function () {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value = tryCatch(fn).apply(this, arguments);\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(\n value, promiseCreated, \"Promise.method\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n };\n};\n\nPromise.attempt = Promise[\"try\"] = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._pushContext();\n var value;\n if (arguments.length > 1) {\n debug.deprecated(\"calling Promise.try with more than 1 argument\");\n var arg = arguments[1];\n var ctx = arguments[2];\n value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\n : tryCatch(fn).call(ctx, arg);\n } else {\n value = tryCatch(fn)();\n }\n var promiseCreated = ret._popContext();\n debug.checkForgottenReturns(\n value, promiseCreated, \"Promise.try\", ret);\n ret._resolveFromSyncValue(value);\n return ret;\n};\n\nPromise.prototype._resolveFromSyncValue = function (value) {\n if (value === util.errorObj) {\n this._rejectCallback(value.e, false);\n } else {\n this._resolveCallback(value, true);\n }\n};\n};\n\n},{\"./util\":36}],20:[function(_dereq_,module,exports){\n\"use strict\";\nvar util = _dereq_(\"./util\");\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar errors = _dereq_(\"./errors\");\nvar OperationalError = errors.OperationalError;\nvar es5 = _dereq_(\"./es5\");\n\nfunction isUntypedError(obj) {\n return obj instanceof Error &&\n es5.getPrototypeOf(obj) === Error.prototype;\n}\n\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\nfunction wrapAsOperationalError(obj) {\n var ret;\n if (isUntypedError(obj)) {\n ret = new OperationalError(obj);\n ret.name = obj.name;\n ret.message = obj.message;\n ret.stack = obj.stack;\n var keys = es5.keys(obj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!rErrorKey.test(key)) {\n ret[key] = obj[key];\n }\n }\n return ret;\n }\n util.markAsOriginatingFromRejection(obj);\n return obj;\n}\n\nfunction nodebackForPromise(promise, multiArgs) {\n return function(err, value) {\n if (promise === null) return;\n if (err) {\n var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n promise._attachExtraTrace(wrapped);\n promise._reject(wrapped);\n } else if (!multiArgs) {\n promise._fulfill(value);\n } else {\n var args = [].slice.call(arguments, 1);;\n promise._fulfill(args);\n }\n promise = null;\n };\n}\n\nmodule.exports = nodebackForPromise;\n\n},{\"./errors\":12,\"./es5\":13,\"./util\":36}],21:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nvar util = _dereq_(\"./util\");\nvar async = Promise._async;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction spreadAdapter(val, nodeback) {\n var promise = this;\n if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\n var ret =\n tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\n\nfunction successAdapter(val, nodeback) {\n var promise = this;\n var receiver = promise._boundValue();\n var ret = val === undefined\n ? tryCatch(nodeback).call(receiver, null)\n : tryCatch(nodeback).call(receiver, null, val);\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\nfunction errorAdapter(reason, nodeback) {\n var promise = this;\n if (!reason) {\n var newReason = new Error(reason + \"\");\n newReason.cause = reason;\n reason = newReason;\n }\n var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\n if (ret === errorObj) {\n async.throwLater(ret.e);\n }\n}\n\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\n options) {\n if (typeof nodeback == \"function\") {\n var adapter = successAdapter;\n if (options !== undefined && Object(options).spread) {\n adapter = spreadAdapter;\n }\n this._then(\n adapter,\n errorAdapter,\n undefined,\n this,\n nodeback\n );\n }\n return this;\n};\n};\n\n},{\"./util\":36}],22:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function() {\nvar makeSelfResolutionError = function () {\n return new TypeError(\"circular promise resolution chain\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n};\nvar reflectHandler = function() {\n return new Promise.PromiseInspection(this._target());\n};\nvar apiRejection = function(msg) {\n return Promise.reject(new TypeError(msg));\n};\nfunction Proxyable() {}\nvar UNDEFINED_BINDING = {};\nvar util = _dereq_(\"./util\");\n\nvar getDomain;\nif (util.isNode) {\n getDomain = function() {\n var ret = process.domain;\n if (ret === undefined) ret = null;\n return ret;\n };\n} else {\n getDomain = function() {\n return null;\n };\n}\nutil.notEnumerableProp(Promise, \"_getDomain\", getDomain);\n\nvar es5 = _dereq_(\"./es5\");\nvar Async = _dereq_(\"./async\");\nvar async = new Async();\nes5.defineProperty(Promise, \"_async\", {value: async});\nvar errors = _dereq_(\"./errors\");\nvar TypeError = Promise.TypeError = errors.TypeError;\nPromise.RangeError = errors.RangeError;\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\nPromise.TimeoutError = errors.TimeoutError;\nPromise.OperationalError = errors.OperationalError;\nPromise.RejectionError = errors.OperationalError;\nPromise.AggregateError = errors.AggregateError;\nvar INTERNAL = function(){};\nvar APPLY = {};\nvar NEXT_FILTER = {};\nvar tryConvertToPromise = _dereq_(\"./thenables\")(Promise, INTERNAL);\nvar PromiseArray =\n _dereq_(\"./promise_array\")(Promise, INTERNAL,\n tryConvertToPromise, apiRejection, Proxyable);\nvar Context = _dereq_(\"./context\")(Promise);\n /*jshint unused:false*/\nvar createContext = Context.create;\nvar debug = _dereq_(\"./debuggability\")(Promise, Context);\nvar CapturedTrace = debug.CapturedTrace;\nvar PassThroughHandlerContext =\n _dereq_(\"./finally\")(Promise, tryConvertToPromise, NEXT_FILTER);\nvar catchFilter = _dereq_(\"./catch_filter\")(NEXT_FILTER);\nvar nodebackForPromise = _dereq_(\"./nodeback\");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nfunction check(self, executor) {\n if (self == null || self.constructor !== Promise) {\n throw new TypeError(\"the promise constructor cannot be invoked directly\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n if (typeof executor !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(executor));\n }\n\n}\n\nfunction Promise(executor) {\n if (executor !== INTERNAL) {\n check(this, executor);\n }\n this._bitField = 0;\n this._fulfillmentHandler0 = undefined;\n this._rejectionHandler0 = undefined;\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._resolveFromExecutor(executor);\n this._promiseCreated();\n this._fireEvent(\"promiseCreated\", this);\n}\n\nPromise.prototype.toString = function () {\n return \"[object Promise]\";\n};\n\nPromise.prototype.caught = Promise.prototype[\"catch\"] = function (fn) {\n var len = arguments.length;\n if (len > 1) {\n var catchInstances = new Array(len - 1),\n j = 0, i;\n for (i = 0; i < len - 1; ++i) {\n var item = arguments[i];\n if (util.isObject(item)) {\n catchInstances[j++] = item;\n } else {\n return apiRejection(\"Catch statement predicate: \" +\n \"expecting an object but got \" + util.classString(item));\n }\n }\n catchInstances.length = j;\n fn = arguments[i];\n return this.then(undefined, catchFilter(catchInstances, fn, this));\n }\n return this.then(undefined, fn);\n};\n\nPromise.prototype.reflect = function () {\n return this._then(reflectHandler,\n reflectHandler, undefined, this, undefined);\n};\n\nPromise.prototype.then = function (didFulfill, didReject) {\n if (debug.warnings() && arguments.length > 0 &&\n typeof didFulfill !== \"function\" &&\n typeof didReject !== \"function\") {\n var msg = \".then() only accepts functions but was passed: \" +\n util.classString(didFulfill);\n if (arguments.length > 1) {\n msg += \", \" + util.classString(didReject);\n }\n this._warn(msg);\n }\n return this._then(didFulfill, didReject, undefined, undefined, undefined);\n};\n\nPromise.prototype.done = function (didFulfill, didReject) {\n var promise =\n this._then(didFulfill, didReject, undefined, undefined, undefined);\n promise._setIsFinal();\n};\n\nPromise.prototype.spread = function (fn) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n return this.all()._then(fn, undefined, undefined, APPLY, undefined);\n};\n\nPromise.prototype.toJSON = function () {\n var ret = {\n isFulfilled: false,\n isRejected: false,\n fulfillmentValue: undefined,\n rejectionReason: undefined\n };\n if (this.isFulfilled()) {\n ret.fulfillmentValue = this.value();\n ret.isFulfilled = true;\n } else if (this.isRejected()) {\n ret.rejectionReason = this.reason();\n ret.isRejected = true;\n }\n return ret;\n};\n\nPromise.prototype.all = function () {\n if (arguments.length > 0) {\n this._warn(\".all() was passed arguments but it does not take any\");\n }\n return new PromiseArray(this).promise();\n};\n\nPromise.prototype.error = function (fn) {\n return this.caught(util.originatesFromRejection, fn);\n};\n\nPromise.getNewLibraryCopy = module.exports;\n\nPromise.is = function (val) {\n return val instanceof Promise;\n};\n\nPromise.fromNode = Promise.fromCallback = function(fn) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\n : false;\n var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\n if (result === errorObj) {\n ret._rejectCallback(result.e, true);\n }\n if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\n return ret;\n};\n\nPromise.all = function (promises) {\n return new PromiseArray(promises).promise();\n};\n\nPromise.cast = function (obj) {\n var ret = tryConvertToPromise(obj);\n if (!(ret instanceof Promise)) {\n ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._setFulfilled();\n ret._rejectionHandler0 = obj;\n }\n return ret;\n};\n\nPromise.resolve = Promise.fulfilled = Promise.cast;\n\nPromise.reject = Promise.rejected = function (reason) {\n var ret = new Promise(INTERNAL);\n ret._captureStackTrace();\n ret._rejectCallback(reason, true);\n return ret;\n};\n\nPromise.setScheduler = function(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n return async.setScheduler(fn);\n};\n\nPromise.prototype._then = function (\n didFulfill,\n didReject,\n _, receiver,\n internalData\n) {\n var haveInternalData = internalData !== undefined;\n var promise = haveInternalData ? internalData : new Promise(INTERNAL);\n var target = this._target();\n var bitField = target._bitField;\n\n if (!haveInternalData) {\n promise._propagateFrom(this, 3);\n promise._captureStackTrace();\n if (receiver === undefined &&\n ((this._bitField & 2097152) !== 0)) {\n if (!((bitField & 50397184) === 0)) {\n receiver = this._boundValue();\n } else {\n receiver = target === this ? undefined : this._boundTo;\n }\n }\n this._fireEvent(\"promiseChained\", this, promise);\n }\n\n var domain = getDomain();\n if (!((bitField & 50397184) === 0)) {\n var handler, value, settler = target._settlePromiseCtx;\n if (((bitField & 33554432) !== 0)) {\n value = target._rejectionHandler0;\n handler = didFulfill;\n } else if (((bitField & 16777216) !== 0)) {\n value = target._fulfillmentHandler0;\n handler = didReject;\n target._unsetRejectionIsUnhandled();\n } else {\n settler = target._settlePromiseLateCancellationObserver;\n value = new CancellationError(\"late cancellation observer\");\n target._attachExtraTrace(value);\n handler = didReject;\n }\n\n async.invoke(settler, target, {\n handler: domain === null ? handler\n : (typeof handler === \"function\" &&\n util.domainBind(domain, handler)),\n promise: promise,\n receiver: receiver,\n value: value\n });\n } else {\n target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\n }\n\n return promise;\n};\n\nPromise.prototype._length = function () {\n return this._bitField & 65535;\n};\n\nPromise.prototype._isFateSealed = function () {\n return (this._bitField & 117506048) !== 0;\n};\n\nPromise.prototype._isFollowing = function () {\n return (this._bitField & 67108864) === 67108864;\n};\n\nPromise.prototype._setLength = function (len) {\n this._bitField = (this._bitField & -65536) |\n (len & 65535);\n};\n\nPromise.prototype._setFulfilled = function () {\n this._bitField = this._bitField | 33554432;\n this._fireEvent(\"promiseFulfilled\", this);\n};\n\nPromise.prototype._setRejected = function () {\n this._bitField = this._bitField | 16777216;\n this._fireEvent(\"promiseRejected\", this);\n};\n\nPromise.prototype._setFollowing = function () {\n this._bitField = this._bitField | 67108864;\n this._fireEvent(\"promiseResolved\", this);\n};\n\nPromise.prototype._setIsFinal = function () {\n this._bitField = this._bitField | 4194304;\n};\n\nPromise.prototype._isFinal = function () {\n return (this._bitField & 4194304) > 0;\n};\n\nPromise.prototype._unsetCancelled = function() {\n this._bitField = this._bitField & (~65536);\n};\n\nPromise.prototype._setCancelled = function() {\n this._bitField = this._bitField | 65536;\n this._fireEvent(\"promiseCancelled\", this);\n};\n\nPromise.prototype._setWillBeCancelled = function() {\n this._bitField = this._bitField | 8388608;\n};\n\nPromise.prototype._setAsyncGuaranteed = function() {\n if (async.hasCustomScheduler()) return;\n this._bitField = this._bitField | 134217728;\n};\n\nPromise.prototype._receiverAt = function (index) {\n var ret = index === 0 ? this._receiver0 : this[\n index * 4 - 4 + 3];\n if (ret === UNDEFINED_BINDING) {\n return undefined;\n } else if (ret === undefined && this._isBound()) {\n return this._boundValue();\n }\n return ret;\n};\n\nPromise.prototype._promiseAt = function (index) {\n return this[\n index * 4 - 4 + 2];\n};\n\nPromise.prototype._fulfillmentHandlerAt = function (index) {\n return this[\n index * 4 - 4 + 0];\n};\n\nPromise.prototype._rejectionHandlerAt = function (index) {\n return this[\n index * 4 - 4 + 1];\n};\n\nPromise.prototype._boundValue = function() {};\n\nPromise.prototype._migrateCallback0 = function (follower) {\n var bitField = follower._bitField;\n var fulfill = follower._fulfillmentHandler0;\n var reject = follower._rejectionHandler0;\n var promise = follower._promise0;\n var receiver = follower._receiverAt(0);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._migrateCallbackAt = function (follower, index) {\n var fulfill = follower._fulfillmentHandlerAt(index);\n var reject = follower._rejectionHandlerAt(index);\n var promise = follower._promiseAt(index);\n var receiver = follower._receiverAt(index);\n if (receiver === undefined) receiver = UNDEFINED_BINDING;\n this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._addCallbacks = function (\n fulfill,\n reject,\n promise,\n receiver,\n domain\n) {\n var index = this._length();\n\n if (index >= 65535 - 4) {\n index = 0;\n this._setLength(0);\n }\n\n if (index === 0) {\n this._promise0 = promise;\n this._receiver0 = receiver;\n if (typeof fulfill === \"function\") {\n this._fulfillmentHandler0 =\n domain === null ? fulfill : util.domainBind(domain, fulfill);\n }\n if (typeof reject === \"function\") {\n this._rejectionHandler0 =\n domain === null ? reject : util.domainBind(domain, reject);\n }\n } else {\n var base = index * 4 - 4;\n this[base + 2] = promise;\n this[base + 3] = receiver;\n if (typeof fulfill === \"function\") {\n this[base + 0] =\n domain === null ? fulfill : util.domainBind(domain, fulfill);\n }\n if (typeof reject === \"function\") {\n this[base + 1] =\n domain === null ? reject : util.domainBind(domain, reject);\n }\n }\n this._setLength(index + 1);\n return index;\n};\n\nPromise.prototype._proxy = function (proxyable, arg) {\n this._addCallbacks(undefined, undefined, arg, proxyable, null);\n};\n\nPromise.prototype._resolveCallback = function(value, shouldBind) {\n if (((this._bitField & 117506048) !== 0)) return;\n if (value === this)\n return this._rejectCallback(makeSelfResolutionError(), false);\n var maybePromise = tryConvertToPromise(value, this);\n if (!(maybePromise instanceof Promise)) return this._fulfill(value);\n\n if (shouldBind) this._propagateFrom(maybePromise, 2);\n\n var promise = maybePromise._target();\n\n if (promise === this) {\n this._reject(makeSelfResolutionError());\n return;\n }\n\n var bitField = promise._bitField;\n if (((bitField & 50397184) === 0)) {\n var len = this._length();\n if (len > 0) promise._migrateCallback0(this);\n for (var i = 1; i < len; ++i) {\n promise._migrateCallbackAt(this, i);\n }\n this._setFollowing();\n this._setLength(0);\n this._setFollowee(promise);\n } else if (((bitField & 33554432) !== 0)) {\n this._fulfill(promise._value());\n } else if (((bitField & 16777216) !== 0)) {\n this._reject(promise._reason());\n } else {\n var reason = new CancellationError(\"late cancellation observer\");\n promise._attachExtraTrace(reason);\n this._reject(reason);\n }\n};\n\nPromise.prototype._rejectCallback =\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\n var trace = util.ensureErrorObject(reason);\n var hasStack = trace === reason;\n if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\n var message = \"a promise was rejected with a non-error: \" +\n util.classString(reason);\n this._warn(message, true);\n }\n this._attachExtraTrace(trace, synchronous ? hasStack : false);\n this._reject(reason);\n};\n\nPromise.prototype._resolveFromExecutor = function (executor) {\n if (executor === INTERNAL) return;\n var promise = this;\n this._captureStackTrace();\n this._pushContext();\n var synchronous = true;\n var r = this._execute(executor, function(value) {\n promise._resolveCallback(value);\n }, function (reason) {\n promise._rejectCallback(reason, synchronous);\n });\n synchronous = false;\n this._popContext();\n\n if (r !== undefined) {\n promise._rejectCallback(r, true);\n }\n};\n\nPromise.prototype._settlePromiseFromHandler = function (\n handler, receiver, value, promise\n) {\n var bitField = promise._bitField;\n if (((bitField & 65536) !== 0)) return;\n promise._pushContext();\n var x;\n if (receiver === APPLY) {\n if (!value || typeof value.length !== \"number\") {\n x = errorObj;\n x.e = new TypeError(\"cannot .spread() a non-array: \" +\n util.classString(value));\n } else {\n x = tryCatch(handler).apply(this._boundValue(), value);\n }\n } else {\n x = tryCatch(handler).call(receiver, value);\n }\n var promiseCreated = promise._popContext();\n bitField = promise._bitField;\n if (((bitField & 65536) !== 0)) return;\n\n if (x === NEXT_FILTER) {\n promise._reject(value);\n } else if (x === errorObj) {\n promise._rejectCallback(x.e, false);\n } else {\n debug.checkForgottenReturns(x, promiseCreated, \"\", promise, this);\n promise._resolveCallback(x);\n }\n};\n\nPromise.prototype._target = function() {\n var ret = this;\n while (ret._isFollowing()) ret = ret._followee();\n return ret;\n};\n\nPromise.prototype._followee = function() {\n return this._rejectionHandler0;\n};\n\nPromise.prototype._setFollowee = function(promise) {\n this._rejectionHandler0 = promise;\n};\n\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\n var isPromise = promise instanceof Promise;\n var bitField = this._bitField;\n var asyncGuaranteed = ((bitField & 134217728) !== 0);\n if (((bitField & 65536) !== 0)) {\n if (isPromise) promise._invokeInternalOnCancel();\n\n if (receiver instanceof PassThroughHandlerContext &&\n receiver.isFinallyHandler()) {\n receiver.cancelPromise = promise;\n if (tryCatch(handler).call(receiver, value) === errorObj) {\n promise._reject(errorObj.e);\n }\n } else if (handler === reflectHandler) {\n promise._fulfill(reflectHandler.call(receiver));\n } else if (receiver instanceof Proxyable) {\n receiver._promiseCancelled(promise);\n } else if (isPromise || promise instanceof PromiseArray) {\n promise._cancel();\n } else {\n receiver.cancel();\n }\n } else if (typeof handler === \"function\") {\n if (!isPromise) {\n handler.call(receiver, value, promise);\n } else {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (receiver instanceof Proxyable) {\n if (!receiver._isResolved()) {\n if (((bitField & 33554432) !== 0)) {\n receiver._promiseFulfilled(value, promise);\n } else {\n receiver._promiseRejected(value, promise);\n }\n }\n } else if (isPromise) {\n if (asyncGuaranteed) promise._setAsyncGuaranteed();\n if (((bitField & 33554432) !== 0)) {\n promise._fulfill(value);\n } else {\n promise._reject(value);\n }\n }\n};\n\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\n var handler = ctx.handler;\n var promise = ctx.promise;\n var receiver = ctx.receiver;\n var value = ctx.value;\n if (typeof handler === \"function\") {\n if (!(promise instanceof Promise)) {\n handler.call(receiver, value, promise);\n } else {\n this._settlePromiseFromHandler(handler, receiver, value, promise);\n }\n } else if (promise instanceof Promise) {\n promise._reject(value);\n }\n};\n\nPromise.prototype._settlePromiseCtx = function(ctx) {\n this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\n};\n\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\n var promise = this._promise0;\n var receiver = this._receiverAt(0);\n this._promise0 = undefined;\n this._receiver0 = undefined;\n this._settlePromise(promise, handler, receiver, value);\n};\n\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\n var base = index * 4 - 4;\n this[base + 2] =\n this[base + 3] =\n this[base + 0] =\n this[base + 1] = undefined;\n};\n\nPromise.prototype._fulfill = function (value) {\n var bitField = this._bitField;\n if (((bitField & 117506048) >>> 16)) return;\n if (value === this) {\n var err = makeSelfResolutionError();\n this._attachExtraTrace(err);\n return this._reject(err);\n }\n this._setFulfilled();\n this._rejectionHandler0 = value;\n\n if ((bitField & 65535) > 0) {\n if (((bitField & 134217728) !== 0)) {\n this._settlePromises();\n } else {\n async.settlePromises(this);\n }\n }\n};\n\nPromise.prototype._reject = function (reason) {\n var bitField = this._bitField;\n if (((bitField & 117506048) >>> 16)) return;\n this._setRejected();\n this._fulfillmentHandler0 = reason;\n\n if (this._isFinal()) {\n return async.fatalError(reason, util.isNode);\n }\n\n if ((bitField & 65535) > 0) {\n async.settlePromises(this);\n } else {\n this._ensurePossibleRejectionHandled();\n }\n};\n\nPromise.prototype._fulfillPromises = function (len, value) {\n for (var i = 1; i < len; i++) {\n var handler = this._fulfillmentHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, value);\n }\n};\n\nPromise.prototype._rejectPromises = function (len, reason) {\n for (var i = 1; i < len; i++) {\n var handler = this._rejectionHandlerAt(i);\n var promise = this._promiseAt(i);\n var receiver = this._receiverAt(i);\n this._clearCallbackDataAtIndex(i);\n this._settlePromise(promise, handler, receiver, reason);\n }\n};\n\nPromise.prototype._settlePromises = function () {\n var bitField = this._bitField;\n var len = (bitField & 65535);\n\n if (len > 0) {\n if (((bitField & 16842752) !== 0)) {\n var reason = this._fulfillmentHandler0;\n this._settlePromise0(this._rejectionHandler0, reason, bitField);\n this._rejectPromises(len, reason);\n } else {\n var value = this._rejectionHandler0;\n this._settlePromise0(this._fulfillmentHandler0, value, bitField);\n this._fulfillPromises(len, value);\n }\n this._setLength(0);\n }\n this._clearCancellationData();\n};\n\nPromise.prototype._settledValue = function() {\n var bitField = this._bitField;\n if (((bitField & 33554432) !== 0)) {\n return this._rejectionHandler0;\n } else if (((bitField & 16777216) !== 0)) {\n return this._fulfillmentHandler0;\n }\n};\n\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\n\nPromise.defer = Promise.pending = function() {\n debug.deprecated(\"Promise.defer\", \"new Promise\");\n var promise = new Promise(INTERNAL);\n return {\n promise: promise,\n resolve: deferResolve,\n reject: deferReject\n };\n};\n\nutil.notEnumerableProp(Promise,\n \"_makeSelfResolutionError\",\n makeSelfResolutionError);\n\n_dereq_(\"./method\")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\n debug);\n_dereq_(\"./bind\")(Promise, INTERNAL, tryConvertToPromise, debug);\n_dereq_(\"./cancel\")(Promise, PromiseArray, apiRejection, debug);\n_dereq_(\"./direct_resolve\")(Promise);\n_dereq_(\"./synchronous_inspection\")(Promise);\n_dereq_(\"./join\")(\n Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain);\nPromise.Promise = Promise;\nPromise.version = \"3.5.0\";\n_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_('./call_get.js')(Promise);\n_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\n_dereq_('./timers.js')(Promise, INTERNAL, debug);\n_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\n_dereq_('./nodeify.js')(Promise);\n_dereq_('./promisify.js')(Promise, INTERNAL);\n_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\n_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\n_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_('./settle.js')(Promise, PromiseArray, debug);\n_dereq_('./some.js')(Promise, PromiseArray, apiRejection);\n_dereq_('./filter.js')(Promise, INTERNAL);\n_dereq_('./each.js')(Promise, INTERNAL);\n_dereq_('./any.js')(Promise);\n \n util.toFastProperties(Promise); \n util.toFastProperties(Promise.prototype); \n function fillTypes(value) { \n var p = new Promise(INTERNAL); \n p._fulfillmentHandler0 = value; \n p._rejectionHandler0 = value; \n p._promise0 = value; \n p._receiver0 = value; \n } \n // Complete slack tracking, opt out of field-type tracking and \n // stabilize map \n fillTypes({a: 1}); \n fillTypes({b: 2}); \n fillTypes({c: 3}); \n fillTypes(1); \n fillTypes(function(){}); \n fillTypes(undefined); \n fillTypes(false); \n fillTypes(new Promise(INTERNAL)); \n debug.setBounds(Async.firstLineError, util.lastLineError); \n return Promise; \n\n};\n\n},{\"./any.js\":1,\"./async\":2,\"./bind\":3,\"./call_get.js\":5,\"./cancel\":6,\"./catch_filter\":7,\"./context\":8,\"./debuggability\":9,\"./direct_resolve\":10,\"./each.js\":11,\"./errors\":12,\"./es5\":13,\"./filter.js\":14,\"./finally\":15,\"./generators.js\":16,\"./join\":17,\"./map.js\":18,\"./method\":19,\"./nodeback\":20,\"./nodeify.js\":21,\"./promise_array\":23,\"./promisify.js\":24,\"./props.js\":25,\"./race.js\":27,\"./reduce.js\":28,\"./settle.js\":30,\"./some.js\":31,\"./synchronous_inspection\":32,\"./thenables\":33,\"./timers.js\":34,\"./using.js\":35,\"./util\":36}],23:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\n apiRejection, Proxyable) {\nvar util = _dereq_(\"./util\");\nvar isArray = util.isArray;\n\nfunction toResolutionValue(val) {\n switch(val) {\n case -2: return [];\n case -3: return {};\n case -6: return new Map();\n }\n}\n\nfunction PromiseArray(values) {\n var promise = this._promise = new Promise(INTERNAL);\n if (values instanceof Promise) {\n promise._propagateFrom(values, 3);\n }\n promise._setOnCancel(this);\n this._values = values;\n this._length = 0;\n this._totalResolved = 0;\n this._init(undefined, -2);\n}\nutil.inherits(PromiseArray, Proxyable);\n\nPromiseArray.prototype.length = function () {\n return this._length;\n};\n\nPromiseArray.prototype.promise = function () {\n return this._promise;\n};\n\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\n var values = tryConvertToPromise(this._values, this._promise);\n if (values instanceof Promise) {\n values = values._target();\n var bitField = values._bitField;\n ;\n this._values = values;\n\n if (((bitField & 50397184) === 0)) {\n this._promise._setAsyncGuaranteed();\n return values._then(\n init,\n this._reject,\n undefined,\n this,\n resolveValueIfEmpty\n );\n } else if (((bitField & 33554432) !== 0)) {\n values = values._value();\n } else if (((bitField & 16777216) !== 0)) {\n return this._reject(values._reason());\n } else {\n return this._cancel();\n }\n }\n values = util.asArray(values);\n if (values === null) {\n var err = apiRejection(\n \"expecting an array or an iterable object but got \" + util.classString(values)).reason();\n this._promise._rejectCallback(err, false);\n return;\n }\n\n if (values.length === 0) {\n if (resolveValueIfEmpty === -5) {\n this._resolveEmptyArray();\n }\n else {\n this._resolve(toResolutionValue(resolveValueIfEmpty));\n }\n return;\n }\n this._iterate(values);\n};\n\nPromiseArray.prototype._iterate = function(values) {\n var len = this.getActualLength(values.length);\n this._length = len;\n this._values = this.shouldCopyValues() ? new Array(len) : this._values;\n var result = this._promise;\n var isResolved = false;\n var bitField = null;\n for (var i = 0; i < len; ++i) {\n var maybePromise = tryConvertToPromise(values[i], result);\n\n if (maybePromise instanceof Promise) {\n maybePromise = maybePromise._target();\n bitField = maybePromise._bitField;\n } else {\n bitField = null;\n }\n\n if (isResolved) {\n if (bitField !== null) {\n maybePromise.suppressUnhandledRejections();\n }\n } else if (bitField !== null) {\n if (((bitField & 50397184) === 0)) {\n maybePromise._proxy(this, i);\n this._values[i] = maybePromise;\n } else if (((bitField & 33554432) !== 0)) {\n isResolved = this._promiseFulfilled(maybePromise._value(), i);\n } else if (((bitField & 16777216) !== 0)) {\n isResolved = this._promiseRejected(maybePromise._reason(), i);\n } else {\n isResolved = this._promiseCancelled(i);\n }\n } else {\n isResolved = this._promiseFulfilled(maybePromise, i);\n }\n }\n if (!isResolved) result._setAsyncGuaranteed();\n};\n\nPromiseArray.prototype._isResolved = function () {\n return this._values === null;\n};\n\nPromiseArray.prototype._resolve = function (value) {\n this._values = null;\n this._promise._fulfill(value);\n};\n\nPromiseArray.prototype._cancel = function() {\n if (this._isResolved() || !this._promise._isCancellable()) return;\n this._values = null;\n this._promise._cancel();\n};\n\nPromiseArray.prototype._reject = function (reason) {\n this._values = null;\n this._promise._rejectCallback(reason, false);\n};\n\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n};\n\nPromiseArray.prototype._promiseCancelled = function() {\n this._cancel();\n return true;\n};\n\nPromiseArray.prototype._promiseRejected = function (reason) {\n this._totalResolved++;\n this._reject(reason);\n return true;\n};\n\nPromiseArray.prototype._resultCancelled = function() {\n if (this._isResolved()) return;\n var values = this._values;\n this._cancel();\n if (values instanceof Promise) {\n values.cancel();\n } else {\n for (var i = 0; i < values.length; ++i) {\n if (values[i] instanceof Promise) {\n values[i].cancel();\n }\n }\n }\n};\n\nPromiseArray.prototype.shouldCopyValues = function () {\n return true;\n};\n\nPromiseArray.prototype.getActualLength = function (len) {\n return len;\n};\n\nreturn PromiseArray;\n};\n\n},{\"./util\":36}],24:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar THIS = {};\nvar util = _dereq_(\"./util\");\nvar nodebackForPromise = _dereq_(\"./nodeback\");\nvar withAppended = util.withAppended;\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar canEvaluate = util.canEvaluate;\nvar TypeError = _dereq_(\"./errors\").TypeError;\nvar defaultSuffix = \"Async\";\nvar defaultPromisified = {__isPromisified__: true};\nvar noCopyProps = [\n \"arity\", \"length\",\n \"name\",\n \"arguments\",\n \"caller\",\n \"callee\",\n \"prototype\",\n \"__isPromisified__\"\n];\nvar noCopyPropsPattern = new RegExp(\"^(?:\" + noCopyProps.join(\"|\") + \")$\");\n\nvar defaultFilter = function(name) {\n return util.isIdentifier(name) &&\n name.charAt(0) !== \"_\" &&\n name !== \"constructor\";\n};\n\nfunction propsFilter(key) {\n return !noCopyPropsPattern.test(key);\n}\n\nfunction isPromisified(fn) {\n try {\n return fn.__isPromisified__ === true;\n }\n catch (e) {\n return false;\n }\n}\n\nfunction hasPromisified(obj, key, suffix) {\n var val = util.getDataPropertyOrDefault(obj, key + suffix,\n defaultPromisified);\n return val ? isPromisified(val) : false;\n}\nfunction checkValid(ret, suffix, suffixRegexp) {\n for (var i = 0; i < ret.length; i += 2) {\n var key = ret[i];\n if (suffixRegexp.test(key)) {\n var keyWithoutAsyncSuffix = key.replace(suffixRegexp, \"\");\n for (var j = 0; j < ret.length; j += 2) {\n if (ret[j] === keyWithoutAsyncSuffix) {\n throw new TypeError(\"Cannot promisify an API that has normal methods with '%s'-suffix\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\"\n .replace(\"%s\", suffix));\n }\n }\n }\n }\n}\n\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\n var keys = util.inheritedDataKeys(obj);\n var ret = [];\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var value = obj[key];\n var passesDefaultFilter = filter === defaultFilter\n ? true : defaultFilter(key, value, obj);\n if (typeof value === \"function\" &&\n !isPromisified(value) &&\n !hasPromisified(obj, key, suffix) &&\n filter(key, value, obj, passesDefaultFilter)) {\n ret.push(key, value);\n }\n }\n checkValid(ret, suffix, suffixRegexp);\n return ret;\n}\n\nvar escapeIdentRegex = function(str) {\n return str.replace(/([$])/, \"\\\\$\");\n};\n\nvar makeNodePromisifiedEval;\nif (!true) {\nvar switchCaseArgumentOrder = function(likelyArgumentCount) {\n var ret = [likelyArgumentCount];\n var min = Math.max(0, likelyArgumentCount - 1 - 3);\n for(var i = likelyArgumentCount - 1; i >= min; --i) {\n ret.push(i);\n }\n for(var i = likelyArgumentCount + 1; i <= 3; ++i) {\n ret.push(i);\n }\n return ret;\n};\n\nvar argumentSequence = function(argumentCount) {\n return util.filledRange(argumentCount, \"_arg\", \"\");\n};\n\nvar parameterDeclaration = function(parameterCount) {\n return util.filledRange(\n Math.max(parameterCount, 3), \"_arg\", \"\");\n};\n\nvar parameterCount = function(fn) {\n if (typeof fn.length === \"number\") {\n return Math.max(Math.min(fn.length, 1023 + 1), 0);\n }\n return 0;\n};\n\nmakeNodePromisifiedEval =\nfunction(callback, receiver, originalName, fn, _, multiArgs) {\n var newParameterCount = Math.max(0, parameterCount(fn) - 1);\n var argumentOrder = switchCaseArgumentOrder(newParameterCount);\n var shouldProxyThis = typeof callback === \"string\" || receiver === THIS;\n\n function generateCallForArgumentCount(count) {\n var args = argumentSequence(count).join(\", \");\n var comma = count > 0 ? \", \" : \"\";\n var ret;\n if (shouldProxyThis) {\n ret = \"ret = callback.call(this, {{args}}, nodeback); break;\\n\";\n } else {\n ret = receiver === undefined\n ? \"ret = callback({{args}}, nodeback); break;\\n\"\n : \"ret = callback.call(receiver, {{args}}, nodeback); break;\\n\";\n }\n return ret.replace(\"{{args}}\", args).replace(\", \", comma);\n }\n\n function generateArgumentSwitchCase() {\n var ret = \"\";\n for (var i = 0; i < argumentOrder.length; ++i) {\n ret += \"case \" + argumentOrder[i] +\":\" +\n generateCallForArgumentCount(argumentOrder[i]);\n }\n\n ret += \" \\n\\\n default: \\n\\\n var args = new Array(len + 1); \\n\\\n var i = 0; \\n\\\n for (var i = 0; i < len; ++i) { \\n\\\n args[i] = arguments[i]; \\n\\\n } \\n\\\n args[i] = nodeback; \\n\\\n [CodeForCall] \\n\\\n break; \\n\\\n \".replace(\"[CodeForCall]\", (shouldProxyThis\n ? \"ret = callback.apply(this, args);\\n\"\n : \"ret = callback.apply(receiver, args);\\n\"));\n return ret;\n }\n\n var getFunctionCode = typeof callback === \"string\"\n ? (\"this != null ? this['\"+callback+\"'] : fn\")\n : \"fn\";\n var body = \"'use strict'; \\n\\\n var ret = function (Parameters) { \\n\\\n 'use strict'; \\n\\\n var len = arguments.length; \\n\\\n var promise = new Promise(INTERNAL); \\n\\\n promise._captureStackTrace(); \\n\\\n var nodeback = nodebackForPromise(promise, \" + multiArgs + \"); \\n\\\n var ret; \\n\\\n var callback = tryCatch([GetFunctionCode]); \\n\\\n switch(len) { \\n\\\n [CodeForSwitchCase] \\n\\\n } \\n\\\n if (ret === errorObj) { \\n\\\n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\\n\\\n } \\n\\\n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \\n\\\n return promise; \\n\\\n }; \\n\\\n notEnumerableProp(ret, '__isPromisified__', true); \\n\\\n return ret; \\n\\\n \".replace(\"[CodeForSwitchCase]\", generateArgumentSwitchCase())\n .replace(\"[GetFunctionCode]\", getFunctionCode);\n body = body.replace(\"Parameters\", parameterDeclaration(newParameterCount));\n return new Function(\"Promise\",\n \"fn\",\n \"receiver\",\n \"withAppended\",\n \"maybeWrapAsError\",\n \"nodebackForPromise\",\n \"tryCatch\",\n \"errorObj\",\n \"notEnumerableProp\",\n \"INTERNAL\",\n body)(\n Promise,\n fn,\n receiver,\n withAppended,\n maybeWrapAsError,\n nodebackForPromise,\n util.tryCatch,\n util.errorObj,\n util.notEnumerableProp,\n INTERNAL);\n};\n}\n\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\n var defaultThis = (function() {return this;})();\n var method = callback;\n if (typeof method === \"string\") {\n callback = fn;\n }\n function promisified() {\n var _receiver = receiver;\n if (receiver === THIS) _receiver = this;\n var promise = new Promise(INTERNAL);\n promise._captureStackTrace();\n var cb = typeof method === \"string\" && this !== defaultThis\n ? this[method] : callback;\n var fn = nodebackForPromise(promise, multiArgs);\n try {\n cb.apply(_receiver, withAppended(arguments, fn));\n } catch(e) {\n promise._rejectCallback(maybeWrapAsError(e), true, true);\n }\n if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\n return promise;\n }\n util.notEnumerableProp(promisified, \"__isPromisified__\", true);\n return promisified;\n}\n\nvar makeNodePromisified = canEvaluate\n ? makeNodePromisifiedEval\n : makeNodePromisifiedClosure;\n\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\n var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + \"$\");\n var methods =\n promisifiableMethods(obj, suffix, suffixRegexp, filter);\n\n for (var i = 0, len = methods.length; i < len; i+= 2) {\n var key = methods[i];\n var fn = methods[i+1];\n var promisifiedKey = key + suffix;\n if (promisifier === makeNodePromisified) {\n obj[promisifiedKey] =\n makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\n } else {\n var promisified = promisifier(fn, function() {\n return makeNodePromisified(key, THIS, key,\n fn, suffix, multiArgs);\n });\n util.notEnumerableProp(promisified, \"__isPromisified__\", true);\n obj[promisifiedKey] = promisified;\n }\n }\n util.toFastProperties(obj);\n return obj;\n}\n\nfunction promisify(callback, receiver, multiArgs) {\n return makeNodePromisified(callback, receiver, undefined,\n callback, null, multiArgs);\n}\n\nPromise.promisify = function (fn, options) {\n if (typeof fn !== \"function\") {\n throw new TypeError(\"expecting a function but got \" + util.classString(fn));\n }\n if (isPromisified(fn)) {\n return fn;\n }\n options = Object(options);\n var receiver = options.context === undefined ? THIS : options.context;\n var multiArgs = !!options.multiArgs;\n var ret = promisify(fn, receiver, multiArgs);\n util.copyDescriptors(fn, ret, propsFilter);\n return ret;\n};\n\nPromise.promisifyAll = function (target, options) {\n if (typeof target !== \"function\" && typeof target !== \"object\") {\n throw new TypeError(\"the target of promisifyAll must be an object or a function\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n options = Object(options);\n var multiArgs = !!options.multiArgs;\n var suffix = options.suffix;\n if (typeof suffix !== \"string\") suffix = defaultSuffix;\n var filter = options.filter;\n if (typeof filter !== \"function\") filter = defaultFilter;\n var promisifier = options.promisifier;\n if (typeof promisifier !== \"function\") promisifier = makeNodePromisified;\n\n if (!util.isIdentifier(suffix)) {\n throw new RangeError(\"suffix must be a valid identifier\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n\n var keys = util.inheritedDataKeys(target);\n for (var i = 0; i < keys.length; ++i) {\n var value = target[keys[i]];\n if (keys[i] !== \"constructor\" &&\n util.isClass(value)) {\n promisifyAll(value.prototype, suffix, filter, promisifier,\n multiArgs);\n promisifyAll(value, suffix, filter, promisifier, multiArgs);\n }\n }\n\n return promisifyAll(target, suffix, filter, promisifier, multiArgs);\n};\n};\n\n\n},{\"./errors\":12,\"./nodeback\":20,\"./util\":36}],25:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(\n Promise, PromiseArray, tryConvertToPromise, apiRejection) {\nvar util = _dereq_(\"./util\");\nvar isObject = util.isObject;\nvar es5 = _dereq_(\"./es5\");\nvar Es6Map;\nif (typeof Map === \"function\") Es6Map = Map;\n\nvar mapToEntries = (function() {\n var index = 0;\n var size = 0;\n\n function extractEntry(value, key) {\n this[index] = value;\n this[index + size] = key;\n index++;\n }\n\n return function mapToEntries(map) {\n size = map.size;\n index = 0;\n var ret = new Array(map.size * 2);\n map.forEach(extractEntry, ret);\n return ret;\n };\n})();\n\nvar entriesToMap = function(entries) {\n var ret = new Es6Map();\n var length = entries.length / 2 | 0;\n for (var i = 0; i < length; ++i) {\n var key = entries[length + i];\n var value = entries[i];\n ret.set(key, value);\n }\n return ret;\n};\n\nfunction PropertiesPromiseArray(obj) {\n var isMap = false;\n var entries;\n if (Es6Map !== undefined && obj instanceof Es6Map) {\n entries = mapToEntries(obj);\n isMap = true;\n } else {\n var keys = es5.keys(obj);\n var len = keys.length;\n entries = new Array(len * 2);\n for (var i = 0; i < len; ++i) {\n var key = keys[i];\n entries[i] = obj[key];\n entries[i + len] = key;\n }\n }\n this.constructor$(entries);\n this._isMap = isMap;\n this._init$(undefined, isMap ? -6 : -3);\n}\nutil.inherits(PropertiesPromiseArray, PromiseArray);\n\nPropertiesPromiseArray.prototype._init = function () {};\n\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\n this._values[index] = value;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n var val;\n if (this._isMap) {\n val = entriesToMap(this._values);\n } else {\n val = {};\n var keyOffset = this.length();\n for (var i = 0, len = this.length(); i < len; ++i) {\n val[this._values[i + keyOffset]] = this._values[i];\n }\n }\n this._resolve(val);\n return true;\n }\n return false;\n};\n\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\n return false;\n};\n\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\n return len >> 1;\n};\n\nfunction props(promises) {\n var ret;\n var castValue = tryConvertToPromise(promises);\n\n if (!isObject(castValue)) {\n return apiRejection(\"cannot await properties of a non-object\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n } else if (castValue instanceof Promise) {\n ret = castValue._then(\n Promise.props, undefined, undefined, undefined, undefined);\n } else {\n ret = new PropertiesPromiseArray(castValue).promise();\n }\n\n if (castValue instanceof Promise) {\n ret._propagateFrom(castValue, 2);\n }\n return ret;\n}\n\nPromise.prototype.props = function () {\n return props(this);\n};\n\nPromise.props = function (promises) {\n return props(promises);\n};\n};\n\n},{\"./es5\":13,\"./util\":36}],26:[function(_dereq_,module,exports){\n\"use strict\";\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\n for (var j = 0; j < len; ++j) {\n dst[j + dstIndex] = src[j + srcIndex];\n src[j + srcIndex] = void 0;\n }\n}\n\nfunction Queue(capacity) {\n this._capacity = capacity;\n this._length = 0;\n this._front = 0;\n}\n\nQueue.prototype._willBeOverCapacity = function (size) {\n return this._capacity < size;\n};\n\nQueue.prototype._pushOne = function (arg) {\n var length = this.length();\n this._checkCapacity(length + 1);\n var i = (this._front + length) & (this._capacity - 1);\n this[i] = arg;\n this._length = length + 1;\n};\n\nQueue.prototype.push = function (fn, receiver, arg) {\n var length = this.length() + 3;\n if (this._willBeOverCapacity(length)) {\n this._pushOne(fn);\n this._pushOne(receiver);\n this._pushOne(arg);\n return;\n }\n var j = this._front + length - 3;\n this._checkCapacity(length);\n var wrapMask = this._capacity - 1;\n this[(j + 0) & wrapMask] = fn;\n this[(j + 1) & wrapMask] = receiver;\n this[(j + 2) & wrapMask] = arg;\n this._length = length;\n};\n\nQueue.prototype.shift = function () {\n var front = this._front,\n ret = this[front];\n\n this[front] = undefined;\n this._front = (front + 1) & (this._capacity - 1);\n this._length--;\n return ret;\n};\n\nQueue.prototype.length = function () {\n return this._length;\n};\n\nQueue.prototype._checkCapacity = function (size) {\n if (this._capacity < size) {\n this._resizeTo(this._capacity << 1);\n }\n};\n\nQueue.prototype._resizeTo = function (capacity) {\n var oldCapacity = this._capacity;\n this._capacity = capacity;\n var front = this._front;\n var length = this._length;\n var moveItemsCount = (front + length) & (oldCapacity - 1);\n arrayMove(this, 0, this, oldCapacity, moveItemsCount);\n};\n\nmodule.exports = Queue;\n\n},{}],27:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(\n Promise, INTERNAL, tryConvertToPromise, apiRejection) {\nvar util = _dereq_(\"./util\");\n\nvar raceLater = function (promise) {\n return promise.then(function(array) {\n return race(array, promise);\n });\n};\n\nfunction race(promises, parent) {\n var maybePromise = tryConvertToPromise(promises);\n\n if (maybePromise instanceof Promise) {\n return raceLater(maybePromise);\n } else {\n promises = util.asArray(promises);\n if (promises === null)\n return apiRejection(\"expecting an array or an iterable object but got \" + util.classString(promises));\n }\n\n var ret = new Promise(INTERNAL);\n if (parent !== undefined) {\n ret._propagateFrom(parent, 3);\n }\n var fulfill = ret._fulfill;\n var reject = ret._reject;\n for (var i = 0, len = promises.length; i < len; ++i) {\n var val = promises[i];\n\n if (val === undefined && !(i in promises)) {\n continue;\n }\n\n Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\n }\n return ret;\n}\n\nPromise.race = function (promises) {\n return race(promises, undefined);\n};\n\nPromise.prototype.race = function () {\n return race(this, undefined);\n};\n\n};\n\n},{\"./util\":36}],28:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise,\n PromiseArray,\n apiRejection,\n tryConvertToPromise,\n INTERNAL,\n debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_(\"./util\");\nvar tryCatch = util.tryCatch;\n\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\n this.constructor$(promises);\n var domain = getDomain();\n this._fn = domain === null ? fn : util.domainBind(domain, fn);\n if (initialValue !== undefined) {\n initialValue = Promise.resolve(initialValue);\n initialValue._attachCancellationCallback(this);\n }\n this._initialValue = initialValue;\n this._currentCancellable = null;\n if(_each === INTERNAL) {\n this._eachValues = Array(this._length);\n } else if (_each === 0) {\n this._eachValues = null;\n } else {\n this._eachValues = undefined;\n }\n this._promise._captureStackTrace();\n this._init$(undefined, -5);\n}\nutil.inherits(ReductionPromiseArray, PromiseArray);\n\nReductionPromiseArray.prototype._gotAccum = function(accum) {\n if (this._eachValues !== undefined && \n this._eachValues !== null && \n accum !== INTERNAL) {\n this._eachValues.push(accum);\n }\n};\n\nReductionPromiseArray.prototype._eachComplete = function(value) {\n if (this._eachValues !== null) {\n this._eachValues.push(value);\n }\n return this._eachValues;\n};\n\nReductionPromiseArray.prototype._init = function() {};\n\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\n this._resolve(this._eachValues !== undefined ? this._eachValues\n : this._initialValue);\n};\n\nReductionPromiseArray.prototype.shouldCopyValues = function () {\n return false;\n};\n\nReductionPromiseArray.prototype._resolve = function(value) {\n this._promise._resolveCallback(value);\n this._values = null;\n};\n\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\n if (sender === this._initialValue) return this._cancel();\n if (this._isResolved()) return;\n this._resultCancelled$();\n if (this._currentCancellable instanceof Promise) {\n this._currentCancellable.cancel();\n }\n if (this._initialValue instanceof Promise) {\n this._initialValue.cancel();\n }\n};\n\nReductionPromiseArray.prototype._iterate = function (values) {\n this._values = values;\n var value;\n var i;\n var length = values.length;\n if (this._initialValue !== undefined) {\n value = this._initialValue;\n i = 0;\n } else {\n value = Promise.resolve(values[0]);\n i = 1;\n }\n\n this._currentCancellable = value;\n\n if (!value.isRejected()) {\n for (; i < length; ++i) {\n var ctx = {\n accum: null,\n value: values[i],\n index: i,\n length: length,\n array: this\n };\n value = value._then(gotAccum, undefined, undefined, ctx, undefined);\n }\n }\n\n if (this._eachValues !== undefined) {\n value = value\n ._then(this._eachComplete, undefined, undefined, this, undefined);\n }\n value._then(completed, completed, undefined, value, this);\n};\n\nPromise.prototype.reduce = function (fn, initialValue) {\n return reduce(this, fn, initialValue, null);\n};\n\nPromise.reduce = function (promises, fn, initialValue, _each) {\n return reduce(promises, fn, initialValue, _each);\n};\n\nfunction completed(valueOrReason, array) {\n if (this.isFulfilled()) {\n array._resolve(valueOrReason);\n } else {\n array._reject(valueOrReason);\n }\n}\n\nfunction reduce(promises, fn, initialValue, _each) {\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\n return array.promise();\n}\n\nfunction gotAccum(accum) {\n this.accum = accum;\n this.array._gotAccum(accum);\n var value = tryConvertToPromise(this.value, this.array._promise);\n if (value instanceof Promise) {\n this.array._currentCancellable = value;\n return value._then(gotValue, undefined, undefined, this, undefined);\n } else {\n return gotValue.call(this, value);\n }\n}\n\nfunction gotValue(value) {\n var array = this.array;\n var promise = array._promise;\n var fn = tryCatch(array._fn);\n promise._pushContext();\n var ret;\n if (array._eachValues !== undefined) {\n ret = fn.call(promise._boundValue(), value, this.index, this.length);\n } else {\n ret = fn.call(promise._boundValue(),\n this.accum, value, this.index, this.length);\n }\n if (ret instanceof Promise) {\n array._currentCancellable = ret;\n }\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret,\n promiseCreated,\n array._eachValues !== undefined ? \"Promise.each\" : \"Promise.reduce\",\n promise\n );\n return ret;\n}\n};\n\n},{\"./util\":36}],29:[function(_dereq_,module,exports){\n\"use strict\";\nvar util = _dereq_(\"./util\");\nvar schedule;\nvar noAsyncScheduler = function() {\n throw new Error(\"No async scheduler available\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n};\nvar NativePromise = util.getNativePromise();\nif (util.isNode && typeof MutationObserver === \"undefined\") {\n var GlobalSetImmediate = global.setImmediate;\n var ProcessNextTick = process.nextTick;\n schedule = util.isRecentNode\n ? function(fn) { GlobalSetImmediate.call(global, fn); }\n : function(fn) { ProcessNextTick.call(process, fn); };\n} else if (typeof NativePromise === \"function\" &&\n typeof NativePromise.resolve === \"function\") {\n var nativePromise = NativePromise.resolve();\n schedule = function(fn) {\n nativePromise.then(fn);\n };\n} else if ((typeof MutationObserver !== \"undefined\") &&\n !(typeof window !== \"undefined\" &&\n window.navigator &&\n (window.navigator.standalone || window.cordova))) {\n schedule = (function() {\n var div = document.createElement(\"div\");\n var opts = {attributes: true};\n var toggleScheduled = false;\n var div2 = document.createElement(\"div\");\n var o2 = new MutationObserver(function() {\n div.classList.toggle(\"foo\");\n toggleScheduled = false;\n });\n o2.observe(div2, opts);\n\n var scheduleToggle = function() {\n if (toggleScheduled) return;\n toggleScheduled = true;\n div2.classList.toggle(\"foo\");\n };\n\n return function schedule(fn) {\n var o = new MutationObserver(function() {\n o.disconnect();\n fn();\n });\n o.observe(div, opts);\n scheduleToggle();\n };\n })();\n} else if (typeof setImmediate !== \"undefined\") {\n schedule = function (fn) {\n setImmediate(fn);\n };\n} else if (typeof setTimeout !== \"undefined\") {\n schedule = function (fn) {\n setTimeout(fn, 0);\n };\n} else {\n schedule = noAsyncScheduler;\n}\nmodule.exports = schedule;\n\n},{\"./util\":36}],30:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\n function(Promise, PromiseArray, debug) {\nvar PromiseInspection = Promise.PromiseInspection;\nvar util = _dereq_(\"./util\");\n\nfunction SettledPromiseArray(values) {\n this.constructor$(values);\n}\nutil.inherits(SettledPromiseArray, PromiseArray);\n\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\n this._values[index] = inspection;\n var totalResolved = ++this._totalResolved;\n if (totalResolved >= this._length) {\n this._resolve(this._values);\n return true;\n }\n return false;\n};\n\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\n var ret = new PromiseInspection();\n ret._bitField = 33554432;\n ret._settledValueField = value;\n return this._promiseResolved(index, ret);\n};\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\n var ret = new PromiseInspection();\n ret._bitField = 16777216;\n ret._settledValueField = reason;\n return this._promiseResolved(index, ret);\n};\n\nPromise.settle = function (promises) {\n debug.deprecated(\".settle()\", \".reflect()\");\n return new SettledPromiseArray(promises).promise();\n};\n\nPromise.prototype.settle = function () {\n return Promise.settle(this);\n};\n};\n\n},{\"./util\":36}],31:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports =\nfunction(Promise, PromiseArray, apiRejection) {\nvar util = _dereq_(\"./util\");\nvar RangeError = _dereq_(\"./errors\").RangeError;\nvar AggregateError = _dereq_(\"./errors\").AggregateError;\nvar isArray = util.isArray;\nvar CANCELLATION = {};\n\n\nfunction SomePromiseArray(values) {\n this.constructor$(values);\n this._howMany = 0;\n this._unwrap = false;\n this._initialized = false;\n}\nutil.inherits(SomePromiseArray, PromiseArray);\n\nSomePromiseArray.prototype._init = function () {\n if (!this._initialized) {\n return;\n }\n if (this._howMany === 0) {\n this._resolve([]);\n return;\n }\n this._init$(undefined, -5);\n var isArrayResolved = isArray(this._values);\n if (!this._isResolved() &&\n isArrayResolved &&\n this._howMany > this._canPossiblyFulfill()) {\n this._reject(this._getRangeError(this.length()));\n }\n};\n\nSomePromiseArray.prototype.init = function () {\n this._initialized = true;\n this._init();\n};\n\nSomePromiseArray.prototype.setUnwrap = function () {\n this._unwrap = true;\n};\n\nSomePromiseArray.prototype.howMany = function () {\n return this._howMany;\n};\n\nSomePromiseArray.prototype.setHowMany = function (count) {\n this._howMany = count;\n};\n\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\n this._addFulfilled(value);\n if (this._fulfilled() === this.howMany()) {\n this._values.length = this.howMany();\n if (this.howMany() === 1 && this._unwrap) {\n this._resolve(this._values[0]);\n } else {\n this._resolve(this._values);\n }\n return true;\n }\n return false;\n\n};\nSomePromiseArray.prototype._promiseRejected = function (reason) {\n this._addRejected(reason);\n return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._promiseCancelled = function () {\n if (this._values instanceof Promise || this._values == null) {\n return this._cancel();\n }\n this._addRejected(CANCELLATION);\n return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._checkOutcome = function() {\n if (this.howMany() > this._canPossiblyFulfill()) {\n var e = new AggregateError();\n for (var i = this.length(); i < this._values.length; ++i) {\n if (this._values[i] !== CANCELLATION) {\n e.push(this._values[i]);\n }\n }\n if (e.length > 0) {\n this._reject(e);\n } else {\n this._cancel();\n }\n return true;\n }\n return false;\n};\n\nSomePromiseArray.prototype._fulfilled = function () {\n return this._totalResolved;\n};\n\nSomePromiseArray.prototype._rejected = function () {\n return this._values.length - this.length();\n};\n\nSomePromiseArray.prototype._addRejected = function (reason) {\n this._values.push(reason);\n};\n\nSomePromiseArray.prototype._addFulfilled = function (value) {\n this._values[this._totalResolved++] = value;\n};\n\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\n return this.length() - this._rejected();\n};\n\nSomePromiseArray.prototype._getRangeError = function (count) {\n var message = \"Input array must contain at least \" +\n this._howMany + \" items but contains only \" + count + \" items\";\n return new RangeError(message);\n};\n\nSomePromiseArray.prototype._resolveEmptyArray = function () {\n this._reject(this._getRangeError(0));\n};\n\nfunction some(promises, howMany) {\n if ((howMany | 0) !== howMany || howMany < 0) {\n return apiRejection(\"expecting a positive integer\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n var ret = new SomePromiseArray(promises);\n var promise = ret.promise();\n ret.setHowMany(howMany);\n ret.init();\n return promise;\n}\n\nPromise.some = function (promises, howMany) {\n return some(promises, howMany);\n};\n\nPromise.prototype.some = function (howMany) {\n return some(this, howMany);\n};\n\nPromise._SomePromiseArray = SomePromiseArray;\n};\n\n},{\"./errors\":12,\"./util\":36}],32:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise) {\nfunction PromiseInspection(promise) {\n if (promise !== undefined) {\n promise = promise._target();\n this._bitField = promise._bitField;\n this._settledValueField = promise._isFateSealed()\n ? promise._settledValue() : undefined;\n }\n else {\n this._bitField = 0;\n this._settledValueField = undefined;\n }\n}\n\nPromiseInspection.prototype._settledValue = function() {\n return this._settledValueField;\n};\n\nvar value = PromiseInspection.prototype.value = function () {\n if (!this.isFulfilled()) {\n throw new TypeError(\"cannot get fulfillment value of a non-fulfilled promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n return this._settledValue();\n};\n\nvar reason = PromiseInspection.prototype.error =\nPromiseInspection.prototype.reason = function () {\n if (!this.isRejected()) {\n throw new TypeError(\"cannot get rejection reason of a non-rejected promise\\u000a\\u000a See http://goo.gl/MqrFmX\\u000a\");\n }\n return this._settledValue();\n};\n\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\n return (this._bitField & 33554432) !== 0;\n};\n\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\n return (this._bitField & 16777216) !== 0;\n};\n\nvar isPending = PromiseInspection.prototype.isPending = function () {\n return (this._bitField & 50397184) === 0;\n};\n\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\n return (this._bitField & 50331648) !== 0;\n};\n\nPromiseInspection.prototype.isCancelled = function() {\n return (this._bitField & 8454144) !== 0;\n};\n\nPromise.prototype.__isCancelled = function() {\n return (this._bitField & 65536) === 65536;\n};\n\nPromise.prototype._isCancelled = function() {\n return this._target().__isCancelled();\n};\n\nPromise.prototype.isCancelled = function() {\n return (this._target()._bitField & 8454144) !== 0;\n};\n\nPromise.prototype.isPending = function() {\n return isPending.call(this._target());\n};\n\nPromise.prototype.isRejected = function() {\n return isRejected.call(this._target());\n};\n\nPromise.prototype.isFulfilled = function() {\n return isFulfilled.call(this._target());\n};\n\nPromise.prototype.isResolved = function() {\n return isResolved.call(this._target());\n};\n\nPromise.prototype.value = function() {\n return value.call(this._target());\n};\n\nPromise.prototype.reason = function() {\n var target = this._target();\n target._unsetRejectionIsUnhandled();\n return reason.call(target);\n};\n\nPromise.prototype._value = function() {\n return this._settledValue();\n};\n\nPromise.prototype._reason = function() {\n this._unsetRejectionIsUnhandled();\n return this._settledValue();\n};\n\nPromise.PromiseInspection = PromiseInspection;\n};\n\n},{}],33:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL) {\nvar util = _dereq_(\"./util\");\nvar errorObj = util.errorObj;\nvar isObject = util.isObject;\n\nfunction tryConvertToPromise(obj, context) {\n if (isObject(obj)) {\n if (obj instanceof Promise) return obj;\n var then = getThen(obj);\n if (then === errorObj) {\n if (context) context._pushContext();\n var ret = Promise.reject(then.e);\n if (context) context._popContext();\n return ret;\n } else if (typeof then === \"function\") {\n if (isAnyBluebirdPromise(obj)) {\n var ret = new Promise(INTERNAL);\n obj._then(\n ret._fulfill,\n ret._reject,\n undefined,\n ret,\n null\n );\n return ret;\n }\n return doThenable(obj, then, context);\n }\n }\n return obj;\n}\n\nfunction doGetThen(obj) {\n return obj.then;\n}\n\nfunction getThen(obj) {\n try {\n return doGetThen(obj);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n}\n\nvar hasProp = {}.hasOwnProperty;\nfunction isAnyBluebirdPromise(obj) {\n try {\n return hasProp.call(obj, \"_promise0\");\n } catch (e) {\n return false;\n }\n}\n\nfunction doThenable(x, then, context) {\n var promise = new Promise(INTERNAL);\n var ret = promise;\n if (context) context._pushContext();\n promise._captureStackTrace();\n if (context) context._popContext();\n var synchronous = true;\n var result = util.tryCatch(then).call(x, resolve, reject);\n synchronous = false;\n\n if (promise && result === errorObj) {\n promise._rejectCallback(result.e, true, true);\n promise = null;\n }\n\n function resolve(value) {\n if (!promise) return;\n promise._resolveCallback(value);\n promise = null;\n }\n\n function reject(reason) {\n if (!promise) return;\n promise._rejectCallback(reason, synchronous, true);\n promise = null;\n }\n return ret;\n}\n\nreturn tryConvertToPromise;\n};\n\n},{\"./util\":36}],34:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function(Promise, INTERNAL, debug) {\nvar util = _dereq_(\"./util\");\nvar TimeoutError = Promise.TimeoutError;\n\nfunction HandleWrapper(handle) {\n this.handle = handle;\n}\n\nHandleWrapper.prototype._resultCancelled = function() {\n clearTimeout(this.handle);\n};\n\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\nvar delay = Promise.delay = function (ms, value) {\n var ret;\n var handle;\n if (value !== undefined) {\n ret = Promise.resolve(value)\n ._then(afterValue, null, null, ms, undefined);\n if (debug.cancellation() && value instanceof Promise) {\n ret._setOnCancel(value);\n }\n } else {\n ret = new Promise(INTERNAL);\n handle = setTimeout(function() { ret._fulfill(); }, +ms);\n if (debug.cancellation()) {\n ret._setOnCancel(new HandleWrapper(handle));\n }\n ret._captureStackTrace();\n }\n ret._setAsyncGuaranteed();\n return ret;\n};\n\nPromise.prototype.delay = function (ms) {\n return delay(ms, this);\n};\n\nvar afterTimeout = function (promise, message, parent) {\n var err;\n if (typeof message !== \"string\") {\n if (message instanceof Error) {\n err = message;\n } else {\n err = new TimeoutError(\"operation timed out\");\n }\n } else {\n err = new TimeoutError(message);\n }\n util.markAsOriginatingFromRejection(err);\n promise._attachExtraTrace(err);\n promise._reject(err);\n\n if (parent != null) {\n parent.cancel();\n }\n};\n\nfunction successClear(value) {\n clearTimeout(this.handle);\n return value;\n}\n\nfunction failureClear(reason) {\n clearTimeout(this.handle);\n throw reason;\n}\n\nPromise.prototype.timeout = function (ms, message) {\n ms = +ms;\n var ret, parent;\n\n var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\n if (ret.isPending()) {\n afterTimeout(ret, message, parent);\n }\n }, ms));\n\n if (debug.cancellation()) {\n parent = this.then();\n ret = parent._then(successClear, failureClear,\n undefined, handleWrapper, undefined);\n ret._setOnCancel(handleWrapper);\n } else {\n ret = this._then(successClear, failureClear,\n undefined, handleWrapper, undefined);\n }\n\n return ret;\n};\n\n};\n\n},{\"./util\":36}],35:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\n createContext, INTERNAL, debug) {\n var util = _dereq_(\"./util\");\n var TypeError = _dereq_(\"./errors\").TypeError;\n var inherits = _dereq_(\"./util\").inherits;\n var errorObj = util.errorObj;\n var tryCatch = util.tryCatch;\n var NULL = {};\n\n function thrower(e) {\n setTimeout(function(){throw e;}, 0);\n }\n\n function castPreservingDisposable(thenable) {\n var maybePromise = tryConvertToPromise(thenable);\n if (maybePromise !== thenable &&\n typeof thenable._isDisposable === \"function\" &&\n typeof thenable._getDisposer === \"function\" &&\n thenable._isDisposable()) {\n maybePromise._setDisposable(thenable._getDisposer());\n }\n return maybePromise;\n }\n function dispose(resources, inspection) {\n var i = 0;\n var len = resources.length;\n var ret = new Promise(INTERNAL);\n function iterator() {\n if (i >= len) return ret._fulfill();\n var maybePromise = castPreservingDisposable(resources[i++]);\n if (maybePromise instanceof Promise &&\n maybePromise._isDisposable()) {\n try {\n maybePromise = tryConvertToPromise(\n maybePromise._getDisposer().tryDispose(inspection),\n resources.promise);\n } catch (e) {\n return thrower(e);\n }\n if (maybePromise instanceof Promise) {\n return maybePromise._then(iterator, thrower,\n null, null, null);\n }\n }\n iterator();\n }\n iterator();\n return ret;\n }\n\n function Disposer(data, promise, context) {\n this._data = data;\n this._promise = promise;\n this._context = context;\n }\n\n Disposer.prototype.data = function () {\n return this._data;\n };\n\n Disposer.prototype.promise = function () {\n return this._promise;\n };\n\n Disposer.prototype.resource = function () {\n if (this.promise().isFulfilled()) {\n return this.promise().value();\n }\n return NULL;\n };\n\n Disposer.prototype.tryDispose = function(inspection) {\n var resource = this.resource();\n var context = this._context;\n if (context !== undefined) context._pushContext();\n var ret = resource !== NULL\n ? this.doDispose(resource, inspection) : null;\n if (context !== undefined) context._popContext();\n this._promise._unsetDisposable();\n this._data = null;\n return ret;\n };\n\n Disposer.isDisposer = function (d) {\n return (d != null &&\n typeof d.resource === \"function\" &&\n typeof d.tryDispose === \"function\");\n };\n\n function FunctionDisposer(fn, promise, context) {\n this.constructor$(fn, promise, context);\n }\n inherits(FunctionDisposer, Disposer);\n\n FunctionDisposer.prototype.doDispose = function (resource, inspection) {\n var fn = this.data();\n return fn.call(resource, resource, inspection);\n };\n\n function maybeUnwrapDisposer(value) {\n if (Disposer.isDisposer(value)) {\n this.resources[this.index]._setDisposable(value);\n return value.promise();\n }\n return value;\n }\n\n function ResourceList(length) {\n this.length = length;\n this.promise = null;\n this[length-1] = null;\n }\n\n ResourceList.prototype._resultCancelled = function() {\n var len = this.length;\n for (var i = 0; i < len; ++i) {\n var item = this[i];\n if (item instanceof Promise) {\n item.cancel();\n }\n }\n };\n\n Promise.using = function () {\n var len = arguments.length;\n if (len < 2) return apiRejection(\n \"you must pass at least 2 arguments to Promise.using\");\n var fn = arguments[len - 1];\n if (typeof fn !== \"function\") {\n return apiRejection(\"expecting a function but got \" + util.classString(fn));\n }\n var input;\n var spreadArgs = true;\n if (len === 2 && Array.isArray(arguments[0])) {\n input = arguments[0];\n len = input.length;\n spreadArgs = false;\n } else {\n input = arguments;\n len--;\n }\n var resources = new ResourceList(len);\n for (var i = 0; i < len; ++i) {\n var resource = input[i];\n if (Disposer.isDisposer(resource)) {\n var disposer = resource;\n resource = resource.promise();\n resource._setDisposable(disposer);\n } else {\n var maybePromise = tryConvertToPromise(resource);\n if (maybePromise instanceof Promise) {\n resource =\n maybePromise._then(maybeUnwrapDisposer, null, null, {\n resources: resources,\n index: i\n }, undefined);\n }\n }\n resources[i] = resource;\n }\n\n var reflectedResources = new Array(resources.length);\n for (var i = 0; i < reflectedResources.length; ++i) {\n reflectedResources[i] = Promise.resolve(resources[i]).reflect();\n }\n\n var resultPromise = Promise.all(reflectedResources)\n .then(function(inspections) {\n for (var i = 0; i < inspections.length; ++i) {\n var inspection = inspections[i];\n if (inspection.isRejected()) {\n errorObj.e = inspection.error();\n return errorObj;\n } else if (!inspection.isFulfilled()) {\n resultPromise.cancel();\n return;\n }\n inspections[i] = inspection.value();\n }\n promise._pushContext();\n\n fn = tryCatch(fn);\n var ret = spreadArgs\n ? fn.apply(undefined, inspections) : fn(inspections);\n var promiseCreated = promise._popContext();\n debug.checkForgottenReturns(\n ret, promiseCreated, \"Promise.using\", promise);\n return ret;\n });\n\n var promise = resultPromise.lastly(function() {\n var inspection = new Promise.PromiseInspection(resultPromise);\n return dispose(resources, inspection);\n });\n resources.promise = promise;\n promise._setOnCancel(resources);\n return promise;\n };\n\n Promise.prototype._setDisposable = function (disposer) {\n this._bitField = this._bitField | 131072;\n this._disposer = disposer;\n };\n\n Promise.prototype._isDisposable = function () {\n return (this._bitField & 131072) > 0;\n };\n\n Promise.prototype._getDisposer = function () {\n return this._disposer;\n };\n\n Promise.prototype._unsetDisposable = function () {\n this._bitField = this._bitField & (~131072);\n this._disposer = undefined;\n };\n\n Promise.prototype.disposer = function (fn) {\n if (typeof fn === \"function\") {\n return new FunctionDisposer(fn, this, createContext());\n }\n throw new TypeError();\n };\n\n};\n\n},{\"./errors\":12,\"./util\":36}],36:[function(_dereq_,module,exports){\n\"use strict\";\nvar es5 = _dereq_(\"./es5\");\nvar canEvaluate = typeof navigator == \"undefined\";\n\nvar errorObj = {e: {}};\nvar tryCatchTarget;\nvar globalObject = typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window :\n typeof global !== \"undefined\" ? global :\n this !== undefined ? this : null;\n\nfunction tryCatcher() {\n try {\n var target = tryCatchTarget;\n tryCatchTarget = null;\n return target.apply(this, arguments);\n } catch (e) {\n errorObj.e = e;\n return errorObj;\n }\n}\nfunction tryCatch(fn) {\n tryCatchTarget = fn;\n return tryCatcher;\n}\n\nvar inherits = function(Child, Parent) {\n var hasProp = {}.hasOwnProperty;\n\n function T() {\n this.constructor = Child;\n this.constructor$ = Parent;\n for (var propertyName in Parent.prototype) {\n if (hasProp.call(Parent.prototype, propertyName) &&\n propertyName.charAt(propertyName.length-1) !== \"$\"\n ) {\n this[propertyName + \"$\"] = Parent.prototype[propertyName];\n }\n }\n }\n T.prototype = Parent.prototype;\n Child.prototype = new T();\n return Child.prototype;\n};\n\n\nfunction isPrimitive(val) {\n return val == null || val === true || val === false ||\n typeof val === \"string\" || typeof val === \"number\";\n\n}\n\nfunction isObject(value) {\n return typeof value === \"function\" ||\n typeof value === \"object\" && value !== null;\n}\n\nfunction maybeWrapAsError(maybeError) {\n if (!isPrimitive(maybeError)) return maybeError;\n\n return new Error(safeToString(maybeError));\n}\n\nfunction withAppended(target, appendee) {\n var len = target.length;\n var ret = new Array(len + 1);\n var i;\n for (i = 0; i < len; ++i) {\n ret[i] = target[i];\n }\n ret[i] = appendee;\n return ret;\n}\n\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\n if (es5.isES5) {\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n\n if (desc != null) {\n return desc.get == null && desc.set == null\n ? desc.value\n : defaultValue;\n }\n } else {\n return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\n }\n}\n\nfunction notEnumerableProp(obj, name, value) {\n if (isPrimitive(obj)) return obj;\n var descriptor = {\n value: value,\n configurable: true,\n enumerable: false,\n writable: true\n };\n es5.defineProperty(obj, name, descriptor);\n return obj;\n}\n\nfunction thrower(r) {\n throw r;\n}\n\nvar inheritedDataKeys = (function() {\n var excludedPrototypes = [\n Array.prototype,\n Object.prototype,\n Function.prototype\n ];\n\n var isExcludedProto = function(val) {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (excludedPrototypes[i] === val) {\n return true;\n }\n }\n return false;\n };\n\n if (es5.isES5) {\n var getKeys = Object.getOwnPropertyNames;\n return function(obj) {\n var ret = [];\n var visitedKeys = Object.create(null);\n while (obj != null && !isExcludedProto(obj)) {\n var keys;\n try {\n keys = getKeys(obj);\n } catch (e) {\n return ret;\n }\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (visitedKeys[key]) continue;\n visitedKeys[key] = true;\n var desc = Object.getOwnPropertyDescriptor(obj, key);\n if (desc != null && desc.get == null && desc.set == null) {\n ret.push(key);\n }\n }\n obj = es5.getPrototypeOf(obj);\n }\n return ret;\n };\n } else {\n var hasProp = {}.hasOwnProperty;\n return function(obj) {\n if (isExcludedProto(obj)) return [];\n var ret = [];\n\n /*jshint forin:false */\n enumeration: for (var key in obj) {\n if (hasProp.call(obj, key)) {\n ret.push(key);\n } else {\n for (var i = 0; i < excludedPrototypes.length; ++i) {\n if (hasProp.call(excludedPrototypes[i], key)) {\n continue enumeration;\n }\n }\n ret.push(key);\n }\n }\n return ret;\n };\n }\n\n})();\n\nvar thisAssignmentPattern = /this\\s*\\.\\s*\\S+\\s*=/;\nfunction isClass(fn) {\n try {\n if (typeof fn === \"function\") {\n var keys = es5.names(fn.prototype);\n\n var hasMethods = es5.isES5 && keys.length > 1;\n var hasMethodsOtherThanConstructor = keys.length > 0 &&\n !(keys.length === 1 && keys[0] === \"constructor\");\n var hasThisAssignmentAndStaticMethods =\n thisAssignmentPattern.test(fn + \"\") && es5.names(fn).length > 0;\n\n if (hasMethods || hasMethodsOtherThanConstructor ||\n hasThisAssignmentAndStaticMethods) {\n return true;\n }\n }\n return false;\n } catch (e) {\n return false;\n }\n}\n\nfunction toFastProperties(obj) {\n /*jshint -W027,-W055,-W031*/\n function FakeConstructor() {}\n FakeConstructor.prototype = obj;\n var l = 8;\n while (l--) new FakeConstructor();\n return obj;\n eval(obj);\n}\n\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\nfunction isIdentifier(str) {\n return rident.test(str);\n}\n\nfunction filledRange(count, prefix, suffix) {\n var ret = new Array(count);\n for(var i = 0; i < count; ++i) {\n ret[i] = prefix + i + suffix;\n }\n return ret;\n}\n\nfunction safeToString(obj) {\n try {\n return obj + \"\";\n } catch (e) {\n return \"[no string representation]\";\n }\n}\n\nfunction isError(obj) {\n return obj !== null &&\n typeof obj === \"object\" &&\n typeof obj.message === \"string\" &&\n typeof obj.name === \"string\";\n}\n\nfunction markAsOriginatingFromRejection(e) {\n try {\n notEnumerableProp(e, \"isOperational\", true);\n }\n catch(ignore) {}\n}\n\nfunction originatesFromRejection(e) {\n if (e == null) return false;\n return ((e instanceof Error[\"__BluebirdErrorTypes__\"].OperationalError) ||\n e[\"isOperational\"] === true);\n}\n\nfunction canAttachTrace(obj) {\n return isError(obj) && es5.propertyIsWritable(obj, \"stack\");\n}\n\nvar ensureErrorObject = (function() {\n if (!(\"stack\" in new Error())) {\n return function(value) {\n if (canAttachTrace(value)) return value;\n try {throw new Error(safeToString(value));}\n catch(err) {return err;}\n };\n } else {\n return function(value) {\n if (canAttachTrace(value)) return value;\n return new Error(safeToString(value));\n };\n }\n})();\n\nfunction classString(obj) {\n return {}.toString.call(obj);\n}\n\nfunction copyDescriptors(from, to, filter) {\n var keys = es5.names(from);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (filter(key)) {\n try {\n es5.defineProperty(to, key, es5.getDescriptor(from, key));\n } catch (ignore) {}\n }\n }\n}\n\nvar asArray = function(v) {\n if (es5.isArray(v)) {\n return v;\n }\n return null;\n};\n\nif (typeof Symbol !== \"undefined\" && Symbol.iterator) {\n var ArrayFrom = typeof Array.from === \"function\" ? function(v) {\n return Array.from(v);\n } : function(v) {\n var ret = [];\n var it = v[Symbol.iterator]();\n var itResult;\n while (!((itResult = it.next()).done)) {\n ret.push(itResult.value);\n }\n return ret;\n };\n\n asArray = function(v) {\n if (es5.isArray(v)) {\n return v;\n } else if (v != null && typeof v[Symbol.iterator] === \"function\") {\n return ArrayFrom(v);\n }\n return null;\n };\n}\n\nvar isNode = typeof process !== \"undefined\" &&\n classString(process).toLowerCase() === \"[object process]\";\n\nvar hasEnvVariables = typeof process !== \"undefined\" &&\n typeof process.env !== \"undefined\";\n\nfunction env(key) {\n return hasEnvVariables ? process.env[key] : undefined;\n}\n\nfunction getNativePromise() {\n if (typeof Promise === \"function\") {\n try {\n var promise = new Promise(function(){});\n if ({}.toString.call(promise) === \"[object Promise]\") {\n return Promise;\n }\n } catch (e) {}\n }\n}\n\nfunction domainBind(self, cb) {\n return self.bind(cb);\n}\n\nvar ret = {\n isClass: isClass,\n isIdentifier: isIdentifier,\n inheritedDataKeys: inheritedDataKeys,\n getDataPropertyOrDefault: getDataPropertyOrDefault,\n thrower: thrower,\n isArray: es5.isArray,\n asArray: asArray,\n notEnumerableProp: notEnumerableProp,\n isPrimitive: isPrimitive,\n isObject: isObject,\n isError: isError,\n canEvaluate: canEvaluate,\n errorObj: errorObj,\n tryCatch: tryCatch,\n inherits: inherits,\n withAppended: withAppended,\n maybeWrapAsError: maybeWrapAsError,\n toFastProperties: toFastProperties,\n filledRange: filledRange,\n toString: safeToString,\n canAttachTrace: canAttachTrace,\n ensureErrorObject: ensureErrorObject,\n originatesFromRejection: originatesFromRejection,\n markAsOriginatingFromRejection: markAsOriginatingFromRejection,\n classString: classString,\n copyDescriptors: copyDescriptors,\n hasDevTools: typeof chrome !== \"undefined\" && chrome &&\n typeof chrome.loadTimes === \"function\",\n isNode: isNode,\n hasEnvVariables: hasEnvVariables,\n env: env,\n global: globalObject,\n getNativePromise: getNativePromise,\n domainBind: domainBind\n};\nret.isRecentNode = ret.isNode && (function() {\n var version = process.versions.node.split(\".\").map(Number);\n return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\n})();\n\nif (ret.isNode) ret.toFastProperties(process);\n\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\nmodule.exports = ret;\n\n},{\"./es5\":13}]},{},[4])(4)\n}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; }\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bluebird/js/browser/bluebird.js\n// module id = 278\n// module chunks = 0","/*!\n * howler.js v2.0.4\n * howlerjs.com\n *\n * (c) 2013-2017, James Simpson of GoldFire Studios\n * goldfirestudios.com\n *\n * MIT License\n */\n\n(function() {\n\n 'use strict';\n\n /** Global Methods **/\n /***************************************************************************/\n\n /**\n * Create the global controller. All contained methods and properties apply\n * to all sounds that are currently playing or will be in the future.\n */\n var HowlerGlobal = function() {\n this.init();\n };\n HowlerGlobal.prototype = {\n /**\n * Initialize the global Howler object.\n * @return {Howler}\n */\n init: function() {\n var self = this || Howler;\n\n // Create a global ID counter.\n self._counter = 1000;\n\n // Internal properties.\n self._codecs = {};\n self._howls = [];\n self._muted = false;\n self._volume = 1;\n self._canPlayEvent = 'canplaythrough';\n self._navigator = (typeof window !== 'undefined' && window.navigator) ? window.navigator : null;\n\n // Public properties.\n self.masterGain = null;\n self.noAudio = false;\n self.usingWebAudio = true;\n self.autoSuspend = true;\n self.ctx = null;\n\n // Set to false to disable the auto iOS enabler.\n self.mobileAutoEnable = true;\n\n // Setup the various state values for global tracking.\n self._setup();\n\n return self;\n },\n\n /**\n * Get/set the global volume for all sounds.\n * @param {Float} vol Volume from 0.0 to 1.0.\n * @return {Howler/Float} Returns self or current volume.\n */\n volume: function(vol) {\n var self = this || Howler;\n vol = parseFloat(vol);\n\n // If we don't have an AudioContext created yet, run the setup.\n if (!self.ctx) {\n setupAudioContext();\n }\n\n if (typeof vol !== 'undefined' && vol >= 0 && vol <= 1) {\n self._volume = vol;\n\n // Don't update any of the nodes if we are muted.\n if (self._muted) {\n return self;\n }\n\n // When using Web Audio, we just need to adjust the master gain.\n if (self.usingWebAudio) {\n self.masterGain.gain.value = vol;\n }\n\n // Loop through and change volume for all HTML5 audio nodes.\n for (var i=0; i=0; i--) {\n self._howls[i].unload();\n }\n\n // Create a new AudioContext to make sure it is fully reset.\n if (self.usingWebAudio && self.ctx && typeof self.ctx.close !== 'undefined') {\n self.ctx.close();\n self.ctx = null;\n setupAudioContext();\n }\n\n return self;\n },\n\n /**\n * Check for codec support of specific extension.\n * @param {String} ext Audio file extention.\n * @return {Boolean}\n */\n codecs: function(ext) {\n return (this || Howler)._codecs[ext.replace(/^x-/, '')];\n },\n\n /**\n * Setup various state values for global tracking.\n * @return {Howler}\n */\n _setup: function() {\n var self = this || Howler;\n\n // Keeps track of the suspend/resume state of the AudioContext.\n self.state = self.ctx ? self.ctx.state || 'running' : 'running';\n\n // Automatically begin the 30-second suspend process\n self._autoSuspend();\n\n // Check if audio is available.\n if (!self.usingWebAudio) {\n // No audio is available on this system if noAudio is set to true.\n if (typeof Audio !== 'undefined') {\n try {\n var test = new Audio();\n\n // Check if the canplaythrough event is available.\n if (typeof test.oncanplaythrough === 'undefined') {\n self._canPlayEvent = 'canplay';\n }\n } catch(e) {\n self.noAudio = true;\n }\n } else {\n self.noAudio = true;\n }\n }\n\n // Test to make sure audio isn't disabled in Internet Explorer.\n try {\n var test = new Audio();\n if (test.muted) {\n self.noAudio = true;\n }\n } catch (e) {}\n\n // Check for supported codecs.\n if (!self.noAudio) {\n self._setupCodecs();\n }\n\n return self;\n },\n\n /**\n * Check for browser support for various codecs and cache the results.\n * @return {Howler}\n */\n _setupCodecs: function() {\n var self = this || Howler;\n var audioTest = null;\n\n // Must wrap in a try/catch because IE11 in server mode throws an error.\n try {\n audioTest = (typeof Audio !== 'undefined') ? new Audio() : null;\n } catch (err) {\n return self;\n }\n\n if (!audioTest || typeof audioTest.canPlayType !== 'function') {\n return self;\n }\n\n var mpegTest = audioTest.canPlayType('audio/mpeg;').replace(/^no$/, '');\n\n // Opera version <33 has mixed MP3 support, so we need to check for and block it.\n var checkOpera = self._navigator && self._navigator.userAgent.match(/OPR\\/([0-6].)/g);\n var isOldOpera = (checkOpera && parseInt(checkOpera[0].split('/')[1], 10) < 33);\n\n self._codecs = {\n mp3: !!(!isOldOpera && (mpegTest || audioTest.canPlayType('audio/mp3;').replace(/^no$/, ''))),\n mpeg: !!mpegTest,\n opus: !!audioTest.canPlayType('audio/ogg; codecs=\"opus\"').replace(/^no$/, ''),\n ogg: !!audioTest.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/^no$/, ''),\n oga: !!audioTest.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/^no$/, ''),\n wav: !!audioTest.canPlayType('audio/wav; codecs=\"1\"').replace(/^no$/, ''),\n aac: !!audioTest.canPlayType('audio/aac;').replace(/^no$/, ''),\n caf: !!audioTest.canPlayType('audio/x-caf;').replace(/^no$/, ''),\n m4a: !!(audioTest.canPlayType('audio/x-m4a;') || audioTest.canPlayType('audio/m4a;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''),\n mp4: !!(audioTest.canPlayType('audio/x-mp4;') || audioTest.canPlayType('audio/mp4;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''),\n weba: !!audioTest.canPlayType('audio/webm; codecs=\"vorbis\"').replace(/^no$/, ''),\n webm: !!audioTest.canPlayType('audio/webm; codecs=\"vorbis\"').replace(/^no$/, ''),\n dolby: !!audioTest.canPlayType('audio/mp4; codecs=\"ec-3\"').replace(/^no$/, ''),\n flac: !!(audioTest.canPlayType('audio/x-flac;') || audioTest.canPlayType('audio/flac;')).replace(/^no$/, '')\n };\n\n return self;\n },\n\n /**\n * Mobile browsers will only allow audio to be played after a user interaction.\n * Attempt to automatically unlock audio on the first user interaction.\n * Concept from: http://paulbakaus.com/tutorials/html5/web-audio-on-ios/\n * @return {Howler}\n */\n _enableMobileAudio: function() {\n var self = this || Howler;\n\n // Only run this on mobile devices if audio isn't already eanbled.\n var isMobile = /iPhone|iPad|iPod|Android|BlackBerry|BB10|Silk|Mobi/i.test(self._navigator && self._navigator.userAgent);\n var isTouch = !!(('ontouchend' in window) || (self._navigator && self._navigator.maxTouchPoints > 0) || (self._navigator && self._navigator.msMaxTouchPoints > 0));\n if (self._mobileEnabled || !self.ctx || (!isMobile && !isTouch)) {\n return;\n }\n\n self._mobileEnabled = false;\n\n // Some mobile devices/platforms have distortion issues when opening/closing tabs and/or web views.\n // Bugs in the browser (especially Mobile Safari) can cause the sampleRate to change from 44100 to 48000.\n // By calling Howler.unload(), we create a new AudioContext with the correct sampleRate.\n if (!self._mobileUnloaded && self.ctx.sampleRate !== 44100) {\n self._mobileUnloaded = true;\n self.unload();\n }\n\n // Scratch buffer for enabling iOS to dispose of web audio buffers correctly, as per:\n // http://stackoverflow.com/questions/24119684\n self._scratchBuffer = self.ctx.createBuffer(1, 1, 22050);\n\n // Call this method on touch start to create and play a buffer,\n // then check if the audio actually played to determine if\n // audio has now been unlocked on iOS, Android, etc.\n var unlock = function() {\n // Fix Android can not play in suspend state.\n Howler._autoResume();\n\n // Create an empty buffer.\n var source = self.ctx.createBufferSource();\n source.buffer = self._scratchBuffer;\n source.connect(self.ctx.destination);\n\n // Play the empty buffer.\n if (typeof source.start === 'undefined') {\n source.noteOn(0);\n } else {\n source.start(0);\n }\n\n // Calling resume() on a stack initiated by user gesture is what actually unlocks the audio on Android Chrome >= 55.\n if (typeof self.ctx.resume === 'function') {\n self.ctx.resume();\n }\n\n // Setup a timeout to check that we are unlocked on the next event loop.\n source.onended = function() {\n source.disconnect(0);\n\n // Update the unlocked state and prevent this check from happening again.\n self._mobileEnabled = true;\n self.mobileAutoEnable = false;\n\n // Remove the touch start listener.\n document.removeEventListener('touchend', unlock, true);\n };\n };\n\n // Setup a touch start listener to attempt an unlock in.\n document.addEventListener('touchend', unlock, true);\n\n return self;\n },\n\n /**\n * Automatically suspend the Web Audio AudioContext after no sound has played for 30 seconds.\n * This saves processing/energy and fixes various browser-specific bugs with audio getting stuck.\n * @return {Howler}\n */\n _autoSuspend: function() {\n var self = this;\n\n if (!self.autoSuspend || !self.ctx || typeof self.ctx.suspend === 'undefined' || !Howler.usingWebAudio) {\n return;\n }\n\n // Check if any sounds are playing.\n for (var i=0; i 0 ? sound._seek : self._sprite[sprite][0] / 1000);\n var duration = Math.max(0, ((self._sprite[sprite][0] + self._sprite[sprite][1]) / 1000) - seek);\n var timeout = (duration * 1000) / Math.abs(sound._rate);\n\n // Update the parameters of the sound\n sound._paused = false;\n sound._ended = false;\n sound._sprite = sprite;\n sound._seek = seek;\n sound._start = self._sprite[sprite][0] / 1000;\n sound._stop = (self._sprite[sprite][0] + self._sprite[sprite][1]) / 1000;\n sound._loop = !!(sound._loop || self._sprite[sprite][2]);\n\n // Begin the actual playback.\n var node = sound._node;\n if (self._webAudio) {\n // Fire this when the sound is ready to play to begin Web Audio playback.\n var playWebAudio = function() {\n self._refreshBuffer(sound);\n\n // Setup the playback params.\n var vol = (sound._muted || self._muted) ? 0 : sound._volume;\n node.gain.setValueAtTime(vol, Howler.ctx.currentTime);\n sound._playStart = Howler.ctx.currentTime;\n\n // Play the sound using the supported method.\n if (typeof node.bufferSource.start === 'undefined') {\n sound._loop ? node.bufferSource.noteGrainOn(0, seek, 86400) : node.bufferSource.noteGrainOn(0, seek, duration);\n } else {\n sound._loop ? node.bufferSource.start(0, seek, 86400) : node.bufferSource.start(0, seek, duration);\n }\n\n // Start a new timer if none is present.\n if (timeout !== Infinity) {\n self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);\n }\n\n if (!internal) {\n setTimeout(function() {\n self._emit('play', sound._id);\n }, 0);\n }\n };\n\n var isRunning = (Howler.state === 'running');\n if (self._state === 'loaded' && isRunning) {\n playWebAudio();\n } else {\n // Wait for the audio to load and then begin playback.\n var event = !isRunning && self._state === 'loaded' ? 'resume' : 'load';\n self.once(event, playWebAudio, isRunning ? sound._id : null);\n\n // Cancel the end timer.\n self._clearTimer(sound._id);\n }\n } else {\n // Fire this when the sound is ready to play to begin HTML5 Audio playback.\n var playHtml5 = function() {\n node.currentTime = seek;\n node.muted = sound._muted || self._muted || Howler._muted || node.muted;\n node.volume = sound._volume * Howler.volume();\n node.playbackRate = sound._rate;\n node.play();\n\n // Setup the new end timer.\n if (timeout !== Infinity) {\n self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);\n }\n\n if (!internal) {\n self._emit('play', sound._id);\n }\n };\n\n // Play immediately if ready, or wait for the 'canplaythrough'e vent.\n var loadedNoReadyState = (self._state === 'loaded' && (window && window.ejecta || !node.readyState && Howler._navigator.isCocoonJS));\n if (node.readyState === 4 || loadedNoReadyState) {\n playHtml5();\n } else {\n var listener = function() {\n // Begin playback.\n playHtml5();\n\n // Clear this listener.\n node.removeEventListener(Howler._canPlayEvent, listener, false);\n };\n node.addEventListener(Howler._canPlayEvent, listener, false);\n\n // Cancel the end timer.\n self._clearTimer(sound._id);\n }\n }\n\n return sound._id;\n },\n\n /**\n * Pause playback and save current position.\n * @param {Number} id The sound ID (empty to pause all in group).\n * @return {Howl}\n */\n pause: function(id) {\n var self = this;\n\n // If the sound hasn't loaded, add it to the load queue to pause when capable.\n if (self._state !== 'loaded') {\n self._queue.push({\n event: 'pause',\n action: function() {\n self.pause(id);\n }\n });\n\n return self;\n }\n\n // If no id is passed, get all ID's to be paused.\n var ids = self._getSoundIds(id);\n\n for (var i=0; i Returns the group's volume value.\n * volume(id) -> Returns the sound id's current volume.\n * volume(vol) -> Sets the volume of all sounds in this Howl group.\n * volume(vol, id) -> Sets the volume of passed sound id.\n * @return {Howl/Number} Returns self or current volume.\n */\n volume: function() {\n var self = this;\n var args = arguments;\n var vol, id;\n\n // Determine the values based on arguments.\n if (args.length === 0) {\n // Return the value of the groups' volume.\n return self._volume;\n } else if (args.length === 1 || args.length === 2 && typeof args[1] === 'undefined') {\n // First check if this is an ID, and if not, assume it is a new volume.\n var ids = self._getSoundIds();\n var index = ids.indexOf(args[0]);\n if (index >= 0) {\n id = parseInt(args[0], 10);\n } else {\n vol = parseFloat(args[0]);\n }\n } else if (args.length >= 2) {\n vol = parseFloat(args[0]);\n id = parseInt(args[1], 10);\n }\n\n // Update the volume or return the current volume.\n var sound;\n if (typeof vol !== 'undefined' && vol >= 0 && vol <= 1) {\n // If the sound hasn't loaded, add it to the load queue to change volume when capable.\n if (self._state !== 'loaded') {\n self._queue.push({\n event: 'volume',\n action: function() {\n self.volume.apply(self, args);\n }\n });\n\n return self;\n }\n\n // Set the group volume.\n if (typeof id === 'undefined') {\n self._volume = vol;\n }\n\n // Update one or all volumes.\n id = self._getSoundIds(id);\n for (var i=0; i to ? 'out' : 'in';\n var steps = diff / 0.01;\n var stepLen = (steps > 0) ? len / steps : len;\n\n // Since browsers clamp timeouts to 4ms, we need to clamp our steps to that too.\n if (stepLen < 4) {\n steps = Math.ceil(steps / (4 / stepLen));\n stepLen = 4;\n }\n\n // If the sound hasn't loaded, add it to the load queue to fade when capable.\n if (self._state !== 'loaded') {\n self._queue.push({\n event: 'fade',\n action: function() {\n self.fade(from, to, len, id);\n }\n });\n\n return self;\n }\n\n // Set the volume to the start position.\n self.volume(from, id);\n\n // Fade the volume of one or all sounds.\n var ids = self._getSoundIds(id);\n for (var i=0; i 0) {\n vol += (dir === 'in' ? 0.01 : -0.01);\n }\n\n // Make sure the volume is in the right bounds.\n vol = Math.max(0, vol);\n vol = Math.min(1, vol);\n\n // Round to within 2 decimal points.\n vol = Math.round(vol * 100) / 100;\n\n // Change the volume.\n if (self._webAudio) {\n if (typeof id === 'undefined') {\n self._volume = vol;\n }\n\n sound._volume = vol;\n } else {\n self.volume(vol, soundId, true);\n }\n\n // When the fade is complete, stop it and fire event.\n if ((to < from && vol <= to) || (to > from && vol >= to)) {\n clearInterval(sound._interval);\n sound._interval = null;\n self.volume(to, soundId);\n self._emit('fade', soundId);\n }\n }.bind(self, ids[i], sound), stepLen);\n }\n }\n\n return self;\n },\n\n /**\n * Internal method that stops the currently playing fade when\n * a new fade starts, volume is changed or the sound is stopped.\n * @param {Number} id The sound id.\n * @return {Howl}\n */\n _stopFade: function(id) {\n var self = this;\n var sound = self._soundById(id);\n\n if (sound && sound._interval) {\n if (self._webAudio) {\n sound._node.gain.cancelScheduledValues(Howler.ctx.currentTime);\n }\n\n clearInterval(sound._interval);\n sound._interval = null;\n self._emit('fade', id);\n }\n\n return self;\n },\n\n /**\n * Get/set the loop parameter on a sound. This method can optionally take 0, 1 or 2 arguments.\n * loop() -> Returns the group's loop value.\n * loop(id) -> Returns the sound id's loop value.\n * loop(loop) -> Sets the loop value for all sounds in this Howl group.\n * loop(loop, id) -> Sets the loop value of passed sound id.\n * @return {Howl/Boolean} Returns self or current loop value.\n */\n loop: function() {\n var self = this;\n var args = arguments;\n var loop, id, sound;\n\n // Determine the values for loop and id.\n if (args.length === 0) {\n // Return the grou's loop value.\n return self._loop;\n } else if (args.length === 1) {\n if (typeof args[0] === 'boolean') {\n loop = args[0];\n self._loop = loop;\n } else {\n // Return this sound's loop value.\n sound = self._soundById(parseInt(args[0], 10));\n return sound ? sound._loop : false;\n }\n } else if (args.length === 2) {\n loop = args[0];\n id = parseInt(args[1], 10);\n }\n\n // If no id is passed, get all ID's to be looped.\n var ids = self._getSoundIds(id);\n for (var i=0; i Returns the first sound node's current playback rate.\n * rate(id) -> Returns the sound id's current playback rate.\n * rate(rate) -> Sets the playback rate of all sounds in this Howl group.\n * rate(rate, id) -> Sets the playback rate of passed sound id.\n * @return {Howl/Number} Returns self or the current playback rate.\n */\n rate: function() {\n var self = this;\n var args = arguments;\n var rate, id;\n\n // Determine the values based on arguments.\n if (args.length === 0) {\n // We will simply return the current rate of the first node.\n id = self._sounds[0]._id;\n } else if (args.length === 1) {\n // First check if this is an ID, and if not, assume it is a new rate value.\n var ids = self._getSoundIds();\n var index = ids.indexOf(args[0]);\n if (index >= 0) {\n id = parseInt(args[0], 10);\n } else {\n rate = parseFloat(args[0]);\n }\n } else if (args.length === 2) {\n rate = parseFloat(args[0]);\n id = parseInt(args[1], 10);\n }\n\n // Update the playback rate or return the current value.\n var sound;\n if (typeof rate === 'number') {\n // If the sound hasn't loaded, add it to the load queue to change playback rate when capable.\n if (self._state !== 'loaded') {\n self._queue.push({\n event: 'rate',\n action: function() {\n self.rate.apply(self, args);\n }\n });\n\n return self;\n }\n\n // Set the group rate.\n if (typeof id === 'undefined') {\n self._rate = rate;\n }\n\n // Update one or all volumes.\n id = self._getSoundIds(id);\n for (var i=0; i Returns the first sound node's current seek position.\n * seek(id) -> Returns the sound id's current seek position.\n * seek(seek) -> Sets the seek position of the first sound node.\n * seek(seek, id) -> Sets the seek position of passed sound id.\n * @return {Howl/Number} Returns self or the current seek position.\n */\n seek: function() {\n var self = this;\n var args = arguments;\n var seek, id;\n\n // Determine the values based on arguments.\n if (args.length === 0) {\n // We will simply return the current position of the first node.\n id = self._sounds[0]._id;\n } else if (args.length === 1) {\n // First check if this is an ID, and if not, assume it is a new seek position.\n var ids = self._getSoundIds();\n var index = ids.indexOf(args[0]);\n if (index >= 0) {\n id = parseInt(args[0], 10);\n } else {\n id = self._sounds[0]._id;\n seek = parseFloat(args[0]);\n }\n } else if (args.length === 2) {\n seek = parseFloat(args[0]);\n id = parseInt(args[1], 10);\n }\n\n // If there is no ID, bail out.\n if (typeof id === 'undefined') {\n return self;\n }\n\n // If the sound hasn't loaded, add it to the load queue to seek when capable.\n if (self._state !== 'loaded') {\n self._queue.push({\n event: 'seek',\n action: function() {\n self.seek.apply(self, args);\n }\n });\n\n return self;\n }\n\n // Get the sound.\n var sound = self._soundById(id);\n\n if (sound) {\n if (typeof seek === 'number' && seek >= 0) {\n // Pause the sound and update position for restarting playback.\n var playing = self.playing(id);\n if (playing) {\n self.pause(id, true);\n }\n\n // Move the position of the track and cancel timer.\n sound._seek = seek;\n sound._ended = false;\n self._clearTimer(id);\n\n // Restart the playback if the sound was playing.\n if (playing) {\n self.play(id, true);\n }\n\n // Update the seek position for HTML5 Audio.\n if (!self._webAudio && sound._node) {\n sound._node.currentTime = seek;\n }\n\n self._emit('seek', id);\n } else {\n if (self._webAudio) {\n var realTime = self.playing(id) ? Howler.ctx.currentTime - sound._playStart : 0;\n var rateSeek = sound._rateSeek ? sound._rateSeek - sound._seek : 0;\n return sound._seek + (rateSeek + realTime * Math.abs(sound._rate));\n } else {\n return sound._node.currentTime;\n }\n }\n }\n\n return self;\n },\n\n /**\n * Check if a specific sound is currently playing or not (if id is provided), or check if at least one of the sounds in the group is playing or not.\n * @param {Number} id The sound id to check. If none is passed, the whole sound group is checked.\n * @return {Boolean} True if playing and false if not.\n */\n playing: function(id) {\n var self = this;\n\n // Check the passed sound ID (if any).\n if (typeof id === 'number') {\n var sound = self._soundById(id);\n return sound ? !sound._paused : false;\n }\n\n // Otherwise, loop through all sounds and check if any are playing.\n for (var i=0; i= 0) {\n Howler._howls.splice(index, 1);\n }\n }\n\n // Delete this sound from the cache (if no other Howl is using it).\n var remCache = true;\n for (i=0; i=0; i--) {\n if (!events[i].id || events[i].id === id || event === 'load') {\n setTimeout(function(fn) {\n fn.call(this, id, msg);\n }.bind(self, events[i].fn), 0);\n\n // If this event was setup with `once`, remove it.\n if (events[i].once) {\n self.off(event, events[i].fn, events[i].id);\n }\n }\n }\n\n return self;\n },\n\n /**\n * Queue of actions initiated before the sound has loaded.\n * These will be called in sequence, with the next only firing\n * after the previous has finished executing (even if async like play).\n * @return {Howl}\n */\n _loadQueue: function() {\n var self = this;\n\n if (self._queue.length > 0) {\n var task = self._queue[0];\n\n // don't move onto the next task until this one is done\n self.once(task.event, function() {\n self._queue.shift();\n self._loadQueue();\n });\n\n task.action();\n }\n\n return self;\n },\n\n /**\n * Fired when playback ends at the end of the duration.\n * @param {Sound} sound The sound object to work with.\n * @return {Howl}\n */\n _ended: function(sound) {\n var self = this;\n var sprite = sound._sprite;\n\n // If we are using IE and there was network latency we may be clipping\n // audio before it completes playing. Lets check the node to make sure it\n // believes it has completed, before ending the playback.\n if (!self._webAudio && self._node && !self._node.ended) {\n setTimeout(self._ended.bind(self, sound), 100);\n return self;\n }\n\n // Should this sound loop?\n var loop = !!(sound._loop || self._sprite[sprite][2]);\n\n // Fire the ended event.\n self._emit('end', sound._id);\n\n // Restart the playback for HTML5 Audio loop.\n if (!self._webAudio && loop) {\n self.stop(sound._id, true).play(sound._id);\n }\n\n // Restart this timer if on a Web Audio loop.\n if (self._webAudio && loop) {\n self._emit('play', sound._id);\n sound._seek = sound._start || 0;\n sound._rateSeek = 0;\n sound._playStart = Howler.ctx.currentTime;\n\n var timeout = ((sound._stop - sound._start) * 1000) / Math.abs(sound._rate);\n self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);\n }\n\n // Mark the node as paused.\n if (self._webAudio && !loop) {\n sound._paused = true;\n sound._ended = true;\n sound._seek = sound._start || 0;\n sound._rateSeek = 0;\n self._clearTimer(sound._id);\n\n // Clean up the buffer source.\n self._cleanBuffer(sound._node);\n\n // Attempt to auto-suspend AudioContext if no sounds are still playing.\n Howler._autoSuspend();\n }\n\n // When using a sprite, end the track.\n if (!self._webAudio && !loop) {\n self.stop(sound._id);\n }\n\n return self;\n },\n\n /**\n * Clear the end timer for a sound playback.\n * @param {Number} id The sound ID.\n * @return {Howl}\n */\n _clearTimer: function(id) {\n var self = this;\n\n if (self._endTimers[id]) {\n clearTimeout(self._endTimers[id]);\n delete self._endTimers[id];\n }\n\n return self;\n },\n\n /**\n * Return the sound identified by this ID, or return null.\n * @param {Number} id Sound ID\n * @return {Object} Sound object or null.\n */\n _soundById: function(id) {\n var self = this;\n\n // Loop through all sounds and find the one with this ID.\n for (var i=0; i=0; i--) {\n if (cnt <= limit) {\n return;\n }\n\n if (self._sounds[i]._ended) {\n // Disconnect the audio source when using Web Audio.\n if (self._webAudio && self._sounds[i]._node) {\n self._sounds[i]._node.disconnect(0);\n }\n\n // Remove sounds until we have the pool size.\n self._sounds.splice(i, 1);\n cnt--;\n }\n }\n },\n\n /**\n * Get all ID's from the sounds pool.\n * @param {Number} id Only return one ID if one is passed.\n * @return {Array} Array of IDs.\n */\n _getSoundIds: function(id) {\n var self = this;\n\n if (typeof id === 'undefined') {\n var ids = [];\n for (var i=0; i 0) {\n cache[self._src] = buffer;\n loadSound(self, buffer);\n }\n }, function() {\n self._emit('loaderror', null, 'Decoding audio data failed.');\n });\n };\n\n /**\n * Sound is now loaded, so finish setting everything up and fire the loaded event.\n * @param {Howl} self\n * @param {Object} buffer The decoded buffer sound source.\n */\n var loadSound = function(self, buffer) {\n // Set the duration.\n if (buffer && !self._duration) {\n self._duration = buffer.duration;\n }\n\n // Setup a sprite if none is defined.\n if (Object.keys(self._sprite).length === 0) {\n self._sprite = {__default: [0, self._duration * 1000]};\n }\n\n // Fire the loaded event.\n if (self._state !== 'loaded') {\n self._state = 'loaded';\n self._emit('load');\n self._loadQueue();\n }\n };\n\n /**\n * Setup the audio context when available, or switch to HTML5 Audio mode.\n */\n var setupAudioContext = function() {\n // Check if we are using Web Audio and setup the AudioContext if we are.\n try {\n if (typeof AudioContext !== 'undefined') {\n Howler.ctx = new AudioContext();\n } else if (typeof webkitAudioContext !== 'undefined') {\n Howler.ctx = new webkitAudioContext();\n } else {\n Howler.usingWebAudio = false;\n }\n } catch(e) {\n Howler.usingWebAudio = false;\n }\n\n // Check if a webview is being used on iOS8 or earlier (rather than the browser).\n // If it is, disable Web Audio as it causes crashing.\n var iOS = (/iP(hone|od|ad)/.test(Howler._navigator && Howler._navigator.platform));\n var appVersion = Howler._navigator && Howler._navigator.appVersion.match(/OS (\\d+)_(\\d+)_?(\\d+)?/);\n var version = appVersion ? parseInt(appVersion[1], 10) : null;\n if (iOS && version && version < 9) {\n var safari = /safari/.test(Howler._navigator && Howler._navigator.userAgent.toLowerCase());\n if (Howler._navigator && Howler._navigator.standalone && !safari || Howler._navigator && !Howler._navigator.standalone && !safari) {\n Howler.usingWebAudio = false;\n }\n }\n\n // Create and expose the master GainNode when using Web Audio (useful for plugins or advanced usage).\n if (Howler.usingWebAudio) {\n Howler.masterGain = (typeof Howler.ctx.createGain === 'undefined') ? Howler.ctx.createGainNode() : Howler.ctx.createGain();\n Howler.masterGain.gain.value = Howler._muted ? 0 : 1;\n Howler.masterGain.connect(Howler.ctx.destination);\n }\n\n // Re-run the setup on Howler.\n Howler._setup();\n };\n\n // Add support for AMD (Asynchronous Module Definition) libraries such as require.js.\n if (typeof define === 'function' && define.amd) {\n define([], function() {\n return {\n Howler: Howler,\n Howl: Howl\n };\n });\n }\n\n // Add support for CommonJS libraries such as browserify.\n if (typeof exports !== 'undefined') {\n exports.Howler = Howler;\n exports.Howl = Howl;\n }\n\n // Define globally in case AMD is not available or unused.\n if (typeof window !== 'undefined') {\n window.HowlerGlobal = HowlerGlobal;\n window.Howler = Howler;\n window.Howl = Howl;\n window.Sound = Sound;\n } else if (typeof global !== 'undefined') { // Add to global in Node.js (for testing, etc).\n global.HowlerGlobal = HowlerGlobal;\n global.Howler = Howler;\n global.Howl = Howl;\n global.Sound = Sound;\n }\n})();\n\n\n/*!\n * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.\n * \n * howler.js v2.0.4\n * howlerjs.com\n *\n * (c) 2013-2017, James Simpson of GoldFire Studios\n * goldfirestudios.com\n *\n * MIT License\n */\n\n(function() {\n\n 'use strict';\n\n // Setup default properties.\n HowlerGlobal.prototype._pos = [0, 0, 0];\n HowlerGlobal.prototype._orientation = [0, 0, -1, 0, 1, 0];\n \n /** Global Methods **/\n /***************************************************************************/\n\n /**\n * Helper method to update the stereo panning position of all current Howls.\n * Future Howls will not use this value unless explicitly set.\n * @param {Number} pan A value of -1.0 is all the way left and 1.0 is all the way right.\n * @return {Howler/Number} Self or current stereo panning value.\n */\n HowlerGlobal.prototype.stereo = function(pan) {\n var self = this;\n\n // Stop right here if not using Web Audio.\n if (!self.ctx || !self.ctx.listener) {\n return self;\n }\n\n // Loop through all Howls and update their stereo panning.\n for (var i=self._howls.length-1; i>=0; i--) {\n self._howls[i].stereo(pan);\n }\n\n return self;\n };\n\n /**\n * Get/set the position of the listener in 3D cartesian space. Sounds using\n * 3D position will be relative to the listener's position.\n * @param {Number} x The x-position of the listener.\n * @param {Number} y The y-position of the listener.\n * @param {Number} z The z-position of the listener.\n * @return {Howler/Array} Self or current listener position.\n */\n HowlerGlobal.prototype.pos = function(x, y, z) {\n var self = this;\n\n // Stop right here if not using Web Audio.\n if (!self.ctx || !self.ctx.listener) {\n return self;\n }\n\n // Set the defaults for optional 'y' & 'z'.\n y = (typeof y !== 'number') ? self._pos[1] : y;\n z = (typeof z !== 'number') ? self._pos[2] : z;\n\n if (typeof x === 'number') {\n self._pos = [x, y, z];\n self.ctx.listener.setPosition(self._pos[0], self._pos[1], self._pos[2]);\n } else {\n return self._pos;\n }\n\n return self;\n };\n\n /**\n * Get/set the direction the listener is pointing in the 3D cartesian space.\n * A front and up vector must be provided. The front is the direction the\n * face of the listener is pointing, and up is the direction the top of the\n * listener is pointing. Thus, these values are expected to be at right angles\n * from each other.\n * @param {Number} x The x-orientation of the listener.\n * @param {Number} y The y-orientation of the listener.\n * @param {Number} z The z-orientation of the listener.\n * @param {Number} xUp The x-orientation of the top of the listener.\n * @param {Number} yUp The y-orientation of the top of the listener.\n * @param {Number} zUp The z-orientation of the top of the listener.\n * @return {Howler/Array} Returns self or the current orientation vectors.\n */\n HowlerGlobal.prototype.orientation = function(x, y, z, xUp, yUp, zUp) {\n var self = this;\n\n // Stop right here if not using Web Audio.\n if (!self.ctx || !self.ctx.listener) {\n return self;\n }\n\n // Set the defaults for optional 'y' & 'z'.\n var or = self._orientation;\n y = (typeof y !== 'number') ? or[1] : y;\n z = (typeof z !== 'number') ? or[2] : z;\n xUp = (typeof xUp !== 'number') ? or[3] : xUp;\n yUp = (typeof yUp !== 'number') ? or[4] : yUp;\n zUp = (typeof zUp !== 'number') ? or[5] : zUp;\n\n if (typeof x === 'number') {\n self._orientation = [x, y, z, xUp, yUp, zUp];\n self.ctx.listener.setOrientation(x, y, z, xUp, yUp, zUp);\n } else {\n return or;\n }\n\n return self;\n };\n\n /** Group Methods **/\n /***************************************************************************/\n\n /**\n * Add new properties to the core init.\n * @param {Function} _super Core init method.\n * @return {Howl}\n */\n Howl.prototype.init = (function(_super) {\n return function(o) {\n var self = this;\n\n // Setup user-defined default properties.\n self._orientation = o.orientation || [1, 0, 0];\n self._stereo = o.stereo || null;\n self._pos = o.pos || null;\n self._pannerAttr = {\n coneInnerAngle: typeof o.coneInnerAngle !== 'undefined' ? o.coneInnerAngle : 360,\n coneOuterAngle: typeof o.coneOuterAngle !== 'undefined' ? o.coneOuterAngle : 360,\n coneOuterGain: typeof o.coneOuterGain !== 'undefined' ? o.coneOuterGain : 0,\n distanceModel: typeof o.distanceModel !== 'undefined' ? o.distanceModel : 'inverse',\n maxDistance: typeof o.maxDistance !== 'undefined' ? o.maxDistance : 10000,\n panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : 'HRTF',\n refDistance: typeof o.refDistance !== 'undefined' ? o.refDistance : 1,\n rolloffFactor: typeof o.rolloffFactor !== 'undefined' ? o.rolloffFactor : 1\n };\n\n // Setup event listeners.\n self._onstereo = o.onstereo ? [{fn: o.onstereo}] : [];\n self._onpos = o.onpos ? [{fn: o.onpos}] : [];\n self._onorientation = o.onorientation ? [{fn: o.onorientation}] : [];\n\n // Complete initilization with howler.js core's init function.\n return _super.call(this, o);\n };\n })(Howl.prototype.init);\n\n /**\n * Get/set the stereo panning of the audio source for this sound or all in the group.\n * @param {Number} pan A value of -1.0 is all the way left and 1.0 is all the way right.\n * @param {Number} id (optional) The sound ID. If none is passed, all in group will be updated.\n * @return {Howl/Number} Returns self or the current stereo panning value.\n */\n Howl.prototype.stereo = function(pan, id) {\n var self = this;\n\n // Stop right here if not using Web Audio.\n if (!self._webAudio) {\n return self;\n }\n\n // If the sound hasn't loaded, add it to the load queue to change stereo pan when capable.\n if (self._state !== 'loaded') {\n self._queue.push({\n event: 'stereo',\n action: function() {\n self.stereo(pan, id);\n }\n });\n\n return self;\n }\n\n // Check for PannerStereoNode support and fallback to PannerNode if it doesn't exist.\n var pannerType = (typeof Howler.ctx.createStereoPanner === 'undefined') ? 'spatial' : 'stereo';\n\n // Setup the group's stereo panning if no ID is passed.\n if (typeof id === 'undefined') {\n // Return the group's stereo panning if no parameters are passed.\n if (typeof pan === 'number') {\n self._stereo = pan;\n self._pos = [pan, 0, 0];\n } else {\n return self._stereo;\n }\n }\n\n // Change the streo panning of one or all sounds in group.\n var ids = self._getSoundIds(id);\n for (var i=0; i Returns the group's values.\n * pannerAttr(id) -> Returns the sound id's values.\n * pannerAttr(o) -> Set's the values of all sounds in this Howl group.\n * pannerAttr(o, id) -> Set's the values of passed sound id.\n *\n * Attributes:\n * coneInnerAngle - (360 by default) There will be no volume reduction inside this angle.\n * coneOuterAngle - (360 by default) The volume will be reduced to a constant value of\n * `coneOuterGain` outside this angle.\n * coneOuterGain - (0 by default) The amount of volume reduction outside of `coneOuterAngle`.\n * distanceModel - ('inverse' by default) Determines algorithm to use to reduce volume as audio moves\n * away from listener. Can be `linear`, `inverse` or `exponential`.\n * maxDistance - (10000 by default) Volume won't reduce between source/listener beyond this distance.\n * panningModel - ('HRTF' by default) Determines which spatialization algorithm is used to position audio.\n * Can be `HRTF` or `equalpower`.\n * refDistance - (1 by default) A reference distance for reducing volume as the source\n * moves away from the listener.\n * rolloffFactor - (1 by default) How quickly the volume reduces as source moves from listener.\n * \n * @return {Howl/Object} Returns self or current panner attributes.\n */\n Howl.prototype.pannerAttr = function() {\n var self = this;\n var args = arguments;\n var o, id, sound;\n\n // Stop right here if not using Web Audio.\n if (!self._webAudio) {\n return self;\n }\n\n // Determine the values based on arguments.\n if (args.length === 0) {\n // Return the group's panner attribute values.\n return self._pannerAttr;\n } else if (args.length === 1) {\n if (typeof args[0] === 'object') {\n o = args[0];\n\n // Set the grou's panner attribute values.\n if (typeof id === 'undefined') {\n self._pannerAttr = {\n coneInnerAngle: typeof o.coneInnerAngle !== 'undefined' ? o.coneInnerAngle : self._coneInnerAngle,\n coneOuterAngle: typeof o.coneOuterAngle !== 'undefined' ? o.coneOuterAngle : self._coneOuterAngle,\n coneOuterGain: typeof o.coneOuterGain !== 'undefined' ? o.coneOuterGain : self._coneOuterGain,\n distanceModel: typeof o.distanceModel !== 'undefined' ? o.distanceModel : self._distanceModel,\n maxDistance: typeof o.maxDistance !== 'undefined' ? o.maxDistance : self._maxDistance,\n panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : self._panningModel,\n refDistance: typeof o.refDistance !== 'undefined' ? o.refDistance : self._refDistance,\n rolloffFactor: typeof o.rolloffFactor !== 'undefined' ? o.rolloffFactor : self._rolloffFactor\n };\n }\n } else {\n // Return this sound's panner attribute values.\n sound = self._soundById(parseInt(args[0], 10));\n return sound ? sound._pannerAttr : self._pannerAttr;\n }\n } else if (args.length === 2) {\n o = args[0];\n id = parseInt(args[1], 10);\n }\n\n // Update the values of the specified sounds.\n var ids = self._getSoundIds(id);\n for (var i=0; i -1;\n}\n\nmodule.exports = arrayIncludes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayIncludes.js\n// module id = 291\n// module chunks = 0","/**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduceRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayReduceRight.js\n// module id = 292\n// module chunks = 0","var baseClamp = require('./_baseClamp'),\n copyArray = require('./_copyArray'),\n shuffleSelf = require('./_shuffleSelf');\n\n/**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n}\n\nmodule.exports = arraySampleSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arraySampleSize.js\n// module id = 293\n// module chunks = 0","var copyArray = require('./_copyArray'),\n shuffleSelf = require('./_shuffleSelf');\n\n/**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n}\n\nmodule.exports = arrayShuffle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayShuffle.js\n// module id = 294\n// module chunks = 0","var baseProperty = require('./_baseProperty');\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nmodule.exports = asciiSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_asciiSize.js\n// module id = 295\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseAggregator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAggregator.js\n// module id = 296\n// module chunks = 0","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAssignIn.js\n// module id = 297\n// module chunks = 0","var get = require('./get');\n\n/**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\nfunction baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n}\n\nmodule.exports = baseAt;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAt.js\n// module id = 298\n// module chunks = 0","var baseConformsTo = require('./_baseConformsTo'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n}\n\nmodule.exports = baseConforms;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseConforms.js\n// module id = 299\n// module chunks = 0","/**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\nfunction baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = baseConformsTo;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseConformsTo.js\n// module id = 300\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\nfunction baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n}\n\nmodule.exports = baseEvery;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseEvery.js\n// module id = 301\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseHas.js\n// module id = 302\n// module chunks = 0","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseHasIn.js\n// module id = 303\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\nfunction baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n}\n\nmodule.exports = baseInRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseInRange.js\n// module id = 304\n// module chunks = 0","var baseForOwn = require('./_baseForOwn');\n\n/**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n}\n\nmodule.exports = baseInverter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseInverter.js\n// module id = 305\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsArguments.js\n// module id = 306\n// module chunks = 0","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsEqualDeep.js\n// module id = 307\n// module chunks = 0","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsMatch.js\n// module id = 308\n// module chunks = 0","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsNaN.js\n// module id = 309\n// module chunks = 0","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsNative.js\n// module id = 310\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsTypedArray.js\n// module id = 311\n// module chunks = 0","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseKeysIn.js\n// module id = 312\n// module chunks = 0","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = object[key],\n srcValue = source[key],\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseMergeDeep.js\n// module id = 313\n// module chunks = 0","var isIndex = require('./_isIndex');\n\n/**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\nfunction baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n}\n\nmodule.exports = baseNth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseNth.js\n// module id = 314\n// module chunks = 0","var basePickBy = require('./_basePickBy'),\n hasIn = require('./hasIn');\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_basePick.js\n// module id = 315\n// module chunks = 0","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_basePropertyDeep.js\n// module id = 316\n// module chunks = 0","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseRange.js\n// module id = 317\n// module chunks = 0","var arraySample = require('./_arraySample'),\n values = require('./values');\n\n/**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\nfunction baseSample(collection) {\n return arraySample(values(collection));\n}\n\nmodule.exports = baseSample;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSample.js\n// module id = 318\n// module chunks = 0","var baseClamp = require('./_baseClamp'),\n shuffleSelf = require('./_shuffleSelf'),\n values = require('./values');\n\n/**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\nfunction baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n}\n\nmodule.exports = baseSampleSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSampleSize.js\n// module id = 319\n// module chunks = 0","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSetToString.js\n// module id = 320\n// module chunks = 0","var shuffleSelf = require('./_shuffleSelf'),\n values = require('./values');\n\n/**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\nfunction baseShuffle(collection) {\n return shuffleSelf(values(collection));\n}\n\nmodule.exports = baseShuffle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseShuffle.js\n// module id = 321\n// module chunks = 0","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n}\n\nmodule.exports = baseSome;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSome.js\n// module id = 322\n// module chunks = 0","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSortBy.js\n// module id = 323\n// module chunks = 0","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\nfunction baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n}\n\nmodule.exports = baseToPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseToPairs.js\n// module id = 324\n// module chunks = 0","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseToString.js\n// module id = 325\n// module chunks = 0","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cacheHas.js\n// module id = 326\n// module chunks = 0","var baseRest = require('./_baseRest');\n\n/**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nvar castRest = baseRest;\n\nmodule.exports = castRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_castRest.js\n// module id = 327\n// module chunks = 0","var baseSlice = require('./_baseSlice');\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nmodule.exports = castSlice;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_castSlice.js\n// module id = 328\n// module chunks = 0","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneDataView.js\n// module id = 329\n// module chunks = 0","var addMapEntry = require('./_addMapEntry'),\n arrayReduce = require('./_arrayReduce'),\n mapToArray = require('./_mapToArray');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\nmodule.exports = cloneMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneMap.js\n// module id = 330\n// module chunks = 0","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneRegExp.js\n// module id = 331\n// module chunks = 0","var addSetEntry = require('./_addSetEntry'),\n arrayReduce = require('./_arrayReduce'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\nmodule.exports = cloneSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneSet.js\n// module id = 332\n// module chunks = 0","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_cloneSymbol.js\n// module id = 333\n// module chunks = 0","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_compareAscending.js\n// module id = 334\n// module chunks = 0","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_compareMultiple.js\n// module id = 335\n// module chunks = 0","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_copySymbols.js\n// module id = 336\n// module chunks = 0","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_copySymbolsIn.js\n// module id = 337\n// module chunks = 0","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_coreJsData.js\n// module id = 338\n// module chunks = 0","/**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\nfunction countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n}\n\nmodule.exports = countHolders;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_countHolders.js\n// module id = 339\n// module chunks = 0","var createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n}\n\nmodule.exports = createBind;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createBind.js\n// module id = 340\n// module chunks = 0","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n createHybrid = require('./_createHybrid'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createCurry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createCurry.js\n// module id = 341\n// module chunks = 0","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createPartial;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createPartial.js\n// module id = 342\n// module chunks = 0","var eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n}\n\nmodule.exports = customDefaultsAssignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_customDefaultsAssignIn.js\n// module id = 343\n// module chunks = 0","var baseMerge = require('./_baseMerge'),\n isObject = require('./isObject');\n\n/**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n}\n\nmodule.exports = customDefaultsMerge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_customDefaultsMerge.js\n// module id = 344\n// module chunks = 0","var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_customOmitClone.js\n// module id = 345\n// module chunks = 0","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_equalByTag.js\n// module id = 346\n// module chunks = 0","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_equalObjects.js\n// module id = 347\n// module chunks = 0","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getMatchData.js\n// module id = 348\n// module chunks = 0","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getRawTag.js\n// module id = 349\n// module chunks = 0","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getValue.js\n// module id = 350\n// module chunks = 0","/** Used to match wrap detail comments. */\nvar reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n/**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\nfunction getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n}\n\nmodule.exports = getWrapDetails;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getWrapDetails.js\n// module id = 351\n// module chunks = 0","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hasUnicode.js\n// module id = 352\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashClear.js\n// module id = 353\n// module chunks = 0","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashDelete.js\n// module id = 354\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashGet.js\n// module id = 355\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashHas.js\n// module id = 356\n// module chunks = 0","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_hashSet.js\n// module id = 357\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_initCloneArray.js\n// module id = 358\n// module chunks = 0","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneMap = require('./_cloneMap'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSet = require('./_cloneSet'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_initCloneByTag.js\n// module id = 359\n// module chunks = 0","/** Used to match wrap detail comments. */\nvar reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;\n\n/**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\nfunction insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n}\n\nmodule.exports = insertWrapDetails;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_insertWrapDetails.js\n// module id = 360\n// module chunks = 0","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isFlattenable.js\n// module id = 361\n// module chunks = 0","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isKeyable.js\n// module id = 362\n// module chunks = 0","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isMasked.js\n// module id = 363\n// module chunks = 0","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheClear.js\n// module id = 364\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheDelete.js\n// module id = 365\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheGet.js\n// module id = 366\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheHas.js\n// module id = 367\n// module chunks = 0","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_listCacheSet.js\n// module id = 368\n// module chunks = 0","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheClear.js\n// module id = 369\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheDelete.js\n// module id = 370\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheGet.js\n// module id = 371\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheHas.js\n// module id = 372\n// module chunks = 0","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mapCacheSet.js\n// module id = 373\n// module chunks = 0","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_memoizeCapped.js\n// module id = 374\n// module chunks = 0","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nmodule.exports = mergeData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_mergeData.js\n// module id = 375\n// module chunks = 0","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nativeKeys.js\n// module id = 376\n// module chunks = 0","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nativeKeysIn.js\n// module id = 377\n// module chunks = 0","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nodeUtil.js\n// module id = 378\n// module chunks = 0","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_objectToString.js\n// module id = 379\n// module chunks = 0","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nmodule.exports = realNames;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_realNames.js\n// module id = 380\n// module chunks = 0","var copyArray = require('./_copyArray'),\n isIndex = require('./_isIndex');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nmodule.exports = reorder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_reorder.js\n// module id = 381\n// module chunks = 0","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setCacheAdd.js\n// module id = 382\n// module chunks = 0","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setCacheHas.js\n// module id = 383\n// module chunks = 0","/**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\nfunction setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n}\n\nmodule.exports = setToPairs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setToPairs.js\n// module id = 384\n// module chunks = 0","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackClear.js\n// module id = 385\n// module chunks = 0","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackDelete.js\n// module id = 386\n// module chunks = 0","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackGet.js\n// module id = 387\n// module chunks = 0","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackHas.js\n// module id = 388\n// module chunks = 0","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stackSet.js\n// module id = 389\n// module chunks = 0","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_strictIndexOf.js\n// module id = 390\n// module chunks = 0","var asciiSize = require('./_asciiSize'),\n hasUnicode = require('./_hasUnicode'),\n unicodeSize = require('./_unicodeSize');\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nmodule.exports = stringSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_stringSize.js\n// module id = 391\n// module chunks = 0","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nmodule.exports = unicodeSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_unicodeSize.js\n// module id = 392\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n arrayIncludes = require('./_arrayIncludes');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n/** Used to associate wrap methods with their bit flags. */\nvar wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n];\n\n/**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\nfunction updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n}\n\nmodule.exports = updateWrapDetails;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_updateWrapDetails.js\n// module id = 393\n// module chunks = 0","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n copyArray = require('./_copyArray');\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n}\n\nmodule.exports = wrapperClone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_wrapperClone.js\n// module id = 394\n// module chunks = 0","var toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\nfunction after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n\nmodule.exports = after;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/after.js\n// module id = 395\n// module chunks = 0","var assignValue = require('./_assignValue'),\n copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n isArrayLike = require('./isArrayLike'),\n isPrototype = require('./_isPrototype'),\n keys = require('./keys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\nmodule.exports = assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assign.js\n// module id = 396\n// module chunks = 0","var copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keys = require('./keys');\n\n/**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n});\n\nmodule.exports = assignWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assignWith.js\n// module id = 397\n// module chunks = 0","var baseAt = require('./_baseAt'),\n flatRest = require('./_flatRest');\n\n/**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\nvar at = flatRest(baseAt);\n\nmodule.exports = at;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/at.js\n// module id = 398\n// module chunks = 0","var apply = require('./_apply'),\n baseRest = require('./_baseRest'),\n isError = require('./isError');\n\n/**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\nvar attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n});\n\nmodule.exports = attempt;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/attempt.js\n// module id = 399\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n baseAssignValue = require('./_baseAssignValue'),\n bind = require('./bind'),\n flatRest = require('./_flatRest'),\n toKey = require('./_toKey');\n\n/**\n * Binds methods of an object to the object itself, overwriting the existing\n * method.\n *\n * **Note:** This method doesn't set the \"length\" property of bound functions.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} methodNames The object method names to bind.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'click': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view, ['click']);\n * jQuery(element).on('click', view.click);\n * // => Logs 'clicked docs' when clicked.\n */\nvar bindAll = flatRest(function(object, methodNames) {\n arrayEach(methodNames, function(key) {\n key = toKey(key);\n baseAssignValue(object, key, bind(object[key], object));\n });\n return object;\n});\n\nmodule.exports = bindAll;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/bindAll.js\n// module id = 400\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_PARTIAL_FLAG = 32;\n\n/**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\nvar bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n});\n\n// Assign default placeholders.\nbindKey.placeholder = {};\n\nmodule.exports = bindKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/bindKey.js\n// module id = 401\n// module chunks = 0","var baseClamp = require('./_baseClamp'),\n toNumber = require('./toNumber');\n\n/**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\nfunction clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n}\n\nmodule.exports = clamp;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/clamp.js\n// module id = 402\n// module chunks = 0","var apply = require('./_apply'),\n arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseRest = require('./_baseRest');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that iterates over `pairs` and invokes the corresponding\n * function of the first predicate to return truthy. The predicate-function\n * pairs are invoked with the `this` binding and arguments of the created\n * function.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Array} pairs The predicate-function pairs.\n * @returns {Function} Returns the new composite function.\n * @example\n *\n * var func = _.cond([\n * [_.matches({ 'a': 1 }), _.constant('matches A')],\n * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n * [_.stubTrue, _.constant('no match')]\n * ]);\n *\n * func({ 'a': 1, 'b': 2 });\n * // => 'matches A'\n *\n * func({ 'a': 0, 'b': 1 });\n * // => 'matches B'\n *\n * func({ 'a': '1', 'b': '2' });\n * // => 'no match'\n */\nfunction cond(pairs) {\n var length = pairs == null ? 0 : pairs.length,\n toIteratee = baseIteratee;\n\n pairs = !length ? [] : arrayMap(pairs, function(pair) {\n if (typeof pair[1] != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return [toIteratee(pair[0]), pair[1]];\n });\n\n return baseRest(function(args) {\n var index = -1;\n while (++index < length) {\n var pair = pairs[index];\n if (apply(pair[0], this, args)) {\n return apply(pair[1], this, args);\n }\n }\n });\n}\n\nmodule.exports = cond;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/cond.js\n// module id = 403\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseConforms = require('./_baseConforms');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes the predicate properties of `source` with\n * the corresponding property values of a given object, returning `true` if\n * all predicates return truthy, else `false`.\n *\n * **Note:** The created function is equivalent to `_.conformsTo` with\n * `source` partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 2, 'b': 1 },\n * { 'a': 1, 'b': 2 }\n * ];\n *\n * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));\n * // => [{ 'a': 1, 'b': 2 }]\n */\nfunction conforms(source) {\n return baseConforms(baseClone(source, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = conforms;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/conforms.js\n// module id = 404\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\nvar countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n});\n\nmodule.exports = countBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/countBy.js\n// module id = 405\n// module chunks = 0","var baseAssign = require('./_baseAssign'),\n baseCreate = require('./_baseCreate');\n\n/**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\nfunction create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n}\n\nmodule.exports = create;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/create.js\n// module id = 406\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8;\n\n/**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\nfunction curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurry.placeholder = {};\n\nmodule.exports = curry;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/curry.js\n// module id = 407\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_RIGHT_FLAG = 16;\n\n/**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\nfunction curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n}\n\n// Assign default placeholders.\ncurryRight.placeholder = {};\n\nmodule.exports = curryRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/curryRight.js\n// module id = 408\n// module chunks = 0","/**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\nfunction defaultTo(value, defaultValue) {\n return (value == null || value !== value) ? defaultValue : value;\n}\n\nmodule.exports = defaultTo;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defaultTo.js\n// module id = 409\n// module chunks = 0","var apply = require('./_apply'),\n assignInWith = require('./assignInWith'),\n baseRest = require('./_baseRest'),\n customDefaultsAssignIn = require('./_customDefaultsAssignIn');\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(args) {\n args.push(undefined, customDefaultsAssignIn);\n return apply(assignInWith, undefined, args);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defaults.js\n// module id = 410\n// module chunks = 0","var apply = require('./_apply'),\n baseRest = require('./_baseRest'),\n customDefaultsMerge = require('./_customDefaultsMerge'),\n mergeWith = require('./mergeWith');\n\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\nvar defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n});\n\nmodule.exports = defaultsDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defaultsDeep.js\n// module id = 411\n// module chunks = 0","var baseDelay = require('./_baseDelay'),\n baseRest = require('./_baseRest');\n\n/**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\nvar defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n});\n\nmodule.exports = defer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/defer.js\n// module id = 412\n// module chunks = 0","var baseDelay = require('./_baseDelay'),\n baseRest = require('./_baseRest'),\n toNumber = require('./toNumber');\n\n/**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\nvar delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n});\n\nmodule.exports = delay;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/delay.js\n// module id = 413\n// module chunks = 0","module.exports = require('./forEach');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/each.js\n// module id = 414\n// module chunks = 0","module.exports = require('./forEachRight');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/eachRight.js\n// module id = 415\n// module chunks = 0","module.exports = require('./toPairs');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/entries.js\n// module id = 416\n// module chunks = 0","module.exports = require('./toPairsIn');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/entriesIn.js\n// module id = 417\n// module chunks = 0","var arrayEvery = require('./_arrayEvery'),\n baseEvery = require('./_baseEvery'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\nfunction every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = every;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/every.js\n// module id = 418\n// module chunks = 0","module.exports = require('./assignIn');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/extend.js\n// module id = 419\n// module chunks = 0","module.exports = require('./assignInWith');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/extendWith.js\n// module id = 420\n// module chunks = 0","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/filter.js\n// module id = 421\n// module chunks = 0","var createFind = require('./_createFind'),\n findIndex = require('./findIndex');\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nmodule.exports = find;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/find.js\n// module id = 422\n// module chunks = 0","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findIndex.js\n// module id = 423\n// module chunks = 0","var baseFindKey = require('./_baseFindKey'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\nfunction findKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);\n}\n\nmodule.exports = findKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findKey.js\n// module id = 424\n// module chunks = 0","var createFind = require('./_createFind'),\n findLastIndex = require('./findLastIndex');\n\n/**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\nvar findLast = createFind(findLastIndex);\n\nmodule.exports = findLast;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findLast.js\n// module id = 425\n// module chunks = 0","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\nfunction findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index, true);\n}\n\nmodule.exports = findLastIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findLastIndex.js\n// module id = 426\n// module chunks = 0","var baseFindKey = require('./_baseFindKey'),\n baseForOwnRight = require('./_baseForOwnRight'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\nfunction findLastKey(object, predicate) {\n return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);\n}\n\nmodule.exports = findLastKey;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/findLastKey.js\n// module id = 427\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n map = require('./map');\n\n/**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n}\n\nmodule.exports = flatMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatMap.js\n// module id = 428\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n map = require('./map');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\nfunction flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n}\n\nmodule.exports = flatMapDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatMapDeep.js\n// module id = 429\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n map = require('./map'),\n toInteger = require('./toInteger');\n\n/**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\nfunction flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n}\n\nmodule.exports = flatMapDepth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatMapDepth.js\n// module id = 430\n// module chunks = 0","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flatten.js\n// module id = 431\n// module chunks = 0","var createWrap = require('./_createWrap');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_FLIP_FLAG = 512;\n\n/**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\nfunction flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n}\n\nmodule.exports = flip;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flip.js\n// module id = 432\n// module chunks = 0","var createFlow = require('./_createFlow');\n\n/**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flow = createFlow();\n\nmodule.exports = flow;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flow.js\n// module id = 433\n// module chunks = 0","var createFlow = require('./_createFlow');\n\n/**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flowRight = createFlow(true);\n\nmodule.exports = flowRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/flowRight.js\n// module id = 434\n// module chunks = 0","var baseFor = require('./_baseFor'),\n castFunction = require('./_castFunction'),\n keysIn = require('./keysIn');\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forIn.js\n// module id = 435\n// module chunks = 0","var baseForRight = require('./_baseForRight'),\n castFunction = require('./_castFunction'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\nfunction forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forInRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forInRight.js\n// module id = 436\n// module chunks = 0","var baseForOwn = require('./_baseForOwn'),\n castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forOwn.js\n// module id = 437\n// module chunks = 0","var baseForOwnRight = require('./_baseForOwnRight'),\n castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\nfunction forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwnRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/forOwnRight.js\n// module id = 438\n// module chunks = 0","module.exports = {\n 'after': require('./after'),\n 'ary': require('./ary'),\n 'before': require('./before'),\n 'bind': require('./bind'),\n 'bindKey': require('./bindKey'),\n 'curry': require('./curry'),\n 'curryRight': require('./curryRight'),\n 'debounce': require('./debounce'),\n 'defer': require('./defer'),\n 'delay': require('./delay'),\n 'flip': require('./flip'),\n 'memoize': require('./memoize'),\n 'negate': require('./negate'),\n 'once': require('./once'),\n 'overArgs': require('./overArgs'),\n 'partial': require('./partial'),\n 'partialRight': require('./partialRight'),\n 'rearg': require('./rearg'),\n 'rest': require('./rest'),\n 'spread': require('./spread'),\n 'throttle': require('./throttle'),\n 'unary': require('./unary'),\n 'wrap': require('./wrap')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/function.js\n// module id = 439\n// module chunks = 0","var baseFunctions = require('./_baseFunctions'),\n keys = require('./keys');\n\n/**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\nfunction functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n}\n\nmodule.exports = functions;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/functions.js\n// module id = 440\n// module chunks = 0","var baseFunctions = require('./_baseFunctions'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\nfunction functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n}\n\nmodule.exports = functionsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/functionsIn.js\n// module id = 441\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nmodule.exports = groupBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/groupBy.js\n// module id = 442\n// module chunks = 0","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/has.js\n// module id = 443\n// module chunks = 0","var baseInRange = require('./_baseInRange'),\n toFinite = require('./toFinite'),\n toNumber = require('./toNumber');\n\n/**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\nfunction inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n}\n\nmodule.exports = inRange;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/inRange.js\n// module id = 444\n// module chunks = 0","var baseIndexOf = require('./_baseIndexOf'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n toInteger = require('./toInteger'),\n values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/includes.js\n// module id = 445\n// module chunks = 0","var constant = require('./constant'),\n createInverter = require('./_createInverter'),\n identity = require('./identity');\n\n/**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\nvar invert = createInverter(function(result, value, key) {\n result[value] = key;\n}, constant(identity));\n\nmodule.exports = invert;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invert.js\n// module id = 446\n// module chunks = 0","var baseIteratee = require('./_baseIteratee'),\n createInverter = require('./_createInverter');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\nvar invertBy = createInverter(function(result, value, key) {\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n}, baseIteratee);\n\nmodule.exports = invertBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invertBy.js\n// module id = 447\n// module chunks = 0","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\nvar invoke = baseRest(baseInvoke);\n\nmodule.exports = invoke;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invoke.js\n// module id = 448\n// module chunks = 0","var apply = require('./_apply'),\n baseEach = require('./_baseEach'),\n baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\nvar invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n});\n\nmodule.exports = invokeMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/invokeMap.js\n// module id = 449\n// module chunks = 0","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isArrayLikeObject.js\n// module id = 450\n// module chunks = 0","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike'),\n isPlainObject = require('./isPlainObject');\n\n/** `Object#toString` result references. */\nvar domExcTag = '[object DOMException]',\n errorTag = '[object Error]';\n\n/**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\nfunction isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n}\n\nmodule.exports = isError;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isError.js\n// module id = 451\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseIteratee = require('./_baseIteratee');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\nfunction iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = iteratee;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/iteratee.js\n// module id = 452\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\nvar keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n});\n\nmodule.exports = keyBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/keyBy.js\n// module id = 453\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\nfunction mapKeys(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n}\n\nmodule.exports = mapKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mapKeys.js\n// module id = 454\n// module chunks = 0","var baseAssignValue = require('./_baseAssignValue'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee');\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nmodule.exports = mapValues;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mapValues.js\n// module id = 455\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseMatches = require('./_baseMatches');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n */\nfunction matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = matches;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/matches.js\n// module id = 456\n// module chunks = 0","var baseClone = require('./_baseClone'),\n baseMatchesProperty = require('./_baseMatchesProperty');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1;\n\n/**\n * Creates a function that performs a partial deep comparison between the\n * value at `path` of a given object to `srcValue`, returning `true` if the\n * object value is equivalent, else `false`.\n *\n * **Note:** Partial comparisons will match empty array and empty object\n * `srcValue` values against any array or object value, respectively. See\n * `_.isEqual` for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.find(objects, _.matchesProperty('a', 4));\n * // => { 'a': 4, 'b': 5, 'c': 6 }\n */\nfunction matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));\n}\n\nmodule.exports = matchesProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/matchesProperty.js\n// module id = 457\n// module chunks = 0","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/merge.js\n// module id = 458\n// module chunks = 0","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * Creates a function that invokes the method at `path` of a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': _.constant(2) } },\n * { 'a': { 'b': _.constant(1) } }\n * ];\n *\n * _.map(objects, _.method('a.b'));\n * // => [2, 1]\n *\n * _.map(objects, _.method(['a', 'b']));\n * // => [2, 1]\n */\nvar method = baseRest(function(path, args) {\n return function(object) {\n return baseInvoke(object, path, args);\n };\n});\n\nmodule.exports = method;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/method.js\n// module id = 459\n// module chunks = 0","var baseInvoke = require('./_baseInvoke'),\n baseRest = require('./_baseRest');\n\n/**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path of `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\nvar methodOf = baseRest(function(object, args) {\n return function(path) {\n return baseInvoke(object, path, args);\n };\n});\n\nmodule.exports = methodOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/methodOf.js\n// module id = 460\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n arrayPush = require('./_arrayPush'),\n baseFunctions = require('./_baseFunctions'),\n copyArray = require('./_copyArray'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n keys = require('./keys');\n\n/**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\nfunction mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n}\n\nmodule.exports = mixin;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/mixin.js\n// module id = 461\n// module chunks = 0","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/now.js\n// module id = 462\n// module chunks = 0","var baseNth = require('./_baseNth'),\n baseRest = require('./_baseRest'),\n toInteger = require('./toInteger');\n\n/**\n * Creates a function that gets the argument at index `n`. If `n` is negative,\n * the nth argument from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [n=0] The index of the argument to return.\n * @returns {Function} Returns the new pass-thru function.\n * @example\n *\n * var func = _.nthArg(1);\n * func('a', 'b', 'c', 'd');\n * // => 'b'\n *\n * var func = _.nthArg(-2);\n * func('a', 'b', 'c', 'd');\n * // => 'c'\n */\nfunction nthArg(n) {\n n = toInteger(n);\n return baseRest(function(args) {\n return baseNth(args, n);\n });\n}\n\nmodule.exports = nthArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/nthArg.js\n// module id = 463\n// module chunks = 0","module.exports = {\n 'clamp': require('./clamp'),\n 'inRange': require('./inRange'),\n 'random': require('./random')\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/number.js\n// module id = 464\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n baseClone = require('./_baseClone'),\n baseUnset = require('./_baseUnset'),\n castPath = require('./_castPath'),\n copyObject = require('./_copyObject'),\n customOmitClone = require('./_customOmitClone'),\n flatRest = require('./_flatRest'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nmodule.exports = omit;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/omit.js\n// module id = 465\n// module chunks = 0","var baseIteratee = require('./_baseIteratee'),\n negate = require('./negate'),\n pickBy = require('./pickBy');\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\nfunction omitBy(object, predicate) {\n return pickBy(object, negate(baseIteratee(predicate)));\n}\n\nmodule.exports = omitBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/omitBy.js\n// module id = 466\n// module chunks = 0","var before = require('./before');\n\n/**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\nfunction once(func) {\n return before(2, func);\n}\n\nmodule.exports = once;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/once.js\n// module id = 467\n// module chunks = 0","var baseOrderBy = require('./_baseOrderBy'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\nfunction orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n}\n\nmodule.exports = orderBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/orderBy.js\n// module id = 468\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n createOver = require('./_createOver');\n\n/**\n * Creates a function that invokes `iteratees` with the arguments it receives\n * and returns their results.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.over([Math.max, Math.min]);\n *\n * func(1, 2, 3, 4);\n * // => [4, 1]\n */\nvar over = createOver(arrayMap);\n\nmodule.exports = over;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/over.js\n// module id = 469\n// module chunks = 0","var apply = require('./_apply'),\n arrayMap = require('./_arrayMap'),\n baseFlatten = require('./_baseFlatten'),\n baseIteratee = require('./_baseIteratee'),\n baseRest = require('./_baseRest'),\n baseUnary = require('./_baseUnary'),\n castRest = require('./_castRest'),\n isArray = require('./isArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\nvar overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(baseIteratee))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n});\n\nmodule.exports = overArgs;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/overArgs.js\n// module id = 470\n// module chunks = 0","var arrayEvery = require('./_arrayEvery'),\n createOver = require('./_createOver');\n\n/**\n * Creates a function that checks if **all** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overEvery([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => false\n *\n * func(NaN);\n * // => false\n */\nvar overEvery = createOver(arrayEvery);\n\nmodule.exports = overEvery;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/overEvery.js\n// module id = 471\n// module chunks = 0","var arraySome = require('./_arraySome'),\n createOver = require('./_createOver');\n\n/**\n * Creates a function that checks if **any** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overSome([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => true\n *\n * func(NaN);\n * // => false\n */\nvar overSome = createOver(arraySome);\n\nmodule.exports = overSome;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/overSome.js\n// module id = 472\n// module chunks = 0","var baseRest = require('./_baseRest'),\n createWrap = require('./_createWrap'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\nvar partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n});\n\n// Assign default placeholders.\npartialRight.placeholder = {};\n\nmodule.exports = partialRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/partialRight.js\n// module id = 473\n// module chunks = 0","var createAggregator = require('./_createAggregator');\n\n/**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\nvar partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n}, function() { return [[], []]; });\n\nmodule.exports = partition;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/partition.js\n// module id = 474\n// module chunks = 0","var basePick = require('./_basePick'),\n flatRest = require('./_flatRest');\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nmodule.exports = pick;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/pick.js\n// module id = 475\n// module chunks = 0","var baseGet = require('./_baseGet');\n\n/**\n * The opposite of `_.property`; this method creates a function that returns\n * the value at a given path of `object`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\nfunction propertyOf(object) {\n return function(path) {\n return object == null ? undefined : baseGet(object, path);\n };\n}\n\nmodule.exports = propertyOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/propertyOf.js\n// module id = 476\n// module chunks = 0","var baseRandom = require('./_baseRandom'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseFloat = parseFloat;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min,\n nativeRandom = Math.random;\n\n/**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\nfunction random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n}\n\nmodule.exports = random;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/random.js\n// module id = 477\n// module chunks = 0","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/range.js\n// module id = 478\n// module chunks = 0","var createRange = require('./_createRange');\n\n/**\n * This method is like `_.range` except that it populates values in\n * descending order.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.range\n * @example\n *\n * _.rangeRight(4);\n * // => [3, 2, 1, 0]\n *\n * _.rangeRight(-4);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 5);\n * // => [4, 3, 2, 1]\n *\n * _.rangeRight(0, 20, 5);\n * // => [15, 10, 5, 0]\n *\n * _.rangeRight(0, -4, -1);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.rangeRight(0);\n * // => []\n */\nvar rangeRight = createRange(true);\n\nmodule.exports = rangeRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/rangeRight.js\n// module id = 479\n// module chunks = 0","var createWrap = require('./_createWrap'),\n flatRest = require('./_flatRest');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\nvar rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n});\n\nmodule.exports = rearg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/rearg.js\n// module id = 480\n// module chunks = 0","var arrayReduce = require('./_arrayReduce'),\n baseEach = require('./_baseEach'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nmodule.exports = reduce;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/reduce.js\n// module id = 481\n// module chunks = 0","var arrayReduceRight = require('./_arrayReduceRight'),\n baseEachRight = require('./_baseEachRight'),\n baseIteratee = require('./_baseIteratee'),\n baseReduce = require('./_baseReduce'),\n isArray = require('./isArray');\n\n/**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\nfunction reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n}\n\nmodule.exports = reduceRight;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/reduceRight.js\n// module id = 482\n// module chunks = 0","var arrayFilter = require('./_arrayFilter'),\n baseFilter = require('./_baseFilter'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray'),\n negate = require('./negate');\n\n/**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\nfunction reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(baseIteratee(predicate, 3)));\n}\n\nmodule.exports = reject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/reject.js\n// module id = 483\n// module chunks = 0","var baseRest = require('./_baseRest'),\n toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\nfunction rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n}\n\nmodule.exports = rest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/rest.js\n// module id = 484\n// module chunks = 0","var castPath = require('./_castPath'),\n isFunction = require('./isFunction'),\n toKey = require('./_toKey');\n\n/**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\nfunction result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n}\n\nmodule.exports = result;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/result.js\n// module id = 485\n// module chunks = 0","var arraySample = require('./_arraySample'),\n baseSample = require('./_baseSample'),\n isArray = require('./isArray');\n\n/**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\nfunction sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n}\n\nmodule.exports = sample;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/sample.js\n// module id = 486\n// module chunks = 0","var arraySampleSize = require('./_arraySampleSize'),\n baseSampleSize = require('./_baseSampleSize'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\nfunction sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n}\n\nmodule.exports = sampleSize;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/sampleSize.js\n// module id = 487\n// module chunks = 0","var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/set.js\n// module id = 488\n// module chunks = 0","var baseSet = require('./_baseSet');\n\n/**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n}\n\nmodule.exports = setWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/setWith.js\n// module id = 489\n// module chunks = 0","var arrayShuffle = require('./_arrayShuffle'),\n baseShuffle = require('./_baseShuffle'),\n isArray = require('./isArray');\n\n/**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\nfunction shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n}\n\nmodule.exports = shuffle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/shuffle.js\n// module id = 490\n// module chunks = 0","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n stringSize = require('./_stringSize');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\nfunction size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n}\n\nmodule.exports = size;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/size.js\n// module id = 491\n// module chunks = 0","var arraySome = require('./_arraySome'),\n baseIteratee = require('./_baseIteratee'),\n baseSome = require('./_baseSome'),\n isArray = require('./isArray'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\nfunction some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = some;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/some.js\n// module id = 492\n// module chunks = 0","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/sortBy.js\n// module id = 493\n// module chunks = 0","var apply = require('./_apply'),\n arrayPush = require('./_arrayPush'),\n baseRest = require('./_baseRest'),\n castSlice = require('./_castSlice'),\n toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\nfunction spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n}\n\nmodule.exports = spread;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/spread.js\n// module id = 494\n// module chunks = 0","/**\n * This method returns a new empty object.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Object} Returns the new empty object.\n * @example\n *\n * var objects = _.times(2, _.stubObject);\n *\n * console.log(objects);\n * // => [{}, {}]\n *\n * console.log(objects[0] === objects[1]);\n * // => false\n */\nfunction stubObject() {\n return {};\n}\n\nmodule.exports = stubObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubObject.js\n// module id = 495\n// module chunks = 0","/**\n * This method returns an empty string.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {string} Returns the empty string.\n * @example\n *\n * _.times(2, _.stubString);\n * // => ['', '']\n */\nfunction stubString() {\n return '';\n}\n\nmodule.exports = stubString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubString.js\n// module id = 496\n// module chunks = 0","/**\n * This method returns `true`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `true`.\n * @example\n *\n * _.times(2, _.stubTrue);\n * // => [true, true]\n */\nfunction stubTrue() {\n return true;\n}\n\nmodule.exports = stubTrue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubTrue.js\n// module id = 497\n// module chunks = 0","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/throttle.js\n// module id = 498\n// module chunks = 0","var baseTimes = require('./_baseTimes'),\n castFunction = require('./_castFunction'),\n toInteger = require('./toInteger');\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\nfunction times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = castFunction(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n}\n\nmodule.exports = times;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/times.js\n// module id = 499\n// module chunks = 0","var arrayMap = require('./_arrayMap'),\n copyArray = require('./_copyArray'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol'),\n stringToPath = require('./_stringToPath'),\n toKey = require('./_toKey'),\n toString = require('./toString');\n\n/**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n}\n\nmodule.exports = toPath;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPath.js\n// module id = 500\n// module chunks = 0","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/toPlainObject.js\n// module id = 501\n// module chunks = 0","var arrayEach = require('./_arrayEach'),\n baseCreate = require('./_baseCreate'),\n baseForOwn = require('./_baseForOwn'),\n baseIteratee = require('./_baseIteratee'),\n getPrototype = require('./_getPrototype'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isTypedArray = require('./isTypedArray');\n\n/**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\nfunction transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = baseIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n}\n\nmodule.exports = transform;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/transform.js\n// module id = 502\n// module chunks = 0","var ary = require('./ary');\n\n/**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\nfunction unary(func) {\n return ary(func, 1);\n}\n\nmodule.exports = unary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/unary.js\n// module id = 503\n// module chunks = 0","var toString = require('./toString');\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nmodule.exports = uniqueId;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/uniqueId.js\n// module id = 504\n// module chunks = 0","var baseUnset = require('./_baseUnset');\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n}\n\nmodule.exports = unset;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/unset.js\n// module id = 505\n// module chunks = 0","var baseUpdate = require('./_baseUpdate'),\n castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\nfunction update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n}\n\nmodule.exports = update;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/update.js\n// module id = 506\n// module chunks = 0","var baseUpdate = require('./_baseUpdate'),\n castFunction = require('./_castFunction');\n\n/**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\nfunction updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n}\n\nmodule.exports = updateWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/updateWith.js\n// module id = 507\n// module chunks = 0","var baseValues = require('./_baseValues'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\nfunction valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n}\n\nmodule.exports = valuesIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/valuesIn.js\n// module id = 508\n// module chunks = 0","var castFunction = require('./_castFunction'),\n partial = require('./partial');\n\n/**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\nfunction wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n}\n\nmodule.exports = wrap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/wrap.js\n// module id = 509\n// module chunks = 0","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n baseLodash = require('./_baseLodash'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike'),\n wrapperClone = require('./_wrapperClone');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\nlodash.prototype.constructor = lodash;\n\nmodule.exports = lodash;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/wrapperLodash.js\n// module id = 510\n// module chunks = 0","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/object-assign/index.js\n// module id = 511\n// module chunks = 0","var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0);\n\n/**\n * Helper class to create a webGL buffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param type {gl.ARRAY_BUFFER | gl.ELEMENT_ARRAY_BUFFER} @mat\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n * @param drawType {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\nvar Buffer = function(gl, type, data, drawType)\n{\n\n\t/**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n\tthis.gl = gl;\n\n\t/**\n * The WebGL buffer, created upon instantiation\n *\n * @member {WebGLBuffer}\n */\n\tthis.buffer = gl.createBuffer();\n\n\t/**\n * The type of the buffer\n *\n * @member {gl.ARRAY_BUFFER|gl.ELEMENT_ARRAY_BUFFER}\n */\n\tthis.type = type || gl.ARRAY_BUFFER;\n\n\t/**\n * The draw type of the buffer\n *\n * @member {gl.STATIC_DRAW|gl.DYNAMIC_DRAW|gl.STREAM_DRAW}\n */\n\tthis.drawType = drawType || gl.STATIC_DRAW;\n\n\t/**\n * The data in the buffer, as a typed array\n *\n * @member {ArrayBuffer| SharedArrayBuffer|ArrayBufferView}\n */\n\tthis.data = EMPTY_ARRAY_BUFFER;\n\n\tif(data)\n\t{\n\t\tthis.upload(data);\n\t}\n\n\tthis._updateID = 0;\n};\n\n/**\n * Uploads the buffer to the GPU\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data to upload\n * @param offset {Number} if only a subset of the data should be uploaded, this is the amount of data to subtract\n * @param dontBind {Boolean} whether to bind the buffer before uploading it\n */\nBuffer.prototype.upload = function(data, offset, dontBind)\n{\n\t// todo - needed?\n\tif(!dontBind) this.bind();\n\n\tvar gl = this.gl;\n\n\tdata = data || this.data;\n\toffset = offset || 0;\n\n\tif(this.data.byteLength >= data.byteLength)\n\t{\n\t\tgl.bufferSubData(this.type, offset, data);\n\t}\n\telse\n\t{\n\t\tgl.bufferData(this.type, data, this.drawType);\n\t}\n\n\tthis.data = data;\n};\n/**\n * Binds the buffer\n *\n */\nBuffer.prototype.bind = function()\n{\n\tvar gl = this.gl;\n\tgl.bindBuffer(this.type, this.buffer);\n};\n\nBuffer.createVertexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.createIndexBuffer = function(gl, data, drawType)\n{\n\treturn new Buffer(gl, gl.ELEMENT_ARRAY_BUFFER, data, drawType);\n};\n\nBuffer.create = function(gl, type, data, drawType)\n{\n\treturn new Buffer(gl, type, data, drawType);\n};\n\n/**\n * Destroys the buffer\n *\n */\nBuffer.prototype.destroy = function(){\n\tthis.gl.deleteBuffer(this.buffer);\n};\n\nmodule.exports = Buffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLBuffer.js\n// module id = 512\n// module chunks = 0","\nvar Texture = require('./GLTexture');\n\n/**\n * Helper class to create a webGL Framebuffer\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n */\nvar Framebuffer = function(gl, width, height)\n{\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * The frame buffer\n *\n * @member {WebGLFramebuffer}\n */\n this.framebuffer = gl.createFramebuffer();\n\n /**\n * The stencil buffer\n *\n * @member {WebGLRenderbuffer}\n */\n this.stencil = null;\n\n /**\n * The stencil buffer\n *\n * @member {PIXI.glCore.GLTexture}\n */\n this.texture = null;\n\n /**\n * The width of the drawing area of the buffer\n *\n * @member {Number}\n */\n this.width = width || 100;\n /**\n * The height of the drawing area of the buffer\n *\n * @member {Number}\n */\n this.height = height || 100;\n};\n\n/**\n * Adds a texture to the frame buffer\n * @param texture {PIXI.glCore.GLTexture}\n */\nFramebuffer.prototype.enableTexture = function(texture)\n{\n var gl = this.gl;\n\n this.texture = texture || new Texture(gl);\n\n this.texture.bind();\n\n //gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n this.bind();\n\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture.texture, 0);\n};\n\n/**\n * Initialises the stencil buffer\n */\nFramebuffer.prototype.enableStencil = function()\n{\n if(this.stencil)return;\n\n var gl = this.gl;\n\n this.stencil = gl.createRenderbuffer();\n\n gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n\n // TODO.. this is depth AND stencil?\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, this.width , this.height );\n\n\n};\n\n/**\n * Erases the drawing area and fills it with a colour\n * @param r {Number} the red value of the clearing colour\n * @param g {Number} the green value of the clearing colour\n * @param b {Number} the blue value of the clearing colour\n * @param a {Number} the alpha value of the clearing colour\n */\nFramebuffer.prototype.clear = function( r, g, b, a )\n{\n this.bind();\n\n var gl = this.gl;\n\n gl.clearColor(r, g, b, a);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n};\n\n/**\n * Binds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.bind = function()\n{\n var gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );\n};\n\n/**\n * Unbinds the frame buffer to the WebGL context\n */\nFramebuffer.prototype.unbind = function()\n{\n var gl = this.gl;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null );\n};\n/**\n * Resizes the drawing area of the buffer to the given width and height\n * @param width {Number} the new width\n * @param height {Number} the new height\n */\nFramebuffer.prototype.resize = function(width, height)\n{\n var gl = this.gl;\n\n this.width = width;\n this.height = height;\n\n if ( this.texture )\n {\n this.texture.uploadData(null, width, height);\n }\n\n if ( this.stencil )\n {\n // update the stencil buffer width and height\n gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencil);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);\n }\n};\n\n/**\n * Destroys this buffer\n */\nFramebuffer.prototype.destroy = function()\n{\n var gl = this.gl;\n\n //TODO\n if(this.texture)\n {\n this.texture.destroy();\n }\n\n gl.deleteFramebuffer(this.framebuffer);\n\n this.gl = null;\n\n this.stencil = null;\n this.texture = null;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createRGBA = function(gl, width, height, data)\n{\n var texture = Texture.fromData(gl, null, width, height);\n texture.enableNearestScaling();\n texture.enableWrapClamp();\n\n //now create the framebuffer object and attach the texture to it.\n var fbo = new Framebuffer(gl, width, height);\n fbo.enableTexture(texture);\n\n //fbo.enableStencil(); // get this back on soon!\n\n fbo.unbind();\n\n return fbo;\n};\n\n/**\n * Creates a frame buffer with a texture containing the given data\n * @static\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n * @param width {Number} the width of the drawing area of the frame buffer\n * @param height {Number} the height of the drawing area of the frame buffer\n * @param data {ArrayBuffer| SharedArrayBuffer|ArrayBufferView} an array of data\n */\nFramebuffer.createFloat32 = function(gl, width, height, data)\n{\n // create a new texture..\n var texture = new Texture.fromData(gl, data, width, height);\n texture.enableNearestScaling();\n texture.enableWrapClamp();\n\n //now create the framebuffer object and attach the texture to it.\n var fbo = new Framebuffer(gl, width, height);\n fbo.enableTexture(texture);\n\n fbo.unbind();\n\n return fbo;\n};\n\nmodule.exports = Framebuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLFramebuffer.js\n// module id = 513\n// module chunks = 0","\nvar compileProgram = require('./shader/compileProgram'),\n\textractAttributes = require('./shader/extractAttributes'),\n\textractUniforms = require('./shader/extractUniforms'),\n\tsetPrecision = require('./shader/setPrecision'),\n\tgenerateUniformAccessObject = require('./shader/generateUniformAccessObject');\n\n/**\n * Helper class to create a webGL Shader\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext}\n * @param vertexSrc {string|string[]} The vertex shader source as an array of strings.\n * @param fragmentSrc {string|string[]} The fragment shader source as an array of strings.\n * @param precision {precision]} The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.\n * @param attributeLocations {object} A key value pair showing which location eact attribute should sit eg {position:0, uvs:1}\n */\nvar Shader = function(gl, vertexSrc, fragmentSrc, precision, attributeLocations)\n{\n\t/**\n\t * The current WebGL rendering context\n\t *\n\t * @member {WebGLRenderingContext}\n\t */\n\tthis.gl = gl;\n\n\tif(precision)\n\t{\n\t\tvertexSrc = setPrecision(vertexSrc, precision);\n\t\tfragmentSrc = setPrecision(fragmentSrc, precision);\n\t}\n\n\t/**\n\t * The shader program\n\t *\n\t * @member {WebGLProgram}\n\t */\n\t// First compile the program..\n\tthis.program = compileProgram(gl, vertexSrc, fragmentSrc, attributeLocations);\n\n\t/**\n\t * The attributes of the shader as an object containing the following properties\n\t * {\n\t * \ttype,\n\t * \tsize,\n\t * \tlocation,\n\t * \tpointer\n\t * }\n\t * @member {Object}\n\t */\n\t// next extract the attributes\n\tthis.attributes = extractAttributes(gl, this.program);\n\n this.uniformData = extractUniforms(gl, this.program);\n\n\t/**\n\t * The uniforms of the shader as an object containing the following properties\n\t * {\n\t * \tgl,\n\t * \tdata\n\t * }\n\t * @member {Object}\n\t */\n\tthis.uniforms = generateUniformAccessObject( gl, this.uniformData );\n\n};\n/**\n * Uses this shader\n */\nShader.prototype.bind = function()\n{\n\tthis.gl.useProgram(this.program);\n};\n\n/**\n * Destroys this shader\n * TODO\n */\nShader.prototype.destroy = function()\n{\n\tthis.attributes = null;\n\tthis.uniformData = null;\n\tthis.uniforms = null;\n\n\tvar gl = this.gl;\n\tgl.deleteProgram(this.program);\n};\n\n\nmodule.exports = Shader;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/GLShader.js\n// module id = 514\n// module chunks = 0","\n// state object//\nvar setVertexAttribArrays = require( './setVertexAttribArrays' );\n\n/**\n * Helper class to work with WebGL VertexArrayObjects (vaos)\n * Only works if WebGL extensions are enabled (they usually are)\n *\n * @class\n * @memberof PIXI.glCore\n * @param gl {WebGLRenderingContext} The current WebGL rendering context\n */\nfunction VertexArrayObject(gl, state)\n{\n this.nativeVaoExtension = null;\n\n if(!VertexArrayObject.FORCE_NATIVE)\n {\n this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') ||\n gl.getExtension('MOZ_OES_vertex_array_object') ||\n gl.getExtension('WEBKIT_OES_vertex_array_object');\n }\n\n this.nativeState = state;\n\n if(this.nativeVaoExtension)\n {\n this.nativeVao = this.nativeVaoExtension.createVertexArrayOES();\n\n var maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n // VAO - overwrite the state..\n this.nativeState = {\n tempAttribState: new Array(maxAttribs),\n attribState: new Array(maxAttribs)\n };\n }\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * An array of attributes\n *\n * @member {Array}\n */\n this.attributes = [];\n\n /**\n * @member {PIXI.glCore.GLBuffer}\n */\n this.indexBuffer = null;\n\n /**\n * A boolean flag\n *\n * @member {Boolean}\n */\n this.dirty = false;\n}\n\nVertexArrayObject.prototype.constructor = VertexArrayObject;\nmodule.exports = VertexArrayObject;\n\n/**\n* Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n* If you find on older devices that things have gone a bit weird then set this to true.\n*/\n/**\n * Lets the VAO know if you should use the WebGL extension or the native methods.\n * Some devices behave a bit funny when using the newer extensions (im looking at you ipad 2!)\n * If you find on older devices that things have gone a bit weird then set this to true.\n * @static\n * @property {Boolean} FORCE_NATIVE\n */\nVertexArrayObject.FORCE_NATIVE = false;\n\n/**\n * Binds the buffer\n */\nVertexArrayObject.prototype.bind = function()\n{\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n\n if(this.dirty)\n {\n this.dirty = false;\n this.activate();\n }\n }\n else\n {\n\n this.activate();\n }\n\n return this;\n};\n\n/**\n * Unbinds the buffer\n */\nVertexArrayObject.prototype.unbind = function()\n{\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n return this;\n};\n\n/**\n * Uses this vao\n */\nVertexArrayObject.prototype.activate = function()\n{\n\n var gl = this.gl;\n var lastBuffer = null;\n\n for (var i = 0; i < this.attributes.length; i++)\n {\n var attrib = this.attributes[i];\n\n if(lastBuffer !== attrib.buffer)\n {\n attrib.buffer.bind();\n lastBuffer = attrib.buffer;\n }\n\n gl.vertexAttribPointer(attrib.attribute.location,\n attrib.attribute.size,\n attrib.type || gl.FLOAT,\n attrib.normalized || false,\n attrib.stride || 0,\n attrib.start || 0);\n }\n\n setVertexAttribArrays(gl, this.attributes, this.nativeState);\n\n if(this.indexBuffer)\n {\n this.indexBuffer.bind();\n }\n\n return this;\n};\n\n/**\n *\n * @param buffer {PIXI.gl.GLBuffer}\n * @param attribute {*}\n * @param type {String}\n * @param normalized {Boolean}\n * @param stride {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.addAttribute = function(buffer, attribute, type, normalized, stride, start)\n{\n this.attributes.push({\n buffer: buffer,\n attribute: attribute,\n\n location: attribute.location,\n type: type || this.gl.FLOAT,\n normalized: normalized || false,\n stride: stride || 0,\n start: start || 0\n });\n\n this.dirty = true;\n\n return this;\n};\n\n/**\n *\n * @param buffer {PIXI.gl.GLBuffer}\n */\nVertexArrayObject.prototype.addIndex = function(buffer/*, options*/)\n{\n this.indexBuffer = buffer;\n\n this.dirty = true;\n\n return this;\n};\n\n/**\n * Unbinds this vao and disables it\n */\nVertexArrayObject.prototype.clear = function()\n{\n // var gl = this.gl;\n\n // TODO - should this function unbind after clear?\n // for now, no but lets see what happens in the real world!\n if(this.nativeVao)\n {\n this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao);\n }\n\n this.attributes.length = 0;\n this.indexBuffer = null;\n\n return this;\n};\n\n/**\n * @param type {Number}\n * @param size {Number}\n * @param start {Number}\n */\nVertexArrayObject.prototype.draw = function(type, size, start)\n{\n var gl = this.gl;\n\n if(this.indexBuffer)\n {\n gl.drawElements(type, size || this.indexBuffer.data.length, gl.UNSIGNED_SHORT, (start || 0) * 2 );\n }\n else\n {\n // TODO need a better way to calculate size..\n gl.drawArrays(type, start, size || this.getSize());\n }\n\n return this;\n};\n\n/**\n * Destroy this vao\n */\nVertexArrayObject.prototype.destroy = function()\n{\n // lose references\n this.gl = null;\n this.indexBuffer = null;\n this.attributes = null;\n this.nativeState = null;\n\n if(this.nativeVao)\n {\n this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao);\n }\n\n this.nativeVaoExtension = null;\n this.nativeVao = null;\n};\n\nVertexArrayObject.prototype.getSize = function()\n{\n var attrib = this.attributes[0];\n return attrib.buffer.data.length / (( attrib.stride/4 ) || attrib.attribute.size);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/VertexArrayObject.js\n// module id = 515\n// module chunks = 0","\n/**\n * Helper class to create a webGL Context\n *\n * @class\n * @memberof PIXI.glCore\n * @param canvas {HTMLCanvasElement} the canvas element that we will get the context from\n * @param options {Object} An options object that gets passed in to the canvas element containing the context attributes,\n * see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext for the options available\n * @return {WebGLRenderingContext} the WebGL context\n */\nvar createContext = function(canvas, options)\n{\n var gl = canvas.getContext('webgl', options) || \n canvas.getContext('experimental-webgl', options);\n\n if (!gl)\n {\n // fail, not able to get a context\n throw new Error('This browser does not support webGL. Try using the canvas renderer');\n }\n\n return gl;\n};\n\nmodule.exports = createContext;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/createContext.js\n// module id = 516\n// module chunks = 0","module.exports = {\n compileProgram: require('./compileProgram'),\n defaultValue: require('./defaultValue'),\n extractAttributes: require('./extractAttributes'),\n extractUniforms: require('./extractUniforms'),\n generateUniformAccessObject: require('./generateUniformAccessObject'),\n setPrecision: require('./setPrecision'),\n mapSize: require('./mapSize'),\n mapType: require('./mapType')\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi-gl-core/src/shader/index.js\n// module id = 517\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nvar _accessibleTarget = require('./accessibleTarget');\n\nvar _accessibleTarget2 = _interopRequireDefault(_accessibleTarget);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// add some extra variables to the container..\ncore.utils.mixins.delayMixin(core.DisplayObject.prototype, _accessibleTarget2.default);\n\nvar KEY_CODE_TAB = 9;\n\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\n\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen\n * readers. This is very important as it can possibly help people with disabilities access pixi\n * content.\n *\n * Much like interaction any DisplayObject can be made accessible. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.accessibility\n *\n * @class\n * @memberof PIXI.accessibility\n */\n\nvar AccessibilityManager = function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n _classCallCheck(this, AccessibilityManager);\n\n if ((_ismobilejs2.default.tablet || _ismobilejs2.default.phone) && !navigator.isCocoonJS) {\n this.createTouchHook();\n }\n\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n var div = document.createElement('div');\n\n div.style.width = DIV_TOUCH_SIZE + 'px';\n div.style.height = DIV_TOUCH_SIZE + 'px';\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + 'px';\n div.style.left = DIV_TOUCH_POS_Y + 'px';\n div.style.zIndex = DIV_TOUCH_ZINDEX;\n\n /**\n * This is the dom element that will sit over the PixiJS element. This is where the div overlays will go.\n *\n * @type {HTMLElement}\n * @private\n */\n this.div = div;\n\n /**\n * A simple pool for storing divs.\n *\n * @type {*}\n * @private\n */\n this.pool = [];\n\n /**\n * This is a tick used to check if an object is no longer being rendered.\n *\n * @type {Number}\n * @private\n */\n this.renderId = 0;\n\n /**\n * Setting this to true will visually show the divs.\n *\n * @type {boolean}\n */\n this.debug = false;\n\n /**\n * The renderer this accessibility manager works for.\n *\n * @member {PIXI.SystemRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The array of currently active accessible items.\n *\n * @member {Array<*>}\n * @private\n */\n this.children = [];\n\n /**\n * pre-bind the functions\n *\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onMouseMove = this._onMouseMove.bind(this);\n\n /**\n * stores the state of the manager. If there are no accessible objects or the mouse is moving, this will be false.\n *\n * @member {Array<*>}\n * @private\n */\n this.isActive = false;\n this.isMobileAccessabillity = false;\n\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n window.addEventListener('keydown', this._onKeyDown, false);\n }\n\n /**\n * Creates the touch hooks.\n *\n */\n\n\n AccessibilityManager.prototype.createTouchHook = function createTouchHook() {\n var _this = this;\n\n var hookDiv = document.createElement('button');\n\n hookDiv.style.width = DIV_HOOK_SIZE + 'px';\n hookDiv.style.height = DIV_HOOK_SIZE + 'px';\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + 'px';\n hookDiv.style.left = DIV_HOOK_POS_Y + 'px';\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX;\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'HOOK DIV';\n\n hookDiv.addEventListener('focus', function () {\n _this.isMobileAccessabillity = true;\n _this.activate();\n document.body.removeChild(hookDiv);\n });\n\n document.body.appendChild(hookDiv);\n };\n\n /**\n * Activating will cause the Accessibility layer to be shown. This is called when a user\n * preses the tab key.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.activate = function activate() {\n if (this.isActive) {\n return;\n }\n\n this.isActive = true;\n\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.on('postrender', this.update, this);\n\n if (this.renderer.view.parentNode) {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n };\n\n /**\n * Deactivating will cause the Accessibility layer to be hidden. This is called when a user moves\n * the mouse.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.deactivate = function deactivate() {\n if (!this.isActive || this.isMobileAccessabillity) {\n return;\n }\n\n this.isActive = false;\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.addEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.off('postrender', this.update);\n\n if (this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n }\n };\n\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n *\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n\n\n AccessibilityManager.prototype.updateAccessibleObjects = function updateAccessibleObjects(displayObject) {\n if (!displayObject.visible) {\n return;\n }\n\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n\n displayObject.renderId = this.renderId;\n }\n\n var children = displayObject.children;\n\n for (var i = children.length - 1; i >= 0; i--) {\n this.updateAccessibleObjects(children[i]);\n }\n };\n\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n *\n * @private\n */\n\n\n AccessibilityManager.prototype.update = function update() {\n if (!this.renderer.renderingToScreen) {\n return;\n }\n\n // update children...\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n\n var rect = this.renderer.view.getBoundingClientRect();\n var sx = rect.width / this.renderer.width;\n var sy = rect.height / this.renderer.height;\n\n var div = this.div;\n\n div.style.left = rect.left + 'px';\n div.style.top = rect.top + 'px';\n div.style.width = this.renderer.width + 'px';\n div.style.height = this.renderer.height + 'px';\n\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n\n core.utils.removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n\n i--;\n\n if (this.children.length === 0) {\n this.deactivate();\n }\n } else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n\n if (child.hitArea) {\n div.style.left = (wt.tx + hitArea.x * wt.a) * sx + 'px';\n div.style.top = (wt.ty + hitArea.y * wt.d) * sy + 'px';\n\n div.style.width = hitArea.width * wt.a * sx + 'px';\n div.style.height = hitArea.height * wt.d * sy + 'px';\n } else {\n hitArea = child.getBounds();\n\n this.capHitArea(hitArea);\n\n div.style.left = hitArea.x * sx + 'px';\n div.style.top = hitArea.y * sy + 'px';\n\n div.style.width = hitArea.width * sx + 'px';\n div.style.height = hitArea.height * sy + 'px';\n }\n }\n }\n\n // increment the render id..\n this.renderId++;\n };\n\n /**\n * TODO: docs.\n *\n * @param {Rectangle} hitArea - TODO docs\n */\n\n\n AccessibilityManager.prototype.capHitArea = function capHitArea(hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n\n if (hitArea.x + hitArea.width > this.renderer.width) {\n hitArea.width = this.renderer.width - hitArea.x;\n }\n\n if (hitArea.y + hitArea.height > this.renderer.height) {\n hitArea.height = this.renderer.height - hitArea.y;\n }\n };\n\n /**\n * Adds a DisplayObject to the accessibility manager\n *\n * @private\n * @param {DisplayObject} displayObject - The child to make accessible.\n */\n\n\n AccessibilityManager.prototype.addChild = function addChild(displayObject) {\n // this.activate();\n\n var div = this.pool.pop();\n\n if (!div) {\n div = document.createElement('button');\n\n div.style.width = DIV_TOUCH_SIZE + 'px';\n div.style.height = DIV_TOUCH_SIZE + 'px';\n div.style.backgroundColor = this.debug ? 'rgba(255,0,0,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX;\n div.style.borderStyle = 'none';\n\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n\n if (displayObject.accessibleTitle) {\n div.title = displayObject.accessibleTitle;\n } else if (!displayObject.accessibleTitle && !displayObject.accessibleHint) {\n div.title = 'displayObject ' + this.tabIndex;\n }\n\n if (displayObject.accessibleHint) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n\n //\n\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n *\n * @private\n * @param {MouseEvent} e - The click event.\n */\n\n\n AccessibilityManager.prototype._onClick = function _onClick(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData);\n };\n\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n *\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n\n\n AccessibilityManager.prototype._onFocus = function _onFocus(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData);\n };\n\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n *\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n\n\n AccessibilityManager.prototype._onFocusOut = function _onFocusOut(e) {\n var interactionManager = this.renderer.plugins.interaction;\n\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData);\n };\n\n /**\n * Is called when a key is pressed\n *\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n\n\n AccessibilityManager.prototype._onKeyDown = function _onKeyDown(e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n\n this.activate();\n };\n\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n */\n\n\n AccessibilityManager.prototype._onMouseMove = function _onMouseMove() {\n this.deactivate();\n };\n\n /**\n * Destroys the accessibility manager\n *\n */\n\n\n AccessibilityManager.prototype.destroy = function destroy() {\n this.div = null;\n\n for (var i = 0; i < this.children.length; i++) {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n\n return AccessibilityManager;\n}();\n\nexports.default = AccessibilityManager;\n\n\ncore.WebGLRenderer.registerPlugin('accessibility', AccessibilityManager);\ncore.CanvasRenderer.registerPlugin('accessibility', AccessibilityManager);\n//# sourceMappingURL=AccessibilityManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/accessibility/AccessibilityManager.js\n// module id = 518\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _accessibleTarget = require('./accessibleTarget');\n\nObject.defineProperty(exports, 'accessibleTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_accessibleTarget).default;\n }\n});\n\nvar _AccessibilityManager = require('./AccessibilityManager');\n\nObject.defineProperty(exports, 'AccessibilityManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_AccessibilityManager).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/accessibility/index.js\n// module id = 519\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Container2 = require('../display/Container');\n\nvar _Container3 = _interopRequireDefault(_Container2);\n\nvar _RenderTexture = require('../textures/RenderTexture');\n\nvar _RenderTexture2 = _interopRequireDefault(_RenderTexture);\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _GraphicsData = require('./GraphicsData');\n\nvar _GraphicsData2 = _interopRequireDefault(_GraphicsData);\n\nvar _Sprite = require('../sprites/Sprite');\n\nvar _Sprite2 = _interopRequireDefault(_Sprite);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _Bounds = require('../display/Bounds');\n\nvar _Bounds2 = _interopRequireDefault(_Bounds);\n\nvar _bezierCurveTo2 = require('./utils/bezierCurveTo');\n\nvar _bezierCurveTo3 = _interopRequireDefault(_bezierCurveTo2);\n\nvar _CanvasRenderer = require('../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar canvasRenderer = void 0;\nvar tempMatrix = new _math.Matrix();\nvar tempPoint = new _math.Point();\nvar tempColor1 = new Float32Array(4);\nvar tempColor2 = new Float32Array(4);\n\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\n\nvar Graphics = function (_Container) {\n _inherits(Graphics, _Container);\n\n /**\n *\n * @param {boolean} [nativeLines=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n */\n function Graphics() {\n var nativeLines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, Graphics);\n\n /**\n * The alpha value used when filling the Graphics object.\n *\n * @member {number}\n * @default 1\n */\n var _this = _possibleConstructorReturn(this, _Container.call(this));\n\n _this.fillAlpha = 1;\n\n /**\n * The width (thickness) of any lines drawn.\n *\n * @member {number}\n * @default 0\n */\n _this.lineWidth = 0;\n\n /**\n * If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n *\n * @member {boolean}\n */\n _this.nativeLines = nativeLines;\n\n /**\n * The color of any lines drawn.\n *\n * @member {string}\n * @default 0\n */\n _this.lineColor = 0;\n\n /**\n * Graphics data\n *\n * @member {PIXI.GraphicsData[]}\n * @private\n */\n _this.graphicsData = [];\n\n /**\n * The tint applied to the graphic shape. This is a hex value. Apply a value of 0xFFFFFF to\n * reset the tint.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n _this.tint = 0xFFFFFF;\n\n /**\n * The previous tint applied to the graphic shape. Used to compare to the current tint and\n * check if theres change.\n *\n * @member {number}\n * @private\n * @default 0xFFFFFF\n */\n _this._prevTint = 0xFFFFFF;\n\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = _const.BLEND_MODES.NORMAL;\n\n /**\n * Current path\n *\n * @member {PIXI.GraphicsData}\n * @private\n */\n _this.currentPath = null;\n\n /**\n * Array containing some WebGL-related properties used by the WebGL renderer.\n *\n * @member {object}\n * @private\n */\n // TODO - _webgl should use a prototype object, not a random undocumented object...\n _this._webGL = {};\n\n /**\n * Whether this shape is being used as a mask.\n *\n * @member {boolean}\n */\n _this.isMask = false;\n\n /**\n * The bounds' padding used for bounds calculation.\n *\n * @member {number}\n */\n _this.boundsPadding = 0;\n\n /**\n * A cache of the local bounds to prevent recalculation.\n *\n * @member {PIXI.Rectangle}\n * @private\n */\n _this._localBounds = new _Bounds2.default();\n\n /**\n * Used to detect if the graphics object has changed. If this is set to true then the graphics\n * object will be recalculated.\n *\n * @member {boolean}\n * @private\n */\n _this.dirty = 0;\n\n /**\n * Used to detect if we need to do a fast rect check using the id compare method\n * @type {Number}\n */\n _this.fastRectDirty = -1;\n\n /**\n * Used to detect if we clear the graphics webGL data\n * @type {Number}\n */\n _this.clearDirty = 0;\n\n /**\n * Used to detect if we we need to recalculate local bounds\n * @type {Number}\n */\n _this.boundsDirty = -1;\n\n /**\n * Used to detect if the cached sprite object needs to be updated.\n *\n * @member {boolean}\n * @private\n */\n _this.cachedSpriteDirty = false;\n\n _this._spriteRect = null;\n _this._fastRect = false;\n\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n *\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n return _this;\n }\n\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that the only the properties of the object are cloned, not its transform (position,scale,etc)\n *\n * @return {PIXI.Graphics} A clone of the graphics object\n */\n\n\n Graphics.prototype.clone = function clone() {\n var clone = new Graphics();\n\n clone.renderable = this.renderable;\n clone.fillAlpha = this.fillAlpha;\n clone.lineWidth = this.lineWidth;\n clone.lineColor = this.lineColor;\n clone.tint = this.tint;\n clone.blendMode = this.blendMode;\n clone.isMask = this.isMask;\n clone.boundsPadding = this.boundsPadding;\n clone.dirty = 0;\n clone.cachedSpriteDirty = this.cachedSpriteDirty;\n\n // copy graphics data\n for (var i = 0; i < this.graphicsData.length; ++i) {\n clone.graphicsData.push(this.graphicsData[i].clone());\n }\n\n clone.currentPath = clone.graphicsData[clone.graphicsData.length - 1];\n\n clone.updateLocalBounds();\n\n return clone;\n };\n\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @param {number} [lineWidth=0] - width of the line to draw, will update the objects stored style\n * @param {number} [color=0] - color of the line to draw, will update the objects stored style\n * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.lineStyle = function lineStyle() {\n var lineWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n this.lineWidth = lineWidth;\n this.lineColor = color;\n this.lineAlpha = alpha;\n\n if (this.currentPath) {\n if (this.currentPath.shape.points.length) {\n // halfway through a line? start a new one!\n var shape = new _math.Polygon(this.currentPath.shape.points.slice(-2));\n\n shape.closed = false;\n\n this.drawShape(shape);\n } else {\n // otherwise its empty so lets just set the line properties\n this.currentPath.lineWidth = this.lineWidth;\n this.currentPath.lineColor = this.lineColor;\n this.currentPath.lineAlpha = this.lineAlpha;\n }\n }\n\n return this;\n };\n\n /**\n * Moves the current drawing position to x, y.\n *\n * @param {number} x - the X coordinate to move to\n * @param {number} y - the Y coordinate to move to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.moveTo = function moveTo(x, y) {\n var shape = new _math.Polygon([x, y]);\n\n shape.closed = false;\n this.drawShape(shape);\n\n return this;\n };\n\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n *\n * @param {number} x - the X coordinate to draw to\n * @param {number} y - the Y coordinate to draw to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.lineTo = function lineTo(x, y) {\n this.currentPath.shape.points.push(x, y);\n this.dirty++;\n\n return this;\n };\n\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.quadraticCurveTo = function quadraticCurveTo(cpX, cpY, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n\n var n = 20;\n var points = this.currentPath.shape.points;\n var xa = 0;\n var ya = 0;\n\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n\n xa = fromX + (cpX - fromX) * j;\n ya = fromY + (cpY - fromY) * j;\n\n points.push(xa + (cpX + (toX - cpX) * j - xa) * j, ya + (cpY + (toY - cpY) * j - ya) * j);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.bezierCurveTo = function bezierCurveTo(cpX, cpY, cpX2, cpY2, toX, toY) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points = [0, 0];\n }\n } else {\n this.moveTo(0, 0);\n }\n\n var points = this.currentPath.shape.points;\n\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n\n points.length -= 2;\n\n (0, _bezierCurveTo3.default)(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY, points);\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @param {number} x1 - The x-coordinate of the beginning of the arc\n * @param {number} y1 - The y-coordinate of the beginning of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.arcTo = function arcTo(x1, y1, x2, y2, radius) {\n if (this.currentPath) {\n if (this.currentPath.shape.points.length === 0) {\n this.currentPath.shape.points.push(x1, y1);\n }\n } else {\n this.moveTo(x1, y1);\n }\n\n var points = this.currentPath.shape.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs(a1 * b2 - b1 * a2);\n\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n } else {\n var dd = a1 * a1 + b1 * b1;\n var cc = a2 * a2 + b2 * b2;\n var tt = a1 * a2 + b1 * b2;\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = k1 * b2 + k2 * b1;\n var cy = k1 * a2 + k2 * a1;\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n\n this.arc(cx + x1, cy + y1, radius, startAngle, endAngle, b1 * a2 > b2 * a1);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.arc = function arc(cx, cy, radius, startAngle, endAngle) {\n var anticlockwise = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;\n\n if (startAngle === endAngle) {\n return this;\n }\n\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += Math.PI * 2;\n } else if (anticlockwise && startAngle <= endAngle) {\n startAngle += Math.PI * 2;\n }\n\n var sweep = endAngle - startAngle;\n var segs = Math.ceil(Math.abs(sweep) / (Math.PI * 2)) * 40;\n\n if (sweep === 0) {\n return this;\n }\n\n var startX = cx + Math.cos(startAngle) * radius;\n var startY = cy + Math.sin(startAngle) * radius;\n\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.shape.points : null;\n\n if (points) {\n if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) {\n points.push(startX, startY);\n }\n } else {\n this.moveTo(startX, startY);\n points = this.currentPath.shape.points;\n }\n\n var theta = sweep / (segs * 2);\n var theta2 = theta * 2;\n\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n\n var segMinus = segs - 1;\n\n var remainder = segMinus % 1 / segMinus;\n\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + remainder * i;\n\n var angle = theta + startAngle + theta2 * real;\n\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n\n points.push((cTheta * c + sTheta * s) * radius + cx, (cTheta * -s + sTheta * c) * radius + cy);\n }\n\n this.dirty++;\n\n return this;\n };\n\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n *\n * @param {number} [color=0] - the color of the fill\n * @param {number} [alpha=1] - the alpha of the fill\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.beginFill = function beginFill() {\n var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this.filling = true;\n this.fillColor = color;\n this.fillAlpha = alpha;\n\n if (this.currentPath) {\n if (this.currentPath.shape.points.length <= 2) {\n this.currentPath.fill = this.filling;\n this.currentPath.fillColor = this.fillColor;\n this.currentPath.fillAlpha = this.fillAlpha;\n }\n }\n\n return this;\n };\n\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.endFill = function endFill() {\n this.filling = false;\n this.fillColor = null;\n this.fillAlpha = 1;\n\n return this;\n };\n\n /**\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawRect = function drawRect(x, y, width, height) {\n this.drawShape(new _math.Rectangle(x, y, width, height));\n\n return this;\n };\n\n /**\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @param {number} radius - Radius of the rectangle corners\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawRoundedRect = function drawRoundedRect(x, y, width, height, radius) {\n this.drawShape(new _math.RoundedRectangle(x, y, width, height, radius));\n\n return this;\n };\n\n /**\n * Draws a circle.\n *\n * @param {number} x - The X coordinate of the center of the circle\n * @param {number} y - The Y coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawCircle = function drawCircle(x, y, radius) {\n this.drawShape(new _math.Circle(x, y, radius));\n\n return this;\n };\n\n /**\n * Draws an ellipse.\n *\n * @param {number} x - The X coordinate of the center of the ellipse\n * @param {number} y - The Y coordinate of the center of the ellipse\n * @param {number} width - The half width of the ellipse\n * @param {number} height - The half height of the ellipse\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawEllipse = function drawEllipse(x, y, width, height) {\n this.drawShape(new _math.Ellipse(x, y, width, height));\n\n return this;\n };\n\n /**\n * Draws a polygon using the given path.\n *\n * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.drawPolygon = function drawPolygon(path) {\n // prevents an argument assignment deopt\n // see section 3.1: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n var points = path;\n\n var closed = true;\n\n if (points instanceof _math.Polygon) {\n closed = points.closed;\n points = points.points;\n }\n\n if (!Array.isArray(points)) {\n // prevents an argument leak deopt\n // see section 3.2: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments\n points = new Array(arguments.length);\n\n for (var i = 0; i < points.length; ++i) {\n points[i] = arguments[i]; // eslint-disable-line prefer-rest-params\n }\n }\n\n var shape = new _math.Polygon(points);\n\n shape.closed = closed;\n\n this.drawShape(shape);\n\n return this;\n };\n\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n\n\n Graphics.prototype.clear = function clear() {\n if (this.lineWidth || this.filling || this.graphicsData.length > 0) {\n this.lineWidth = 0;\n this.filling = false;\n\n this.boundsDirty = -1;\n this.dirty++;\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n\n this.currentPath = null;\n this._spriteRect = null;\n\n return this;\n };\n\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n *\n * @returns {boolean} True if only 1 rect.\n */\n\n\n Graphics.prototype.isFastRect = function isFastRect() {\n return this.graphicsData.length === 1 && this.graphicsData[0].shape.type === _const.SHAPES.RECT && !this.graphicsData[0].lineWidth;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderWebGL = function _renderWebGL(renderer) {\n // if the sprite is not visible or the alpha is 0 then no need to render this element\n if (this.dirty !== this.fastRectDirty) {\n this.fastRectDirty = this.dirty;\n this._fastRect = this.isFastRect();\n }\n\n // TODO this check can be moved to dirty?\n if (this._fastRect) {\n this._renderSpriteRect(renderer);\n } else {\n renderer.setObjectRenderer(renderer.plugins.graphics);\n renderer.plugins.graphics.render(this);\n }\n };\n\n /**\n * Renders a sprite rectangle.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderSpriteRect = function _renderSpriteRect(renderer) {\n var rect = this.graphicsData[0].shape;\n\n if (!this._spriteRect) {\n this._spriteRect = new _Sprite2.default(new _Texture2.default(_Texture2.default.WHITE));\n }\n\n var sprite = this._spriteRect;\n\n if (this.tint === 0xffffff) {\n sprite.tint = this.graphicsData[0].fillColor;\n } else {\n var t1 = tempColor1;\n var t2 = tempColor2;\n\n (0, _utils.hex2rgb)(this.graphicsData[0].fillColor, t1);\n (0, _utils.hex2rgb)(this.tint, t2);\n\n t1[0] *= t2[0];\n t1[1] *= t2[1];\n t1[2] *= t2[2];\n\n sprite.tint = (0, _utils.rgb2hex)(t1);\n }\n sprite.alpha = this.graphicsData[0].fillAlpha;\n sprite.worldAlpha = this.worldAlpha * sprite.alpha;\n sprite.blendMode = this.blendMode;\n\n sprite._texture._frame.width = rect.width;\n sprite._texture._frame.height = rect.height;\n\n sprite.transform.worldTransform = this.transform.worldTransform;\n\n sprite.anchor.set(-rect.x / rect.width, -rect.y / rect.height);\n sprite._onAnchorUpdate();\n\n sprite._renderWebGL(renderer);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Graphics.prototype._renderCanvas = function _renderCanvas(renderer) {\n if (this.isMask === true) {\n return;\n }\n\n renderer.plugins.graphics.render(this);\n };\n\n /**\n * Retrieves the bounds of the graphic shape as a rectangle object\n *\n * @private\n */\n\n\n Graphics.prototype._calculateBounds = function _calculateBounds() {\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.updateLocalBounds();\n\n this.cachedSpriteDirty = true;\n }\n\n var lb = this._localBounds;\n\n this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n };\n\n /**\n * Tests if a point is inside this graphics object\n *\n * @param {PIXI.Point} point - the point to test\n * @return {boolean} the result of the test\n */\n\n\n Graphics.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var graphicsData = this.graphicsData;\n\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n\n if (!data.fill) {\n continue;\n }\n\n // only deal with fills..\n if (data.shape) {\n if (data.shape.contains(tempPoint.x, tempPoint.y)) {\n if (data.holes) {\n for (var _i = 0; _i < data.holes.length; _i++) {\n var hole = data.holes[_i];\n\n if (hole.contains(tempPoint.x, tempPoint.y)) {\n return false;\n }\n }\n }\n\n return true;\n }\n }\n }\n\n return false;\n };\n\n /**\n * Update the bounds of the object\n *\n */\n\n\n Graphics.prototype.updateLocalBounds = function updateLocalBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n\n var minY = Infinity;\n var maxY = -Infinity;\n\n if (this.graphicsData.length) {\n var shape = 0;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineWidth;\n\n shape = data.shape;\n\n if (type === _const.SHAPES.RECT || type === _const.SHAPES.RREC) {\n x = shape.x - lineWidth / 2;\n y = shape.y - lineWidth / 2;\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === _const.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + lineWidth / 2;\n h = shape.radius + lineWidth / 2;\n\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else if (type === _const.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + lineWidth / 2;\n h = shape.height + lineWidth / 2;\n\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n } else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt(dx * dx + dy * dy);\n\n if (w < 1e-9) {\n continue;\n }\n\n rw = (h / w * dy + dx) / 2;\n rh = (h / w * dx + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n } else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n\n var padding = this.boundsPadding;\n\n this._localBounds.minX = minX - padding;\n this._localBounds.maxX = maxX + padding;\n\n this._localBounds.minY = minY - padding;\n this._localBounds.maxY = maxY + padding;\n };\n\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @return {PIXI.GraphicsData} The generated GraphicsData object.\n */\n\n\n Graphics.prototype.drawShape = function drawShape(shape) {\n if (this.currentPath) {\n // check current path!\n if (this.currentPath.shape.points.length <= 2) {\n this.graphicsData.pop();\n }\n }\n\n this.currentPath = null;\n\n var data = new _GraphicsData2.default(this.lineWidth, this.lineColor, this.lineAlpha, this.fillColor, this.fillAlpha, this.filling, this.nativeLines, shape);\n\n this.graphicsData.push(data);\n\n if (data.type === _const.SHAPES.POLY) {\n data.shape.closed = data.shape.closed || this.filling;\n this.currentPath = data;\n }\n\n this.dirty++;\n\n return data;\n };\n\n /**\n * Generates a canvas texture.\n *\n * @param {number} scaleMode - The scale mode of the texture.\n * @param {number} resolution - The resolution of the texture.\n * @return {PIXI.Texture} The new texture.\n */\n\n\n Graphics.prototype.generateCanvasTexture = function generateCanvasTexture(scaleMode) {\n var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n var bounds = this.getLocalBounds();\n\n var canvasBuffer = _RenderTexture2.default.create(bounds.width, bounds.height, scaleMode, resolution);\n\n if (!canvasRenderer) {\n canvasRenderer = new _CanvasRenderer2.default();\n }\n\n this.transform.updateLocalTransform();\n this.transform.localTransform.copy(tempMatrix);\n\n tempMatrix.invert();\n\n tempMatrix.tx -= bounds.x;\n tempMatrix.ty -= bounds.y;\n\n canvasRenderer.render(this, canvasBuffer, true, tempMatrix);\n\n var texture = _Texture2.default.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode, 'graphics');\n\n texture.baseTexture.resolution = resolution;\n texture.baseTexture.update();\n\n return texture;\n };\n\n /**\n * Closes the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n\n\n Graphics.prototype.closePath = function closePath() {\n // ok so close path assumes next one is a hole!\n var currentPath = this.currentPath;\n\n if (currentPath && currentPath.shape) {\n currentPath.shape.close();\n }\n\n return this;\n };\n\n /**\n * Adds a hole in the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n\n\n Graphics.prototype.addHole = function addHole() {\n // this is a hole!\n var hole = this.graphicsData.pop();\n\n this.currentPath = this.graphicsData[this.graphicsData.length - 1];\n\n this.currentPath.addHole(hole.shape);\n this.currentPath = null;\n\n return this;\n };\n\n /**\n * Destroys the Graphics object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n Graphics.prototype.destroy = function destroy(options) {\n _Container.prototype.destroy.call(this, options);\n\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n\n // for each webgl data entry, destroy the WebGLGraphicsData\n for (var id in this._webgl) {\n for (var j = 0; j < this._webgl[id].data.length; ++j) {\n this._webgl[id].data[j].destroy();\n }\n }\n\n if (this._spriteRect) {\n this._spriteRect.destroy();\n }\n\n this.graphicsData = null;\n\n this.currentPath = null;\n this._webgl = null;\n this._localBounds = null;\n };\n\n return Graphics;\n}(_Container3.default);\n\nexports.default = Graphics;\n\n\nGraphics._SPRITE_TEXTURE = null;\n//# sourceMappingURL=Graphics.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/Graphics.js\n// module id = 520\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _CanvasRenderer = require('../../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they\n * now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasGraphicsRenderer:\n * https://github.com/libgdx/libgdx/blob/1.0.0/gdx/src/com/badlogic/gdx/graphics/glutils/ShapeRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching graphics objects.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar CanvasGraphicsRenderer = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The current PIXI renderer.\n */\n function CanvasGraphicsRenderer(renderer) {\n _classCallCheck(this, CanvasGraphicsRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders a Graphics object to a canvas.\n *\n * @param {PIXI.Graphics} graphics - the actual graphics object to render\n */\n\n\n CanvasGraphicsRenderer.prototype.render = function render(graphics) {\n var renderer = this.renderer;\n var context = renderer.context;\n var worldAlpha = graphics.worldAlpha;\n var transform = graphics.transform.worldTransform;\n var resolution = renderer.resolution;\n\n // if the tint has changed, set the graphics object to dirty.\n if (this._prevTint !== this.tint) {\n this.dirty = true;\n }\n\n context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n if (graphics.dirty) {\n this.updateGraphicsTint(graphics);\n graphics.dirty = false;\n }\n\n renderer.setBlendMode(graphics.blendMode);\n\n for (var i = 0; i < graphics.graphicsData.length; i++) {\n var data = graphics.graphicsData[i];\n var shape = data.shape;\n\n var fillColor = data._fillTint;\n var lineColor = data._lineTint;\n\n context.lineWidth = data.lineWidth;\n\n if (data.type === _const.SHAPES.POLY) {\n context.beginPath();\n\n this.renderPolygon(shape.points, shape.closed, context);\n\n for (var j = 0; j < data.holes.length; j++) {\n this.renderPolygon(data.holes[j].points, true, context);\n }\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.RECT) {\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fillRect(shape.x, shape.y, shape.width, shape.height);\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.strokeRect(shape.x, shape.y, shape.width, shape.height);\n }\n } else if (data.type === _const.SHAPES.CIRC) {\n // TODO - need to be Undefined!\n context.beginPath();\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.ELIP) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n var w = shape.width * 2;\n var h = shape.height * 2;\n\n var x = shape.x - w / 2;\n var y = shape.y - h / 2;\n\n context.beginPath();\n\n var kappa = 0.5522848;\n var ox = w / 2 * kappa; // control point offset horizontal\n var oy = h / 2 * kappa; // control point offset vertical\n var xe = x + w; // x-end\n var ye = y + h; // y-end\n var xm = x + w / 2; // x-middle\n var ym = y + h / 2; // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n\n context.closePath();\n\n if (data.fill) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n } else if (data.type === _const.SHAPES.RREC) {\n var rx = shape.x;\n var ry = shape.y;\n var width = shape.width;\n var height = shape.height;\n var radius = shape.radius;\n\n var maxRadius = Math.min(width, height) / 2 | 0;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.beginPath();\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n\n if (data.fillColor || data.fillColor === 0) {\n context.globalAlpha = data.fillAlpha * worldAlpha;\n context.fillStyle = '#' + ('00000' + (fillColor | 0).toString(16)).substr(-6);\n context.fill();\n }\n\n if (data.lineWidth) {\n context.globalAlpha = data.lineAlpha * worldAlpha;\n context.strokeStyle = '#' + ('00000' + (lineColor | 0).toString(16)).substr(-6);\n context.stroke();\n }\n }\n }\n };\n\n /**\n * Updates the tint of a graphics object\n *\n * @private\n * @param {PIXI.Graphics} graphics - the graphics that will have its tint updated\n */\n\n\n CanvasGraphicsRenderer.prototype.updateGraphicsTint = function updateGraphicsTint(graphics) {\n graphics._prevTint = graphics.tint;\n\n var tintR = (graphics.tint >> 16 & 0xFF) / 255;\n var tintG = (graphics.tint >> 8 & 0xFF) / 255;\n var tintB = (graphics.tint & 0xFF) / 255;\n\n for (var i = 0; i < graphics.graphicsData.length; ++i) {\n var data = graphics.graphicsData[i];\n\n var fillColor = data.fillColor | 0;\n var lineColor = data.lineColor | 0;\n\n // super inline cos im an optimization NAZI :)\n data._fillTint = ((fillColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((fillColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (fillColor & 0xFF) / 255 * tintB * 255;\n\n data._lineTint = ((lineColor >> 16 & 0xFF) / 255 * tintR * 255 << 16) + ((lineColor >> 8 & 0xFF) / 255 * tintG * 255 << 8) + (lineColor & 0xFF) / 255 * tintB * 255;\n }\n };\n\n /**\n * Renders a polygon.\n *\n * @param {PIXI.Point[]} points - The points to render\n * @param {boolean} close - Should the polygon be closed\n * @param {CanvasRenderingContext2D} context - The rendering context to use\n */\n\n\n CanvasGraphicsRenderer.prototype.renderPolygon = function renderPolygon(points, close, context) {\n context.moveTo(points[0], points[1]);\n\n for (var j = 1; j < points.length / 2; ++j) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n\n if (close) {\n context.closePath();\n }\n };\n\n /**\n * destroy graphics object\n *\n */\n\n\n CanvasGraphicsRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return CanvasGraphicsRenderer;\n}();\n\nexports.default = CanvasGraphicsRenderer;\n\n\n_CanvasRenderer2.default.registerPlugin('graphics', CanvasGraphicsRenderer);\n//# sourceMappingURL=CanvasGraphicsRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/canvas/CanvasGraphicsRenderer.js\n// module id = 521\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.default = bezierCurveTo;\n/**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @param {number} fromX - Starting point x\n * @param {number} fromY - Starting point y\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [path=[]] - Path array to push points into\n * @return {number[]} Array of points of the curve\n */\nfunction bezierCurveTo(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var path = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : [];\n\n var n = 20;\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n\n path.push(fromX, fromY);\n\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n\n dt = 1 - j;\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n\n t2 = j * j;\n t3 = t2 * j;\n\n path.push(dt3 * fromX + 3 * dt2 * j * cpX + 3 * dt * t2 * cpX2 + t3 * toX, dt3 * fromY + 3 * dt2 * j * cpY + 3 * dt * t2 * cpY2 + t3 * toY);\n }\n\n return path;\n}\n//# sourceMappingURL=bezierCurveTo.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/utils/bezierCurveTo.js\n// module id = 522\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _utils = require('../../utils');\n\nvar _const = require('../../const');\n\nvar _ObjectRenderer2 = require('../../renderers/webgl/utils/ObjectRenderer');\n\nvar _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2);\n\nvar _WebGLRenderer = require('../../renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nvar _WebGLGraphicsData = require('./WebGLGraphicsData');\n\nvar _WebGLGraphicsData2 = _interopRequireDefault(_WebGLGraphicsData);\n\nvar _PrimitiveShader = require('./shaders/PrimitiveShader');\n\nvar _PrimitiveShader2 = _interopRequireDefault(_PrimitiveShader);\n\nvar _buildPoly = require('./utils/buildPoly');\n\nvar _buildPoly2 = _interopRequireDefault(_buildPoly);\n\nvar _buildRectangle = require('./utils/buildRectangle');\n\nvar _buildRectangle2 = _interopRequireDefault(_buildRectangle);\n\nvar _buildRoundedRectangle = require('./utils/buildRoundedRectangle');\n\nvar _buildRoundedRectangle2 = _interopRequireDefault(_buildRoundedRectangle);\n\nvar _buildCircle = require('./utils/buildCircle');\n\nvar _buildCircle2 = _interopRequireDefault(_buildCircle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Renders the graphics object.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar GraphicsRenderer = function (_ObjectRenderer) {\n _inherits(GraphicsRenderer, _ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this object renderer works for.\n */\n function GraphicsRenderer(renderer) {\n _classCallCheck(this, GraphicsRenderer);\n\n var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer));\n\n _this.graphicsDataPool = [];\n\n _this.primitiveShader = null;\n\n _this.gl = renderer.gl;\n\n // easy access!\n _this.CONTEXT_UID = 0;\n return _this;\n }\n\n /**\n * Called when there is a WebGL context change\n *\n * @private\n *\n */\n\n\n GraphicsRenderer.prototype.onContextChange = function onContextChange() {\n this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.primitiveShader = new _PrimitiveShader2.default(this.gl);\n };\n\n /**\n * Destroys this renderer.\n *\n */\n\n\n GraphicsRenderer.prototype.destroy = function destroy() {\n _ObjectRenderer3.default.prototype.destroy.call(this);\n\n for (var i = 0; i < this.graphicsDataPool.length; ++i) {\n this.graphicsDataPool[i].destroy();\n }\n\n this.graphicsDataPool = null;\n };\n\n /**\n * Renders a graphics object.\n *\n * @param {PIXI.Graphics} graphics - The graphics object to render.\n */\n\n\n GraphicsRenderer.prototype.render = function render(graphics) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n\n var webGLData = void 0;\n var webGL = graphics._webGL[this.CONTEXT_UID];\n\n if (!webGL || graphics.dirty !== webGL.dirty) {\n this.updateGraphics(graphics);\n\n webGL = graphics._webGL[this.CONTEXT_UID];\n }\n\n // This could be speeded up for sure!\n var shader = this.primitiveShader;\n\n renderer.bindShader(shader);\n renderer.state.setBlendMode(graphics.blendMode);\n\n for (var i = 0, n = webGL.data.length; i < n; i++) {\n webGLData = webGL.data[i];\n var shaderTemp = webGLData.shader;\n\n renderer.bindShader(shaderTemp);\n shaderTemp.uniforms.translationMatrix = graphics.transform.worldTransform.toArray(true);\n shaderTemp.uniforms.tint = (0, _utils.hex2rgb)(graphics.tint);\n shaderTemp.uniforms.alpha = graphics.worldAlpha;\n\n renderer.bindVao(webGLData.vao);\n\n if (webGLData.nativeLines) {\n gl.drawArrays(gl.LINES, 0, webGLData.points.length / 6);\n } else {\n webGLData.vao.draw(gl.TRIANGLE_STRIP, webGLData.indices.length);\n }\n }\n };\n\n /**\n * Updates the graphics object\n *\n * @private\n * @param {PIXI.Graphics} graphics - The graphics object to update\n */\n\n\n GraphicsRenderer.prototype.updateGraphics = function updateGraphics(graphics) {\n var gl = this.renderer.gl;\n\n // get the contexts graphics object\n var webGL = graphics._webGL[this.CONTEXT_UID];\n\n // if the graphics object does not exist in the webGL context time to create it!\n if (!webGL) {\n webGL = graphics._webGL[this.CONTEXT_UID] = { lastIndex: 0, data: [], gl: gl, clearDirty: -1, dirty: -1 };\n }\n\n // flag the graphics as not dirty as we are about to update it...\n webGL.dirty = graphics.dirty;\n\n // if the user cleared the graphics object we will need to clear every object\n if (graphics.clearDirty !== webGL.clearDirty) {\n webGL.clearDirty = graphics.clearDirty;\n\n // loop through and return all the webGLDatas to the object pool so than can be reused later on\n for (var i = 0; i < webGL.data.length; i++) {\n this.graphicsDataPool.push(webGL.data[i]);\n }\n\n // clear the array and reset the index..\n webGL.data.length = 0;\n webGL.lastIndex = 0;\n }\n\n var webGLData = void 0;\n var webGLDataNativeLines = void 0;\n\n // loop through the graphics datas and construct each one..\n // if the object is a complex fill then the new stencil buffer technique will be used\n // other wise graphics objects will be pushed into a batch..\n for (var _i = webGL.lastIndex; _i < graphics.graphicsData.length; _i++) {\n var data = graphics.graphicsData[_i];\n\n // TODO - this can be simplified\n webGLData = this.getWebGLData(webGL, 0);\n\n if (data.nativeLines && data.lineWidth) {\n webGLDataNativeLines = this.getWebGLData(webGL, 0, true);\n webGL.lastIndex++;\n }\n\n if (data.type === _const.SHAPES.POLY) {\n (0, _buildPoly2.default)(data, webGLData, webGLDataNativeLines);\n }\n if (data.type === _const.SHAPES.RECT) {\n (0, _buildRectangle2.default)(data, webGLData, webGLDataNativeLines);\n } else if (data.type === _const.SHAPES.CIRC || data.type === _const.SHAPES.ELIP) {\n (0, _buildCircle2.default)(data, webGLData, webGLDataNativeLines);\n } else if (data.type === _const.SHAPES.RREC) {\n (0, _buildRoundedRectangle2.default)(data, webGLData, webGLDataNativeLines);\n }\n\n webGL.lastIndex++;\n }\n\n this.renderer.bindVao(null);\n\n // upload all the dirty data...\n for (var _i2 = 0; _i2 < webGL.data.length; _i2++) {\n webGLData = webGL.data[_i2];\n\n if (webGLData.dirty) {\n webGLData.upload();\n }\n }\n };\n\n /**\n *\n * @private\n * @param {WebGLRenderingContext} gl - the current WebGL drawing context\n * @param {number} type - TODO @Alvin\n * @param {number} nativeLines - indicate whether the webGLData use for nativeLines.\n * @return {*} TODO\n */\n\n\n GraphicsRenderer.prototype.getWebGLData = function getWebGLData(gl, type, nativeLines) {\n var webGLData = gl.data[gl.data.length - 1];\n\n if (!webGLData || webGLData.nativeLines !== nativeLines || webGLData.points.length > 320000) {\n webGLData = this.graphicsDataPool.pop() || new _WebGLGraphicsData2.default(this.renderer.gl, this.primitiveShader, this.renderer.state.attribsState);\n webGLData.nativeLines = nativeLines;\n webGLData.reset(type);\n gl.data.push(webGLData);\n }\n\n webGLData.dirty = true;\n\n return webGLData;\n };\n\n return GraphicsRenderer;\n}(_ObjectRenderer3.default);\n\nexports.default = GraphicsRenderer;\n\n\n_WebGLRenderer2.default.registerPlugin('graphics', GraphicsRenderer);\n//# sourceMappingURL=GraphicsRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/GraphicsRenderer.js\n// module id = 523\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * An object containing WebGL specific properties to be used by the WebGL renderer\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar WebGLGraphicsData = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {PIXI.Shader} shader - The shader\n * @param {object} attribsState - The state for the VAO\n */\n function WebGLGraphicsData(gl, shader, attribsState) {\n _classCallCheck(this, WebGLGraphicsData);\n\n /**\n * The current WebGL drawing context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n // TODO does this need to be split before uploading??\n /**\n * An array of color components (r,g,b)\n * @member {number[]}\n */\n this.color = [0, 0, 0]; // color split!\n\n /**\n * An array of points to draw\n * @member {PIXI.Point[]}\n */\n this.points = [];\n\n /**\n * The indices of the vertices\n * @member {number[]}\n */\n this.indices = [];\n /**\n * The main buffer\n * @member {WebGLBuffer}\n */\n this.buffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl);\n\n /**\n * The index buffer\n * @member {WebGLBuffer}\n */\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl);\n\n /**\n * Whether this graphics is dirty or not\n * @member {boolean}\n */\n this.dirty = true;\n\n /**\n * Whether this graphics is nativeLines or not\n * @member {boolean}\n */\n this.nativeLines = false;\n\n this.glPoints = null;\n this.glIndices = null;\n\n /**\n *\n * @member {PIXI.Shader}\n */\n this.shader = shader;\n\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl, attribsState).addIndex(this.indexBuffer).addAttribute(this.buffer, shader.attributes.aVertexPosition, gl.FLOAT, false, 4 * 6, 0).addAttribute(this.buffer, shader.attributes.aColor, gl.FLOAT, false, 4 * 6, 2 * 4);\n }\n\n /**\n * Resets the vertices and the indices\n */\n\n\n WebGLGraphicsData.prototype.reset = function reset() {\n this.points.length = 0;\n this.indices.length = 0;\n };\n\n /**\n * Binds the buffers and uploads the data\n */\n\n\n WebGLGraphicsData.prototype.upload = function upload() {\n this.glPoints = new Float32Array(this.points);\n this.buffer.upload(this.glPoints);\n\n this.glIndices = new Uint16Array(this.indices);\n this.indexBuffer.upload(this.glIndices);\n\n this.dirty = false;\n };\n\n /**\n * Empties all the data\n */\n\n\n WebGLGraphicsData.prototype.destroy = function destroy() {\n this.color = null;\n this.points = null;\n this.indices = null;\n\n this.vao.destroy();\n this.buffer.destroy();\n this.indexBuffer.destroy();\n\n this.gl = null;\n\n this.buffer = null;\n this.indexBuffer = null;\n\n this.glPoints = null;\n this.glIndices = null;\n };\n\n return WebGLGraphicsData;\n}();\n\nexports.default = WebGLGraphicsData;\n//# sourceMappingURL=WebGLGraphicsData.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/WebGLGraphicsData.js\n// module id = 524\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Shader2 = require('../../../Shader');\n\nvar _Shader3 = _interopRequireDefault(_Shader2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * This shader is used to draw simple primitive shapes for {@link PIXI.Graphics}.\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nvar PrimitiveShader = function (_Shader) {\n _inherits(PrimitiveShader, _Shader);\n\n /**\n * @param {WebGLRenderingContext} gl - The webgl shader manager this shader works for.\n */\n function PrimitiveShader(gl) {\n _classCallCheck(this, PrimitiveShader);\n\n return _possibleConstructorReturn(this, _Shader.call(this, gl,\n // vertex shader\n ['attribute vec2 aVertexPosition;', 'attribute vec4 aColor;', 'uniform mat3 translationMatrix;', 'uniform mat3 projectionMatrix;', 'uniform float alpha;', 'uniform vec3 tint;', 'varying vec4 vColor;', 'void main(void){', ' gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);', ' vColor = aColor * vec4(tint * alpha, alpha);', '}'].join('\\n'),\n // fragment shader\n ['varying vec4 vColor;', 'void main(void){', ' gl_FragColor = vColor;', '}'].join('\\n')));\n }\n\n return PrimitiveShader;\n}(_Shader3.default);\n\nexports.default = PrimitiveShader;\n//# sourceMappingURL=PrimitiveShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/shaders/PrimitiveShader.js\n// module id = 525\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildCircle;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _const = require('../../../const');\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildCircle(graphicsData, webGLData, webGLDataNativeLines) {\n // need to convert points to a nice regular data\n var circleData = graphicsData.shape;\n var x = circleData.x;\n var y = circleData.y;\n var width = void 0;\n var height = void 0;\n\n // TODO - bit hacky??\n if (graphicsData.type === _const.SHAPES.CIRC) {\n width = circleData.radius;\n height = circleData.radius;\n } else {\n width = circleData.width;\n height = circleData.height;\n }\n\n if (width === 0 || height === 0) {\n return;\n }\n\n var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius)) || Math.floor(15 * Math.sqrt(circleData.width + circleData.height));\n\n var seg = Math.PI * 2 / totalSegs;\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vecPos = verts.length / 6;\n\n indices.push(vecPos);\n\n for (var i = 0; i < totalSegs + 1; i++) {\n verts.push(x, y, r, g, b, alpha);\n\n verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha);\n\n indices.push(vecPos++, vecPos++);\n }\n\n indices.push(vecPos - 1);\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = [];\n\n for (var _i = 0; _i < totalSegs + 1; _i++) {\n graphicsData.points.push(x + Math.sin(seg * _i) * width, y + Math.cos(seg * _i) * height);\n }\n\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n\n graphicsData.points = tempPoints;\n }\n}\n//# sourceMappingURL=buildCircle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildCircle.js\n// module id = 526\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildPoly;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildPoly(graphicsData, webGLData, webGLDataNativeLines) {\n graphicsData.points = graphicsData.shape.points.slice();\n\n var points = graphicsData.points;\n\n if (graphicsData.fill && points.length >= 6) {\n var holeArray = [];\n // Process holes..\n var holes = graphicsData.holes;\n\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n\n holeArray.push(points.length / 2);\n\n points = points.concat(hole.points);\n }\n\n // get first and last point.. figure out the middle!\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var length = points.length / 2;\n\n // sort color\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var triangles = (0, _earcut2.default)(points, holeArray, 2);\n\n if (!triangles) {\n return;\n }\n\n var vertPos = verts.length / 6;\n\n for (var _i = 0; _i < triangles.length; _i += 3) {\n indices.push(triangles[_i] + vertPos);\n indices.push(triangles[_i] + vertPos);\n indices.push(triangles[_i + 1] + vertPos);\n indices.push(triangles[_i + 2] + vertPos);\n indices.push(triangles[_i + 2] + vertPos);\n }\n\n for (var _i2 = 0; _i2 < length; _i2++) {\n verts.push(points[_i2 * 2], points[_i2 * 2 + 1], r, g, b, alpha);\n }\n }\n\n if (graphicsData.lineWidth > 0) {\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n }\n}\n//# sourceMappingURL=buildPoly.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildPoly.js\n// module id = 527\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildRectangle;\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildRectangle(graphicsData, webGLData, webGLDataNativeLines) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vertPos = verts.length / 6;\n\n // start\n verts.push(x, y);\n verts.push(r, g, b, alpha);\n\n verts.push(x + width, y);\n verts.push(r, g, b, alpha);\n\n verts.push(x, y + height);\n verts.push(r, g, b, alpha);\n\n verts.push(x + width, y + height);\n verts.push(r, g, b, alpha);\n\n // insert 2 dead triangles..\n indices.push(vertPos, vertPos, vertPos + 1, vertPos + 2, vertPos + 3, vertPos + 3);\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y];\n\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n\n graphicsData.points = tempPoints;\n }\n}\n//# sourceMappingURL=buildRectangle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildRectangle.js\n// module id = 528\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = buildRoundedRectangle;\n\nvar _earcut = require('earcut');\n\nvar _earcut2 = _interopRequireDefault(_earcut);\n\nvar _buildLine = require('./buildLine');\n\nvar _buildLine2 = _interopRequireDefault(_buildLine);\n\nvar _utils = require('../../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the webGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the webGL-specific information to create nativeLines\n */\nfunction buildRoundedRectangle(graphicsData, webGLData, webGLDataNativeLines) {\n var rrectData = graphicsData.shape;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n\n var radius = rrectData.radius;\n\n var recPoints = [];\n\n recPoints.push(x, y + radius);\n quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints);\n quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints);\n quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints);\n quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints);\n\n // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item.\n // TODO - fix this properly, this is not very elegant.. but it works for now.\n\n if (graphicsData.fill) {\n var color = (0, _utils.hex2rgb)(graphicsData.fillColor);\n var alpha = graphicsData.fillAlpha;\n\n var r = color[0] * alpha;\n var g = color[1] * alpha;\n var b = color[2] * alpha;\n\n var verts = webGLData.points;\n var indices = webGLData.indices;\n\n var vecPos = verts.length / 6;\n\n var triangles = (0, _earcut2.default)(recPoints, null, 2);\n\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n\n for (var _i = 0, _j = recPoints.length; _i < _j; _i++) {\n verts.push(recPoints[_i], recPoints[++_i], r, g, b, alpha);\n }\n }\n\n if (graphicsData.lineWidth) {\n var tempPoints = graphicsData.points;\n\n graphicsData.points = recPoints;\n\n (0, _buildLine2.default)(graphicsData, webGLData, webGLDataNativeLines);\n\n graphicsData.points = tempPoints;\n }\n}\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @return {number} the result\n *\n */\nfunction getPt(n1, n2, perc) {\n var diff = n2 - n1;\n\n return n1 + diff * perc;\n}\n\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @return {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY) {\n var out = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : [];\n\n var n = 20;\n var points = out;\n\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n\n points.push(x, y);\n }\n\n return points;\n}\n//# sourceMappingURL=buildRoundedRectangle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/graphics/webgl/utils/buildRoundedRectangle.js\n// module id = 529\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Rectangle = require('./Rectangle');\n\nvar _Rectangle2 = _interopRequireDefault(_Rectangle);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Circle object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nvar Circle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [radius=0] - The radius of the circle\n */\n function Circle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n _classCallCheck(this, Circle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.CIRC;\n }\n\n /**\n * Creates a clone of this Circle instance\n *\n * @return {PIXI.Circle} a copy of the Circle\n */\n\n\n Circle.prototype.clone = function clone() {\n return new Circle(this.x, this.y, this.radius);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Circle\n */\n\n\n Circle.prototype.contains = function contains(x, y) {\n if (this.radius <= 0) {\n return false;\n }\n\n var r2 = this.radius * this.radius;\n var dx = this.x - x;\n var dy = this.y - y;\n\n dx *= dx;\n dy *= dy;\n\n return dx + dy <= r2;\n };\n\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n\n\n Circle.prototype.getBounds = function getBounds() {\n return new _Rectangle2.default(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n };\n\n return Circle;\n}();\n\nexports.default = Circle;\n//# sourceMappingURL=Circle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/Circle.js\n// module id = 530\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Rectangle = require('./Rectangle');\n\nvar _Rectangle2 = _interopRequireDefault(_Rectangle);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Ellipse object can be used to specify a hit area for displayObjects\n *\n * @class\n * @memberof PIXI\n */\nvar Ellipse = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [width=0] - The half width of this ellipse\n * @param {number} [height=0] - The half height of this ellipse\n */\n function Ellipse() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, Ellipse);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.ELIP;\n }\n\n /**\n * Creates a clone of this Ellipse instance\n *\n * @return {PIXI.Ellipse} a copy of the ellipse\n */\n\n\n Ellipse.prototype.clone = function clone() {\n return new Ellipse(this.x, this.y, this.width, this.height);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coords are within this ellipse\n */\n\n\n Ellipse.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n\n // normalize the coords to an ellipse with center 0,0\n var normx = (x - this.x) / this.width;\n var normy = (y - this.y) / this.height;\n\n normx *= normx;\n normy *= normy;\n\n return normx + normy <= 1;\n };\n\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n\n\n Ellipse.prototype.getBounds = function getBounds() {\n return new _Rectangle2.default(this.x - this.width, this.y - this.height, this.width, this.height);\n };\n\n return Ellipse;\n}();\n\nexports.default = Ellipse;\n//# sourceMappingURL=Ellipse.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/Ellipse.js\n// module id = 531\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Point = require('../Point');\n\nvar _Point2 = _interopRequireDefault(_Point);\n\nvar _const = require('../../const');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar Polygon = function () {\n /**\n * @param {PIXI.Point[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n function Polygon() {\n for (var _len = arguments.length, points = Array(_len), _key = 0; _key < _len; _key++) {\n points[_key] = arguments[_key];\n }\n\n _classCallCheck(this, Polygon);\n\n if (Array.isArray(points[0])) {\n points = points[0];\n }\n\n // if this is an array of points, convert it to a flat array of numbers\n if (points[0] instanceof _Point2.default) {\n var p = [];\n\n for (var i = 0, il = points.length; i < il; i++) {\n p.push(points[i].x, points[i].y);\n }\n\n points = p;\n }\n\n this.closed = true;\n\n /**\n * An array of the points of this polygon\n *\n * @member {number[]}\n */\n this.points = points;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.POLY;\n }\n\n /**\n * Creates a clone of this polygon\n *\n * @return {PIXI.Polygon} a copy of the polygon\n */\n\n\n Polygon.prototype.clone = function clone() {\n return new Polygon(this.points.slice());\n };\n\n /**\n * Closes the polygon, adding points if necessary.\n *\n */\n\n\n Polygon.prototype.close = function close() {\n var points = this.points;\n\n // close the poly if the value is true!\n if (points[0] !== points[points.length - 2] || points[1] !== points[points.length - 1]) {\n points.push(points[0], points[1]);\n }\n };\n\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this polygon\n */\n\n\n Polygon.prototype.contains = function contains(x, y) {\n var inside = false;\n\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n var length = this.points.length / 2;\n\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var xi = this.points[i * 2];\n var yi = this.points[i * 2 + 1];\n var xj = this.points[j * 2];\n var yj = this.points[j * 2 + 1];\n var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi;\n\n if (intersect) {\n inside = !inside;\n }\n }\n\n return inside;\n };\n\n return Polygon;\n}();\n\nexports.default = Polygon;\n//# sourceMappingURL=Polygon.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/Polygon.js\n// module id = 532\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nvar RoundedRectangle = function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [width=0] - The overall width of this rounded rectangle\n * @param {number} [height=0] - The overall height of this rounded rectangle\n * @param {number} [radius=20] - Controls the radius of the rounded corners\n */\n function RoundedRectangle() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var radius = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 20;\n\n _classCallCheck(this, RoundedRectangle);\n\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n\n /**\n * @member {number}\n * @default 20\n */\n this.radius = radius;\n\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readonly\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n this.type = _const.SHAPES.RREC;\n }\n\n /**\n * Creates a clone of this Rounded Rectangle\n *\n * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n */\n\n\n RoundedRectangle.prototype.clone = function clone() {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n };\n\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n */\n\n\n RoundedRectangle.prototype.contains = function contains(x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n if (y >= this.y + this.radius && y <= this.y + this.height - this.radius || x >= this.x + this.radius && x <= this.x + this.width - this.radius) {\n return true;\n }\n var dx = x - (this.x + this.radius);\n var dy = y - (this.y + this.radius);\n var radius2 = this.radius * this.radius;\n\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n dx = x - (this.x + this.radius);\n if (dx * dx + dy * dy <= radius2) {\n return true;\n }\n }\n }\n\n return false;\n };\n\n return RoundedRectangle;\n}();\n\nexports.default = RoundedRectangle;\n//# sourceMappingURL=RoundedRectangle.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/math/shapes/RoundedRectangle.js\n// module id = 533\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../../const');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A set of functions used to handle masking.\n *\n * @class\n * @memberof PIXI\n */\nvar CanvasMaskManager = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer.\n */\n function CanvasMaskManager(renderer) {\n _classCallCheck(this, CanvasMaskManager);\n\n this.renderer = renderer;\n }\n\n /**\n * This method adds it to the current stack of masks.\n *\n * @param {object} maskData - the maskData that will be pushed\n */\n\n\n CanvasMaskManager.prototype.pushMask = function pushMask(maskData) {\n var renderer = this.renderer;\n\n renderer.context.save();\n\n var cacheAlpha = maskData.alpha;\n var transform = maskData.transform.worldTransform;\n var resolution = renderer.resolution;\n\n renderer.context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n // TODO suport sprite alpha masks??\n // lots of effort required. If demand is great enough..\n if (!maskData._texture) {\n this.renderGraphicsShape(maskData);\n renderer.context.clip();\n }\n\n maskData.worldAlpha = cacheAlpha;\n };\n\n /**\n * Renders a PIXI.Graphics shape.\n *\n * @param {PIXI.Graphics} graphics - The object to render.\n */\n\n\n CanvasMaskManager.prototype.renderGraphicsShape = function renderGraphicsShape(graphics) {\n var context = this.renderer.context;\n var len = graphics.graphicsData.length;\n\n if (len === 0) {\n return;\n }\n\n context.beginPath();\n\n for (var i = 0; i < len; i++) {\n var data = graphics.graphicsData[i];\n var shape = data.shape;\n\n if (data.type === _const.SHAPES.POLY) {\n var points = shape.points;\n\n context.moveTo(points[0], points[1]);\n\n for (var j = 1; j < points.length / 2; j++) {\n context.lineTo(points[j * 2], points[j * 2 + 1]);\n }\n\n // if the first and last point are the same close the path - much neater :)\n if (points[0] === points[points.length - 2] && points[1] === points[points.length - 1]) {\n context.closePath();\n }\n } else if (data.type === _const.SHAPES.RECT) {\n context.rect(shape.x, shape.y, shape.width, shape.height);\n context.closePath();\n } else if (data.type === _const.SHAPES.CIRC) {\n // TODO - need to be Undefined!\n context.arc(shape.x, shape.y, shape.radius, 0, 2 * Math.PI);\n context.closePath();\n } else if (data.type === _const.SHAPES.ELIP) {\n // ellipse code taken from: http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n\n var w = shape.width * 2;\n var h = shape.height * 2;\n\n var x = shape.x - w / 2;\n var y = shape.y - h / 2;\n\n var kappa = 0.5522848;\n var ox = w / 2 * kappa; // control point offset horizontal\n var oy = h / 2 * kappa; // control point offset vertical\n var xe = x + w; // x-end\n var ye = y + h; // y-end\n var xm = x + w / 2; // x-middle\n var ym = y + h / 2; // y-middle\n\n context.moveTo(x, ym);\n context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n context.closePath();\n } else if (data.type === _const.SHAPES.RREC) {\n var rx = shape.x;\n var ry = shape.y;\n var width = shape.width;\n var height = shape.height;\n var radius = shape.radius;\n\n var maxRadius = Math.min(width, height) / 2 | 0;\n\n radius = radius > maxRadius ? maxRadius : radius;\n\n context.moveTo(rx, ry + radius);\n context.lineTo(rx, ry + height - radius);\n context.quadraticCurveTo(rx, ry + height, rx + radius, ry + height);\n context.lineTo(rx + width - radius, ry + height);\n context.quadraticCurveTo(rx + width, ry + height, rx + width, ry + height - radius);\n context.lineTo(rx + width, ry + radius);\n context.quadraticCurveTo(rx + width, ry, rx + width - radius, ry);\n context.lineTo(rx + radius, ry);\n context.quadraticCurveTo(rx, ry, rx, ry + radius);\n context.closePath();\n }\n }\n };\n\n /**\n * Restores the current drawing context to the state it was before the mask was applied.\n *\n * @param {PIXI.CanvasRenderer} renderer - The renderer context to use.\n */\n\n\n CanvasMaskManager.prototype.popMask = function popMask(renderer) {\n renderer.context.restore();\n renderer.invalidateBlendMode();\n };\n\n /**\n * Destroys this canvas mask manager.\n *\n */\n\n\n CanvasMaskManager.prototype.destroy = function destroy() {\n /* empty */\n };\n\n return CanvasMaskManager;\n}();\n\nexports.default = CanvasMaskManager;\n//# sourceMappingURL=CanvasMaskManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/CanvasMaskManager.js\n// module id = 534\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapCanvasBlendModesToPixi;\n\nvar _const = require('../../../const');\n\nvar _canUseNewCanvasBlendModes = require('./canUseNewCanvasBlendModes');\n\nvar _canUseNewCanvasBlendModes2 = _interopRequireDefault(_canUseNewCanvasBlendModes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Maps blend combinations to Canvas.\n *\n * @memberof PIXI\n * @function mapCanvasBlendModesToPixi\n * @private\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nfunction mapCanvasBlendModesToPixi() {\n var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if ((0, _canUseNewCanvasBlendModes2.default)()) {\n array[_const.BLEND_MODES.NORMAL] = 'source-over';\n array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[_const.BLEND_MODES.MULTIPLY] = 'multiply';\n array[_const.BLEND_MODES.SCREEN] = 'screen';\n array[_const.BLEND_MODES.OVERLAY] = 'overlay';\n array[_const.BLEND_MODES.DARKEN] = 'darken';\n array[_const.BLEND_MODES.LIGHTEN] = 'lighten';\n array[_const.BLEND_MODES.COLOR_DODGE] = 'color-dodge';\n array[_const.BLEND_MODES.COLOR_BURN] = 'color-burn';\n array[_const.BLEND_MODES.HARD_LIGHT] = 'hard-light';\n array[_const.BLEND_MODES.SOFT_LIGHT] = 'soft-light';\n array[_const.BLEND_MODES.DIFFERENCE] = 'difference';\n array[_const.BLEND_MODES.EXCLUSION] = 'exclusion';\n array[_const.BLEND_MODES.HUE] = 'hue';\n array[_const.BLEND_MODES.SATURATION] = 'saturate';\n array[_const.BLEND_MODES.COLOR] = 'color';\n array[_const.BLEND_MODES.LUMINOSITY] = 'luminosity';\n } else {\n // this means that the browser does not support the cool new blend modes in canvas 'cough' ie 'cough'\n array[_const.BLEND_MODES.NORMAL] = 'source-over';\n array[_const.BLEND_MODES.ADD] = 'lighter'; // IS THIS OK???\n array[_const.BLEND_MODES.MULTIPLY] = 'source-over';\n array[_const.BLEND_MODES.SCREEN] = 'source-over';\n array[_const.BLEND_MODES.OVERLAY] = 'source-over';\n array[_const.BLEND_MODES.DARKEN] = 'source-over';\n array[_const.BLEND_MODES.LIGHTEN] = 'source-over';\n array[_const.BLEND_MODES.COLOR_DODGE] = 'source-over';\n array[_const.BLEND_MODES.COLOR_BURN] = 'source-over';\n array[_const.BLEND_MODES.HARD_LIGHT] = 'source-over';\n array[_const.BLEND_MODES.SOFT_LIGHT] = 'source-over';\n array[_const.BLEND_MODES.DIFFERENCE] = 'source-over';\n array[_const.BLEND_MODES.EXCLUSION] = 'source-over';\n array[_const.BLEND_MODES.HUE] = 'source-over';\n array[_const.BLEND_MODES.SATURATION] = 'source-over';\n array[_const.BLEND_MODES.COLOR] = 'source-over';\n array[_const.BLEND_MODES.LUMINOSITY] = 'source-over';\n }\n // not-premultiplied, only for webgl\n array[_const.BLEND_MODES.NORMAL_NPM] = array[_const.BLEND_MODES.NORMAL];\n array[_const.BLEND_MODES.ADD_NPM] = array[_const.BLEND_MODES.ADD];\n array[_const.BLEND_MODES.SCREEN_NPM] = array[_const.BLEND_MODES.SCREEN];\n\n return array;\n}\n//# sourceMappingURL=mapCanvasBlendModesToPixi.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/canvas/utils/mapCanvasBlendModesToPixi.js\n// module id = 535\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _const = require('../../const');\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TextureGarbageCollector. This class manages the GPU and ensures that it does not get clogged\n * up with textures that are no longer being used.\n *\n * @class\n * @memberof PIXI\n */\nvar TextureGarbageCollector = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function TextureGarbageCollector(renderer) {\n _classCallCheck(this, TextureGarbageCollector);\n\n this.renderer = renderer;\n\n this.count = 0;\n this.checkCount = 0;\n this.maxIdle = _settings2.default.GC_MAX_IDLE;\n this.checkCountMax = _settings2.default.GC_MAX_CHECK_COUNT;\n this.mode = _settings2.default.GC_MODE;\n }\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n\n\n TextureGarbageCollector.prototype.update = function update() {\n this.count++;\n\n if (this.mode === _const.GC_MODES.MANUAL) {\n return;\n }\n\n this.checkCount++;\n\n if (this.checkCount > this.checkCountMax) {\n this.checkCount = 0;\n\n this.run();\n }\n };\n\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n\n\n TextureGarbageCollector.prototype.run = function run() {\n var tm = this.renderer.textureManager;\n var managedTextures = tm._managedTextures;\n var wasRemoved = false;\n\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n\n // only supports non generated textures at the moment!\n if (!texture._glRenderTargets && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n\n if (wasRemoved) {\n var j = 0;\n\n for (var _i = 0; _i < managedTextures.length; _i++) {\n if (managedTextures[_i] !== null) {\n managedTextures[j++] = managedTextures[_i];\n }\n }\n\n managedTextures.length = j;\n }\n };\n\n /**\n * Removes all the textures within the specified displayObject and its children from the GPU\n *\n * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n */\n\n\n TextureGarbageCollector.prototype.unload = function unload(displayObject) {\n var tm = this.renderer.textureManager;\n\n // only destroy non generated textures\n if (displayObject._texture && displayObject._texture._glRenderTargets) {\n tm.destroyTexture(displayObject._texture, true);\n }\n\n for (var i = displayObject.children.length - 1; i >= 0; i--) {\n this.unload(displayObject.children[i]);\n }\n };\n\n return TextureGarbageCollector;\n}();\n\nexports.default = TextureGarbageCollector;\n//# sourceMappingURL=TextureGarbageCollector.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/TextureGarbageCollector.js\n// module id = 536\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _const = require('../../const');\n\nvar _RenderTarget = require('./utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _utils = require('../../utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Helper class to create a webGL Texture\n *\n * @class\n * @memberof PIXI\n */\nvar TextureManager = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function TextureManager(renderer) {\n _classCallCheck(this, TextureManager);\n\n /**\n * A reference to the current renderer\n *\n * @member {PIXI.WebGLRenderer}\n */\n this.renderer = renderer;\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = renderer.gl;\n\n /**\n * Track textures in the renderer so we can no longer listen to them on destruction.\n *\n * @member {Array<*>}\n * @private\n */\n this._managedTextures = [];\n }\n\n /**\n * Binds a texture.\n *\n */\n\n\n TextureManager.prototype.bindTexture = function bindTexture() {}\n // empty\n\n\n /**\n * Gets a texture.\n *\n */\n ;\n\n TextureManager.prototype.getTexture = function getTexture() {}\n // empty\n\n\n /**\n * Updates and/or Creates a WebGL texture for the renderer's context.\n *\n * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to update\n * @param {number} location - the location the texture will be bound to.\n * @return {GLTexture} The gl texture.\n */\n ;\n\n TextureManager.prototype.updateTexture = function updateTexture(texture, location) {\n // assume it good!\n // texture = texture.baseTexture || texture;\n\n var gl = this.gl;\n\n var isRenderTexture = !!texture._glRenderTargets;\n\n if (!texture.hasLoaded) {\n return null;\n }\n\n var boundTextures = this.renderer.boundTextures;\n\n // if the location is undefined then this may have been called by n event.\n // this being the case the texture may already be bound to a slot. As a texture can only be bound once\n // we need to find its current location if it exists.\n if (location === undefined) {\n location = 0;\n\n // TODO maybe we can use texture bound ids later on...\n // check if texture is already bound..\n for (var i = 0; i < boundTextures.length; ++i) {\n if (boundTextures[i] === texture) {\n location = i;\n break;\n }\n }\n }\n\n boundTextures[location] = texture;\n\n gl.activeTexture(gl.TEXTURE0 + location);\n\n var glTexture = texture._glTextures[this.renderer.CONTEXT_UID];\n\n if (!glTexture) {\n if (isRenderTexture) {\n var renderTarget = new _RenderTarget2.default(this.gl, texture.width, texture.height, texture.scaleMode, texture.resolution);\n\n renderTarget.resize(texture.width, texture.height);\n texture._glRenderTargets[this.renderer.CONTEXT_UID] = renderTarget;\n glTexture = renderTarget.texture;\n } else {\n glTexture = new _pixiGlCore.GLTexture(this.gl, null, null, null, null);\n glTexture.bind(location);\n glTexture.premultiplyAlpha = true;\n glTexture.upload(texture.source);\n }\n\n texture._glTextures[this.renderer.CONTEXT_UID] = glTexture;\n\n texture.on('update', this.updateTexture, this);\n texture.on('dispose', this.destroyTexture, this);\n\n this._managedTextures.push(texture);\n\n if (texture.isPowerOfTwo) {\n if (texture.mipmap) {\n glTexture.enableMipmap();\n }\n\n if (texture.wrapMode === _const.WRAP_MODES.CLAMP) {\n glTexture.enableWrapClamp();\n } else if (texture.wrapMode === _const.WRAP_MODES.REPEAT) {\n glTexture.enableWrapRepeat();\n } else {\n glTexture.enableWrapMirrorRepeat();\n }\n } else {\n glTexture.enableWrapClamp();\n }\n\n if (texture.scaleMode === _const.SCALE_MODES.NEAREST) {\n glTexture.enableNearestScaling();\n } else {\n glTexture.enableLinearScaling();\n }\n }\n // the texture already exists so we only need to update it..\n else if (isRenderTexture) {\n texture._glRenderTargets[this.renderer.CONTEXT_UID].resize(texture.width, texture.height);\n } else {\n glTexture.upload(texture.source);\n }\n\n return glTexture;\n };\n\n /**\n * Deletes the texture from WebGL\n *\n * @param {PIXI.BaseTexture|PIXI.Texture} texture - the texture to destroy\n * @param {boolean} [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n */\n\n\n TextureManager.prototype.destroyTexture = function destroyTexture(texture, skipRemove) {\n texture = texture.baseTexture || texture;\n\n if (!texture.hasLoaded) {\n return;\n }\n\n var uid = this.renderer.CONTEXT_UID;\n var glTextures = texture._glTextures;\n var glRenderTargets = texture._glRenderTargets;\n\n if (glTextures[uid]) {\n this.renderer.unbindTexture(texture);\n\n glTextures[uid].destroy();\n texture.off('update', this.updateTexture, this);\n texture.off('dispose', this.destroyTexture, this);\n\n delete glTextures[uid];\n\n if (!skipRemove) {\n var i = this._managedTextures.indexOf(texture);\n\n if (i !== -1) {\n (0, _utils.removeItems)(this._managedTextures, i, 1);\n }\n }\n }\n\n if (glRenderTargets && glRenderTargets[uid]) {\n glRenderTargets[uid].destroy();\n delete glRenderTargets[uid];\n }\n };\n\n /**\n * Deletes all the textures from WebGL\n */\n\n\n TextureManager.prototype.removeAll = function removeAll() {\n // empty all the old gl textures as they are useless now\n for (var i = 0; i < this._managedTextures.length; ++i) {\n var texture = this._managedTextures[i];\n\n if (texture._glTextures[this.renderer.CONTEXT_UID]) {\n delete texture._glTextures[this.renderer.CONTEXT_UID];\n }\n }\n };\n\n /**\n * Destroys this manager and removes all its textures\n */\n\n\n TextureManager.prototype.destroy = function destroy() {\n // destroy managed textures\n for (var i = 0; i < this._managedTextures.length; ++i) {\n var texture = this._managedTextures[i];\n\n this.destroyTexture(texture, true);\n\n texture.off('update', this.updateTexture, this);\n texture.off('dispose', this.destroyTexture, this);\n }\n\n this._managedTextures = null;\n };\n\n return TextureManager;\n}();\n\nexports.default = TextureManager;\n//# sourceMappingURL=TextureManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/TextureManager.js\n// module id = 537\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _mapWebGLBlendModesToPixi = require('./utils/mapWebGLBlendModesToPixi');\n\nvar _mapWebGLBlendModesToPixi2 = _interopRequireDefault(_mapWebGLBlendModesToPixi);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BLEND = 0;\nvar DEPTH_TEST = 1;\nvar FRONT_FACE = 2;\nvar CULL_FACE = 3;\nvar BLEND_FUNC = 4;\n\n/**\n * A WebGL state machines\n *\n * @memberof PIXI\n * @class\n */\n\nvar WebGLState = function () {\n /**\n * @param {WebGLRenderingContext} gl - The current WebGL rendering context\n */\n function WebGLState(gl) {\n _classCallCheck(this, WebGLState);\n\n /**\n * The current active state\n *\n * @member {Uint8Array}\n */\n this.activeState = new Uint8Array(16);\n\n /**\n * The default state\n *\n * @member {Uint8Array}\n */\n this.defaultState = new Uint8Array(16);\n\n // default blend mode..\n this.defaultState[0] = 1;\n\n /**\n * The current state index in the stack\n *\n * @member {number}\n * @private\n */\n this.stackIndex = 0;\n\n /**\n * The stack holding all the different states\n *\n * @member {Array<*>}\n * @private\n */\n this.stack = [];\n\n /**\n * The current WebGL rendering context\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n this.maxAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\n this.attribState = {\n tempAttribState: new Array(this.maxAttribs),\n attribState: new Array(this.maxAttribs)\n };\n\n this.blendModes = (0, _mapWebGLBlendModesToPixi2.default)(gl);\n\n // check we have vao..\n this.nativeVaoExtension = gl.getExtension('OES_vertex_array_object') || gl.getExtension('MOZ_OES_vertex_array_object') || gl.getExtension('WEBKIT_OES_vertex_array_object');\n }\n\n /**\n * Pushes a new active state\n */\n\n\n WebGLState.prototype.push = function push() {\n // next state..\n var state = this.stack[this.stackIndex];\n\n if (!state) {\n state = this.stack[this.stackIndex] = new Uint8Array(16);\n }\n\n ++this.stackIndex;\n\n // copy state..\n // set active state so we can force overrides of gl state\n for (var i = 0; i < this.activeState.length; i++) {\n state[i] = this.activeState[i];\n }\n };\n\n /**\n * Pops a state out\n */\n\n\n WebGLState.prototype.pop = function pop() {\n var state = this.stack[--this.stackIndex];\n\n this.setState(state);\n };\n\n /**\n * Sets the current state\n *\n * @param {*} state - The state to set.\n */\n\n\n WebGLState.prototype.setState = function setState(state) {\n this.setBlend(state[BLEND]);\n this.setDepthTest(state[DEPTH_TEST]);\n this.setFrontFace(state[FRONT_FACE]);\n this.setCullFace(state[CULL_FACE]);\n this.setBlendMode(state[BLEND_FUNC]);\n };\n\n /**\n * Enables or disabled blending.\n *\n * @param {boolean} value - Turn on or off webgl blending.\n */\n\n\n WebGLState.prototype.setBlend = function setBlend(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[BLEND] === value) {\n return;\n }\n\n this.activeState[BLEND] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n };\n\n /**\n * Sets the blend mode.\n *\n * @param {number} value - The blend mode to set to.\n */\n\n\n WebGLState.prototype.setBlendMode = function setBlendMode(value) {\n if (value === this.activeState[BLEND_FUNC]) {\n return;\n }\n\n this.activeState[BLEND_FUNC] = value;\n\n var mode = this.blendModes[value];\n\n if (mode.length === 2) {\n this.gl.blendFunc(mode[0], mode[1]);\n } else {\n this.gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);\n }\n };\n\n /**\n * Sets whether to enable or disable depth test.\n *\n * @param {boolean} value - Turn on or off webgl depth testing.\n */\n\n\n WebGLState.prototype.setDepthTest = function setDepthTest(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[DEPTH_TEST] === value) {\n return;\n }\n\n this.activeState[DEPTH_TEST] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n };\n\n /**\n * Sets whether to enable or disable cull face.\n *\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n\n\n WebGLState.prototype.setCullFace = function setCullFace(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[CULL_FACE] === value) {\n return;\n }\n\n this.activeState[CULL_FACE] = value;\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n };\n\n /**\n * Sets the gl front face.\n *\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n\n\n WebGLState.prototype.setFrontFace = function setFrontFace(value) {\n value = value ? 1 : 0;\n\n if (this.activeState[FRONT_FACE] === value) {\n return;\n }\n\n this.activeState[FRONT_FACE] = value;\n this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n };\n\n /**\n * Disables all the vaos in use\n *\n */\n\n\n WebGLState.prototype.resetAttributes = function resetAttributes() {\n for (var i = 0; i < this.attribState.tempAttribState.length; i++) {\n this.attribState.tempAttribState[i] = 0;\n }\n\n for (var _i = 0; _i < this.attribState.attribState.length; _i++) {\n this.attribState.attribState[_i] = 0;\n }\n\n // im going to assume one is always active for performance reasons.\n for (var _i2 = 1; _i2 < this.maxAttribs; _i2++) {\n this.gl.disableVertexAttribArray(_i2);\n }\n };\n\n // used\n /**\n * Resets all the logic and disables the vaos\n */\n\n\n WebGLState.prototype.resetToDefault = function resetToDefault() {\n // unbind any VAO if they exist..\n if (this.nativeVaoExtension) {\n this.nativeVaoExtension.bindVertexArrayOES(null);\n }\n\n // reset all attributes..\n this.resetAttributes();\n\n // set active state so we can force overrides of gl state\n for (var i = 0; i < this.activeState.length; ++i) {\n this.activeState[i] = 32;\n }\n\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n\n this.setState(this.defaultState);\n };\n\n return WebGLState;\n}();\n\nexports.default = WebGLState;\n//# sourceMappingURL=WebGLState.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/WebGLState.js\n// module id = 538\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = extractUniformsFromSrc;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar defaultValue = _pixiGlCore2.default.shader.defaultValue;\n\nfunction extractUniformsFromSrc(vertexSrc, fragmentSrc, mask) {\n var vertUniforms = extractUniformsFromString(vertexSrc, mask);\n var fragUniforms = extractUniformsFromString(fragmentSrc, mask);\n\n return Object.assign(vertUniforms, fragUniforms);\n}\n\nfunction extractUniformsFromString(string) {\n var maskRegex = new RegExp('^(projectionMatrix|uSampler|filterArea|filterClamp)$');\n\n var uniforms = {};\n var nameSplit = void 0;\n\n // clean the lines a little - remove extra spaces / tabs etc\n // then split along ';'\n var lines = string.replace(/\\s+/g, ' ').split(/\\s*;\\s*/);\n\n // loop through..\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n\n if (line.indexOf('uniform') > -1) {\n var splitLine = line.split(' ');\n var type = splitLine[1];\n\n var name = splitLine[2];\n var size = 1;\n\n if (name.indexOf('[') > -1) {\n // array!\n nameSplit = name.split(/\\[|]/);\n name = nameSplit[0];\n size *= Number(nameSplit[1]);\n }\n\n if (!name.match(maskRegex)) {\n uniforms[name] = {\n value: defaultValue(type, size),\n name: name,\n type: type\n };\n }\n }\n }\n\n return uniforms;\n}\n//# sourceMappingURL=extractUniformsFromSrc.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/extractUniformsFromSrc.js\n// module id = 539\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.calculateScreenSpaceMatrix = calculateScreenSpaceMatrix;\nexports.calculateNormalizedScreenSpaceMatrix = calculateNormalizedScreenSpaceMatrix;\nexports.calculateSpriteMatrix = calculateSpriteMatrix;\n\nvar _math = require('../../../math');\n\n/**\n * Calculates the mapped matrix\n * @param filterArea {Rectangle} The filter area\n * @param sprite {Sprite} the target sprite\n * @param outputMatrix {Matrix} @alvin\n */\n// TODO playing around here.. this is temporary - (will end up in the shader)\n// this returns a matrix that will normalise map filter cords in the filter to screen space\nfunction calculateScreenSpaceMatrix(outputMatrix, filterArea, textureSize) {\n // let worldTransform = sprite.worldTransform.copy(Matrix.TEMP_MATRIX),\n // let texture = {width:1136, height:700};//sprite._texture.baseTexture;\n\n // TODO unwrap?\n var mappedMatrix = outputMatrix.identity();\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n mappedMatrix.scale(textureSize.width, textureSize.height);\n\n return mappedMatrix;\n}\n\nfunction calculateNormalizedScreenSpaceMatrix(outputMatrix, filterArea, textureSize) {\n var mappedMatrix = outputMatrix.identity();\n\n mappedMatrix.translate(filterArea.x / textureSize.width, filterArea.y / textureSize.height);\n\n var translateScaleX = textureSize.width / filterArea.width;\n var translateScaleY = textureSize.height / filterArea.height;\n\n mappedMatrix.scale(translateScaleX, translateScaleY);\n\n return mappedMatrix;\n}\n\n// this will map the filter coord so that a texture can be used based on the transform of a sprite\nfunction calculateSpriteMatrix(outputMatrix, filterArea, textureSize, sprite) {\n var texture = sprite._texture.baseTexture;\n var mappedMatrix = outputMatrix.set(textureSize.width, 0, 0, textureSize.height, filterArea.x, filterArea.y);\n var worldTransform = sprite.worldTransform.copy(_math.Matrix.TEMP_MATRIX);\n\n worldTransform.invert();\n mappedMatrix.prepend(worldTransform);\n mappedMatrix.scale(1.0 / texture.width, 1.0 / texture.height);\n mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n\n return mappedMatrix;\n}\n//# sourceMappingURL=filterTransforms.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/filters/filterTransforms.js\n// module id = 540\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nvar _RenderTarget = require('../utils/RenderTarget');\n\nvar _RenderTarget2 = _interopRequireDefault(_RenderTarget);\n\nvar _Quad = require('../utils/Quad');\n\nvar _Quad2 = _interopRequireDefault(_Quad);\n\nvar _math = require('../../../math');\n\nvar _Shader = require('../../../Shader');\n\nvar _Shader2 = _interopRequireDefault(_Shader);\n\nvar _filterTransforms = require('../filters/filterTransforms');\n\nvar filterTransforms = _interopRequireWildcard(_filterTransforms);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @ignore\n * @class\n */\nvar FilterState =\n/**\n *\n */\nfunction FilterState() {\n _classCallCheck(this, FilterState);\n\n this.renderTarget = null;\n this.sourceFrame = new _math.Rectangle();\n this.destinationFrame = new _math.Rectangle();\n this.filters = [];\n this.target = null;\n this.resolution = 1;\n};\n\n/**\n * @class\n * @memberof PIXI\n * @extends PIXI.WebGLManager\n */\n\n\nvar FilterManager = function (_WebGLManager) {\n _inherits(FilterManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function FilterManager(renderer) {\n _classCallCheck(this, FilterManager);\n\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.gl = _this.renderer.gl;\n // know about sprites!\n _this.quad = new _Quad2.default(_this.gl, renderer.state.attribState);\n\n _this.shaderCache = {};\n // todo add default!\n _this.pool = {};\n\n _this.filterData = null;\n\n _this.managedFilters = [];\n return _this;\n }\n\n /**\n * Adds a new filter to the manager.\n *\n * @param {PIXI.DisplayObject} target - The target of the filter to render.\n * @param {PIXI.Filter[]} filters - The filters to apply.\n */\n\n\n FilterManager.prototype.pushFilter = function pushFilter(target, filters) {\n var renderer = this.renderer;\n\n var filterData = this.filterData;\n\n if (!filterData) {\n filterData = this.renderer._activeRenderTarget.filterStack;\n\n // add new stack\n var filterState = new FilterState();\n\n filterState.sourceFrame = filterState.destinationFrame = this.renderer._activeRenderTarget.size;\n filterState.renderTarget = renderer._activeRenderTarget;\n\n this.renderer._activeRenderTarget.filterData = filterData = {\n index: 0,\n stack: [filterState]\n };\n\n this.filterData = filterData;\n }\n\n // get the current filter state..\n var currentState = filterData.stack[++filterData.index];\n\n if (!currentState) {\n currentState = filterData.stack[filterData.index] = new FilterState();\n }\n\n // for now we go off the filter of the first resolution..\n var resolution = filters[0].resolution;\n var padding = filters[0].padding | 0;\n var targetBounds = target.filterArea || target.getBounds(true);\n var sourceFrame = currentState.sourceFrame;\n var destinationFrame = currentState.destinationFrame;\n\n sourceFrame.x = (targetBounds.x * resolution | 0) / resolution;\n sourceFrame.y = (targetBounds.y * resolution | 0) / resolution;\n sourceFrame.width = (targetBounds.width * resolution | 0) / resolution;\n sourceFrame.height = (targetBounds.height * resolution | 0) / resolution;\n\n if (filterData.stack[0].renderTarget.transform) {//\n\n // TODO we should fit the rect around the transform..\n } else if (filters[0].autoFit) {\n sourceFrame.fit(filterData.stack[0].destinationFrame);\n }\n\n // lets apply the padding After we fit the element to the screen.\n // this should stop the strange side effects that can occur when cropping to the edges\n sourceFrame.pad(padding);\n\n destinationFrame.width = sourceFrame.width;\n destinationFrame.height = sourceFrame.height;\n\n // lets play the padding after we fit the element to the screen.\n // this should stop the strange side effects that can occur when cropping to the edges\n\n var renderTarget = this.getPotRenderTarget(renderer.gl, sourceFrame.width, sourceFrame.height, resolution);\n\n currentState.target = target;\n currentState.filters = filters;\n currentState.resolution = resolution;\n currentState.renderTarget = renderTarget;\n\n // bind the render target to draw the shape in the top corner..\n\n renderTarget.setFrame(destinationFrame, sourceFrame);\n\n // bind the render target\n renderer.bindRenderTarget(renderTarget);\n renderTarget.clear();\n };\n\n /**\n * Pops off the filter and applies it.\n *\n */\n\n\n FilterManager.prototype.popFilter = function popFilter() {\n var filterData = this.filterData;\n\n var lastState = filterData.stack[filterData.index - 1];\n var currentState = filterData.stack[filterData.index];\n\n this.quad.map(currentState.renderTarget.size, currentState.sourceFrame).upload();\n\n var filters = currentState.filters;\n\n if (filters.length === 1) {\n filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false, currentState);\n this.freePotRenderTarget(currentState.renderTarget);\n } else {\n var flip = currentState.renderTarget;\n var flop = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, currentState.resolution);\n\n flop.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n // finally lets clear the render target before drawing to it..\n flop.clear();\n\n var i = 0;\n\n for (i = 0; i < filters.length - 1; ++i) {\n filters[i].apply(this, flip, flop, true, currentState);\n\n var t = flip;\n\n flip = flop;\n flop = t;\n }\n\n filters[i].apply(this, flip, lastState.renderTarget, false, currentState);\n\n this.freePotRenderTarget(flip);\n this.freePotRenderTarget(flop);\n }\n\n filterData.index--;\n\n if (filterData.index === 0) {\n this.filterData = null;\n }\n };\n\n /**\n * Draws a filter.\n *\n * @param {PIXI.Filter} filter - The filter to draw.\n * @param {PIXI.RenderTarget} input - The input render target.\n * @param {PIXI.RenderTarget} output - The target to output to.\n * @param {boolean} clear - Should the output be cleared before rendering to it\n */\n\n\n FilterManager.prototype.applyFilter = function applyFilter(filter, input, output, clear) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n\n var shader = filter.glShaders[renderer.CONTEXT_UID];\n\n // cacheing..\n if (!shader) {\n if (filter.glShaderKey) {\n shader = this.shaderCache[filter.glShaderKey];\n\n if (!shader) {\n shader = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc);\n\n filter.glShaders[renderer.CONTEXT_UID] = this.shaderCache[filter.glShaderKey] = shader;\n }\n } else {\n shader = filter.glShaders[renderer.CONTEXT_UID] = new _Shader2.default(this.gl, filter.vertexSrc, filter.fragmentSrc);\n }\n\n this.managedFilters.push(filter);\n\n // TODO - this only needs to be done once?\n renderer.bindVao(null);\n\n this.quad.initVao(shader);\n }\n\n renderer.bindVao(this.quad.vao);\n\n renderer.bindRenderTarget(output);\n\n if (clear) {\n gl.disable(gl.SCISSOR_TEST);\n renderer.clear(); // [1, 1, 1, 1]);\n gl.enable(gl.SCISSOR_TEST);\n }\n\n // in case the render target is being masked using a scissor rect\n if (output === renderer.maskManager.scissorRenderTarget) {\n renderer.maskManager.pushScissorMask(null, renderer.maskManager.scissorData);\n }\n\n renderer.bindShader(shader);\n\n // free unit 0 for us, doesn't matter what was there\n // don't try to restore it, because syncUniforms can upload it to another slot\n // and it'll be a problem\n var tex = this.renderer.emptyTextures[0];\n\n this.renderer.boundTextures[0] = tex;\n // this syncs the PixiJS filters uniforms with glsl uniforms\n this.syncUniforms(shader, filter);\n\n renderer.state.setBlendMode(filter.blendMode);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, input.texture.texture);\n\n this.quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n\n gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n };\n\n /**\n * Uploads the uniforms of the filter.\n *\n * @param {GLShader} shader - The underlying gl shader.\n * @param {PIXI.Filter} filter - The filter we are synchronizing.\n */\n\n\n FilterManager.prototype.syncUniforms = function syncUniforms(shader, filter) {\n var uniformData = filter.uniformData;\n var uniforms = filter.uniforms;\n\n // 0 is reserved for the PixiJS texture so we start at 1!\n var textureCount = 1;\n var currentState = void 0;\n\n // filterArea and filterClamp that are handled by FilterManager directly\n // they must not appear in uniformData\n\n if (shader.uniforms.filterArea) {\n currentState = this.filterData.stack[this.filterData.index];\n\n var filterArea = shader.uniforms.filterArea;\n\n filterArea[0] = currentState.renderTarget.size.width;\n filterArea[1] = currentState.renderTarget.size.height;\n filterArea[2] = currentState.sourceFrame.x;\n filterArea[3] = currentState.sourceFrame.y;\n\n shader.uniforms.filterArea = filterArea;\n }\n\n // use this to clamp displaced texture coords so they belong to filterArea\n // see displacementFilter fragment shader for an example\n if (shader.uniforms.filterClamp) {\n currentState = currentState || this.filterData.stack[this.filterData.index];\n\n var filterClamp = shader.uniforms.filterClamp;\n\n filterClamp[0] = 0;\n filterClamp[1] = 0;\n filterClamp[2] = (currentState.sourceFrame.width - 1) / currentState.renderTarget.size.width;\n filterClamp[3] = (currentState.sourceFrame.height - 1) / currentState.renderTarget.size.height;\n\n shader.uniforms.filterClamp = filterClamp;\n }\n\n // TODO Cacheing layer..\n for (var i in uniformData) {\n var type = uniformData[i].type;\n\n if (type === 'sampler2d' && uniforms[i] !== 0) {\n if (uniforms[i].baseTexture) {\n shader.uniforms[i] = this.renderer.bindTexture(uniforms[i].baseTexture, textureCount);\n } else {\n shader.uniforms[i] = textureCount;\n\n // TODO\n // this is helpful as renderTargets can also be set.\n // Although thinking about it, we could probably\n // make the filter texture cache return a RenderTexture\n // rather than a renderTarget\n var gl = this.renderer.gl;\n\n this.renderer.boundTextures[textureCount] = this.renderer.emptyTextures[textureCount];\n gl.activeTexture(gl.TEXTURE0 + textureCount);\n\n uniforms[i].texture.bind();\n }\n\n textureCount++;\n } else if (type === 'mat3') {\n // check if its PixiJS matrix..\n if (uniforms[i].a !== undefined) {\n shader.uniforms[i] = uniforms[i].toArray(true);\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n } else if (type === 'vec2') {\n // check if its a point..\n if (uniforms[i].x !== undefined) {\n var val = shader.uniforms[i] || new Float32Array(2);\n\n val[0] = uniforms[i].x;\n val[1] = uniforms[i].y;\n shader.uniforms[i] = val;\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n } else if (type === 'float') {\n if (shader.uniforms.data[i].value !== uniformData[i]) {\n shader.uniforms[i] = uniforms[i];\n }\n } else {\n shader.uniforms[i] = uniforms[i];\n }\n }\n };\n\n /**\n * Gets a render target from the pool, or creates a new one.\n *\n * @param {boolean} clear - Should we clear the render texture when we get it?\n * @param {number} resolution - The resolution of the target.\n * @return {PIXI.RenderTarget} The new render target\n */\n\n\n FilterManager.prototype.getRenderTarget = function getRenderTarget(clear, resolution) {\n var currentState = this.filterData.stack[this.filterData.index];\n var renderTarget = this.getPotRenderTarget(this.renderer.gl, currentState.sourceFrame.width, currentState.sourceFrame.height, resolution || currentState.resolution);\n\n renderTarget.setFrame(currentState.destinationFrame, currentState.sourceFrame);\n\n return renderTarget;\n };\n\n /**\n * Returns a render target to the pool.\n *\n * @param {PIXI.RenderTarget} renderTarget - The render target to return.\n */\n\n\n FilterManager.prototype.returnRenderTarget = function returnRenderTarget(renderTarget) {\n this.freePotRenderTarget(renderTarget);\n };\n\n /**\n * Calculates the mapped matrix.\n *\n * TODO playing around here.. this is temporary - (will end up in the shader)\n * this returns a matrix that will normalise map filter cords in the filter to screen space\n *\n * @param {PIXI.Matrix} outputMatrix - the matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateScreenSpaceMatrix = function calculateScreenSpaceMatrix(outputMatrix) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size);\n };\n\n /**\n * Multiply vTextureCoord to this matrix to achieve (0,0,1,1) for filterArea\n *\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateNormalizedScreenSpaceMatrix = function calculateNormalizedScreenSpaceMatrix(outputMatrix) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateNormalizedScreenSpaceMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, currentState.destinationFrame);\n };\n\n /**\n * This will map the filter coord so that a texture can be used based on the transform of a sprite\n *\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @param {PIXI.Sprite} sprite - The sprite to map to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n\n\n FilterManager.prototype.calculateSpriteMatrix = function calculateSpriteMatrix(outputMatrix, sprite) {\n var currentState = this.filterData.stack[this.filterData.index];\n\n return filterTransforms.calculateSpriteMatrix(outputMatrix, currentState.sourceFrame, currentState.renderTarget.size, sprite);\n };\n\n /**\n * Destroys this Filter Manager.\n *\n * @param {boolean} [contextLost=false] context was lost, do not free shaders\n *\n */\n\n\n FilterManager.prototype.destroy = function destroy() {\n var contextLost = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var renderer = this.renderer;\n var filters = this.managedFilters;\n\n for (var i = 0; i < filters.length; i++) {\n if (!contextLost) {\n filters[i].glShaders[renderer.CONTEXT_UID].destroy();\n }\n delete filters[i].glShaders[renderer.CONTEXT_UID];\n }\n\n this.shaderCache = {};\n if (!contextLost) {\n this.emptyPool();\n } else {\n this.pool = {};\n }\n };\n\n /**\n * Gets a Power-of-Two render texture.\n *\n * TODO move to a seperate class could be on renderer?\n * also - could cause issue with multiple contexts?\n *\n * @private\n * @param {WebGLRenderingContext} gl - The webgl rendering context\n * @param {number} minWidth - The minimum width of the render target.\n * @param {number} minHeight - The minimum height of the render target.\n * @param {number} resolution - The resolution of the render target.\n * @return {PIXI.RenderTarget} The new render target.\n */\n\n\n FilterManager.prototype.getPotRenderTarget = function getPotRenderTarget(gl, minWidth, minHeight, resolution) {\n // TODO you could return a bigger texture if there is not one in the pool?\n minWidth = _bitTwiddle2.default.nextPow2(minWidth * resolution);\n minHeight = _bitTwiddle2.default.nextPow2(minHeight * resolution);\n\n var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF;\n\n if (!this.pool[key]) {\n this.pool[key] = [];\n }\n\n var renderTarget = this.pool[key].pop();\n\n // creating render target will cause texture to be bound!\n if (!renderTarget) {\n // temporary bypass cache..\n var tex = this.renderer.boundTextures[0];\n\n gl.activeTexture(gl.TEXTURE0);\n\n // internally - this will cause a texture to be bound..\n renderTarget = new _RenderTarget2.default(gl, minWidth, minHeight, null, 1);\n\n // set the current one back\n gl.bindTexture(gl.TEXTURE_2D, tex._glTextures[this.renderer.CONTEXT_UID].texture);\n }\n\n // manually tweak the resolution...\n // this will not modify the size of the frame buffer, just its resolution.\n renderTarget.resolution = resolution;\n renderTarget.defaultFrame.width = renderTarget.size.width = minWidth / resolution;\n renderTarget.defaultFrame.height = renderTarget.size.height = minHeight / resolution;\n\n return renderTarget;\n };\n\n /**\n * Empties the texture pool.\n *\n */\n\n\n FilterManager.prototype.emptyPool = function emptyPool() {\n for (var i in this.pool) {\n var textures = this.pool[i];\n\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n\n this.pool = {};\n };\n\n /**\n * Frees a render target back into the pool.\n *\n * @param {PIXI.RenderTarget} renderTarget - The renderTarget to free\n */\n\n\n FilterManager.prototype.freePotRenderTarget = function freePotRenderTarget(renderTarget) {\n var minWidth = renderTarget.size.width * renderTarget.resolution;\n var minHeight = renderTarget.size.height * renderTarget.resolution;\n var key = (minWidth & 0xFFFF) << 16 | minHeight & 0xFFFF;\n\n this.pool[key].push(renderTarget);\n };\n\n return FilterManager;\n}(_WebGLManager3.default);\n\nexports.default = FilterManager;\n//# sourceMappingURL=FilterManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/managers/FilterManager.js\n// module id = 541\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nvar _SpriteMaskFilter = require('../filters/spriteMask/SpriteMaskFilter');\n\nvar _SpriteMaskFilter2 = _interopRequireDefault(_SpriteMaskFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar MaskManager = function (_WebGLManager) {\n _inherits(MaskManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function MaskManager(renderer) {\n _classCallCheck(this, MaskManager);\n\n // TODO - we don't need both!\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.scissor = false;\n _this.scissorData = null;\n _this.scissorRenderTarget = null;\n\n _this.enableScissor = true;\n\n _this.alphaMaskPool = [];\n _this.alphaMaskIndex = 0;\n return _this;\n }\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushMask = function pushMask(target, maskData) {\n // TODO the root check means scissor rect will not\n // be used on render textures more info here:\n // https://github.com/pixijs/pixi.js/pull/3545\n\n if (maskData.texture) {\n this.pushSpriteMask(target, maskData);\n } else if (this.enableScissor && !this.scissor && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) {\n var matrix = maskData.worldTransform;\n\n var rot = Math.atan2(matrix.b, matrix.a);\n\n // use the nearest degree!\n rot = Math.round(rot * (180 / Math.PI));\n\n if (rot % 90) {\n this.pushStencilMask(maskData);\n } else {\n this.pushScissorMask(target, maskData);\n }\n } else {\n this.pushStencilMask(maskData);\n }\n };\n\n /**\n * Removes the last mask from the mask stack and doesn't return it.\n *\n * @param {PIXI.DisplayObject} target - Display Object to pop the mask from\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.popMask = function popMask(target, maskData) {\n if (maskData.texture) {\n this.popSpriteMask(target, maskData);\n } else if (this.enableScissor && !this.renderer.stencilManager.stencilMaskStack.length) {\n this.popScissorMask(target, maskData);\n } else {\n this.popStencilMask(target, maskData);\n }\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.RenderTarget} target - Display Object to push the sprite mask to\n * @param {PIXI.Sprite} maskData - Sprite to be used as the mask\n */\n\n\n MaskManager.prototype.pushSpriteMask = function pushSpriteMask(target, maskData) {\n var alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new _SpriteMaskFilter2.default(maskData)];\n }\n\n alphaMaskFilter[0].resolution = this.renderer.resolution;\n alphaMaskFilter[0].maskSprite = maskData;\n\n // TODO - may cause issues!\n target.filterArea = maskData.getBounds(true);\n\n this.renderer.filterManager.pushFilter(target, alphaMaskFilter);\n\n this.alphaMaskIndex++;\n };\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n *\n */\n\n\n MaskManager.prototype.popSpriteMask = function popSpriteMask() {\n this.renderer.filterManager.popFilter();\n this.alphaMaskIndex--;\n };\n\n /**\n * Applies the Mask and adds it to the current filter stack.\n *\n * @param {PIXI.Sprite|PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushStencilMask = function pushStencilMask(maskData) {\n this.renderer.currentRenderer.stop();\n this.renderer.stencilManager.pushStencil(maskData);\n };\n\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n *\n */\n\n\n MaskManager.prototype.popStencilMask = function popStencilMask() {\n this.renderer.currentRenderer.stop();\n this.renderer.stencilManager.popStencil();\n };\n\n /**\n *\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.Graphics} maskData - The masking data.\n */\n\n\n MaskManager.prototype.pushScissorMask = function pushScissorMask(target, maskData) {\n maskData.renderable = true;\n\n var renderTarget = this.renderer._activeRenderTarget;\n\n var bounds = maskData.getBounds();\n\n bounds.fit(renderTarget.size);\n maskData.renderable = false;\n\n this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n\n var resolution = this.renderer.resolution;\n\n this.renderer.gl.scissor(bounds.x * resolution, (renderTarget.root ? renderTarget.size.height - bounds.y - bounds.height : bounds.y) * resolution, bounds.width * resolution, bounds.height * resolution);\n\n this.scissorRenderTarget = renderTarget;\n this.scissorData = maskData;\n this.scissor = true;\n };\n\n /**\n *\n *\n */\n\n\n MaskManager.prototype.popScissorMask = function popScissorMask() {\n this.scissorRenderTarget = null;\n this.scissorData = null;\n this.scissor = false;\n\n // must be scissor!\n var gl = this.renderer.gl;\n\n gl.disable(gl.SCISSOR_TEST);\n };\n\n return MaskManager;\n}(_WebGLManager3.default);\n\nexports.default = MaskManager;\n//# sourceMappingURL=MaskManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/managers/MaskManager.js\n// module id = 542\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLManager2 = require('./WebGLManager');\n\nvar _WebGLManager3 = _interopRequireDefault(_WebGLManager2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.WebGLManager\n * @memberof PIXI\n */\nvar StencilManager = function (_WebGLManager) {\n _inherits(StencilManager, _WebGLManager);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this manager works for.\n */\n function StencilManager(renderer) {\n _classCallCheck(this, StencilManager);\n\n var _this = _possibleConstructorReturn(this, _WebGLManager.call(this, renderer));\n\n _this.stencilMaskStack = null;\n return _this;\n }\n\n /**\n * Changes the mask stack that is used by this manager.\n *\n * @param {PIXI.Graphics[]} stencilMaskStack - The mask stack\n */\n\n\n StencilManager.prototype.setMaskStack = function setMaskStack(stencilMaskStack) {\n this.stencilMaskStack = stencilMaskStack;\n\n var gl = this.renderer.gl;\n\n if (stencilMaskStack.length === 0) {\n gl.disable(gl.STENCIL_TEST);\n } else {\n gl.enable(gl.STENCIL_TEST);\n }\n };\n\n /**\n * Applies the Mask and adds it to the current stencil stack. @alvin\n *\n * @param {PIXI.Graphics} graphics - The mask\n */\n\n\n StencilManager.prototype.pushStencil = function pushStencil(graphics) {\n this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n this.renderer._activeRenderTarget.attachStencilBuffer();\n\n var gl = this.renderer.gl;\n var prevMaskCount = this.stencilMaskStack.length;\n\n if (prevMaskCount === 0) {\n gl.enable(gl.STENCIL_TEST);\n }\n\n this.stencilMaskStack.push(graphics);\n\n // Increment the refference stencil value where the new mask overlaps with the old ones.\n gl.colorMask(false, false, false, false);\n gl.stencilFunc(gl.EQUAL, prevMaskCount, this._getBitwiseMask());\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n this.renderer.plugins.graphics.render(graphics);\n\n this._useCurrent();\n };\n\n /**\n * Removes the last mask from the stencil stack. @alvin\n */\n\n\n StencilManager.prototype.popStencil = function popStencil() {\n this.renderer.setObjectRenderer(this.renderer.plugins.graphics);\n\n var gl = this.renderer.gl;\n var graphics = this.stencilMaskStack.pop();\n\n if (this.stencilMaskStack.length === 0) {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n gl.clearStencil(0);\n } else {\n // Decrement the refference stencil value where the popped mask overlaps with the other ones\n gl.colorMask(false, false, false, false);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n this.renderer.plugins.graphics.render(graphics);\n\n this._useCurrent();\n }\n };\n\n /**\n * Setup renderer to use the current stencil data.\n */\n\n\n StencilManager.prototype._useCurrent = function _useCurrent() {\n var gl = this.renderer.gl;\n\n gl.colorMask(true, true, true, true);\n gl.stencilFunc(gl.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask());\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n };\n\n /**\n * Fill 1s equal to the number of acitve stencil masks.\n *\n * @return {number} The bitwise mask.\n */\n\n\n StencilManager.prototype._getBitwiseMask = function _getBitwiseMask() {\n return (1 << this.stencilMaskStack.length) - 1;\n };\n\n /**\n * Destroys the mask stack.\n *\n */\n\n\n StencilManager.prototype.destroy = function destroy() {\n _WebGLManager3.default.prototype.destroy.call(this);\n\n this.stencilMaskStack.stencilStack = null;\n };\n\n return StencilManager;\n}(_WebGLManager3.default);\n\nexports.default = StencilManager;\n//# sourceMappingURL=StencilManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/managers/StencilManager.js\n// module id = 543\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = checkMaxIfStatmentsInShader;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fragTemplate = ['precision mediump float;', 'void main(void){', 'float test = 0.1;', '%forloop%', 'gl_FragColor = vec4(0.0);', '}'].join('\\n');\n\nfunction checkMaxIfStatmentsInShader(maxIfs, gl) {\n var createTempContext = !gl;\n\n // @if DEBUG\n if (maxIfs === 0) {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n // @endif\n\n if (createTempContext) {\n var tinyCanvas = document.createElement('canvas');\n\n tinyCanvas.width = 1;\n tinyCanvas.height = 1;\n\n gl = _pixiGlCore2.default.createContext(tinyCanvas);\n }\n\n var shader = gl.createShader(gl.FRAGMENT_SHADER);\n\n while (true) // eslint-disable-line no-constant-condition\n {\n var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n maxIfs = maxIfs / 2 | 0;\n } else {\n // valid!\n break;\n }\n }\n\n if (createTempContext) {\n // get rid of context\n if (gl.getExtension('WEBGL_lose_context')) {\n gl.getExtension('WEBGL_lose_context').loseContext();\n }\n }\n\n return maxIfs;\n}\n\nfunction generateIfTestSrc(maxIfs) {\n var src = '';\n\n for (var i = 0; i < maxIfs; ++i) {\n if (i > 0) {\n src += '\\nelse ';\n }\n\n if (i < maxIfs - 1) {\n src += 'if(test == ' + i + '.0){}';\n }\n }\n\n return src;\n}\n//# sourceMappingURL=checkMaxIfStatmentsInShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/checkMaxIfStatmentsInShader.js\n// module id = 544\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapWebGLBlendModesToPixi;\n\nvar _const = require('../../../const');\n\n/**\n * Maps gl blend combinations to WebGL.\n *\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {string[]} [array=[]] - The array to output into.\n * @return {string[]} Mapped modes.\n */\nfunction mapWebGLBlendModesToPixi(gl) {\n var array = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n array[_const.BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.ADD] = [gl.ONE, gl.DST_ALPHA];\n array[_const.BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR];\n array[_const.BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n\n // not-premultiplied blend modes\n array[_const.BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[_const.BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.DST_ALPHA, gl.ONE, gl.DST_ALPHA];\n array[_const.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_COLOR];\n\n return array;\n}\n//# sourceMappingURL=mapWebGLBlendModesToPixi.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/mapWebGLBlendModesToPixi.js\n// module id = 545\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapWebGLDrawModesToPixi;\n\nvar _const = require('../../../const');\n\n/**\n * Generic Mask Stack data structure.\n *\n * @memberof PIXI\n * @function mapWebGLDrawModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL drawing context\n * @param {object} [object={}] - The object to map into\n * @return {object} The mapped draw modes.\n */\nfunction mapWebGLDrawModesToPixi(gl) {\n var object = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n object[_const.DRAW_MODES.POINTS] = gl.POINTS;\n object[_const.DRAW_MODES.LINES] = gl.LINES;\n object[_const.DRAW_MODES.LINE_LOOP] = gl.LINE_LOOP;\n object[_const.DRAW_MODES.LINE_STRIP] = gl.LINE_STRIP;\n object[_const.DRAW_MODES.TRIANGLES] = gl.TRIANGLES;\n object[_const.DRAW_MODES.TRIANGLE_STRIP] = gl.TRIANGLE_STRIP;\n object[_const.DRAW_MODES.TRIANGLE_FAN] = gl.TRIANGLE_FAN;\n\n return object;\n}\n//# sourceMappingURL=mapWebGLDrawModesToPixi.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/mapWebGLDrawModesToPixi.js\n// module id = 546\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = validateContext;\nfunction validateContext(gl) {\n var attributes = gl.getContextAttributes();\n\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (!attributes.stencil) {\n /* eslint-disable no-console */\n console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n /* eslint-enable no-console */\n }\n}\n//# sourceMappingURL=validateContext.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/renderers/webgl/utils/validateContext.js\n// module id = 547\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _CanvasRenderer = require('../../renderers/canvas/CanvasRenderer');\n\nvar _CanvasRenderer2 = _interopRequireDefault(_CanvasRenderer);\n\nvar _const = require('../../const');\n\nvar _math = require('../../math');\n\nvar _CanvasTinter = require('./CanvasTinter');\n\nvar _CanvasTinter2 = _interopRequireDefault(_CanvasTinter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar canvasRenderWorldTransform = new _math.Matrix();\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's CanvasSpriteRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/CanvasSpriteRenderer.java\n */\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n */\n\nvar CanvasSpriteRenderer = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer -The renderer sprite this batch works for.\n */\n function CanvasSpriteRenderer(renderer) {\n _classCallCheck(this, CanvasSpriteRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders the sprite object.\n *\n * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n */\n\n\n CanvasSpriteRenderer.prototype.render = function render(sprite) {\n var texture = sprite._texture;\n var renderer = this.renderer;\n\n var width = texture._frame.width;\n var height = texture._frame.height;\n\n var wt = sprite.transform.worldTransform;\n var dx = 0;\n var dy = 0;\n\n if (texture.orig.width <= 0 || texture.orig.height <= 0 || !texture.baseTexture.source) {\n return;\n }\n\n renderer.setBlendMode(sprite.blendMode);\n\n // Ignore null sources\n if (texture.valid) {\n renderer.context.globalAlpha = sprite.worldAlpha;\n\n // If smoothingEnabled is supported and we need to change the smoothing property for sprite texture\n var smoothingEnabled = texture.baseTexture.scaleMode === _const.SCALE_MODES.LINEAR;\n\n if (renderer.smoothProperty && renderer.context[renderer.smoothProperty] !== smoothingEnabled) {\n renderer.context[renderer.smoothProperty] = smoothingEnabled;\n }\n\n if (texture.trim) {\n dx = texture.trim.width / 2 + texture.trim.x - sprite.anchor.x * texture.orig.width;\n dy = texture.trim.height / 2 + texture.trim.y - sprite.anchor.y * texture.orig.height;\n } else {\n dx = (0.5 - sprite.anchor.x) * texture.orig.width;\n dy = (0.5 - sprite.anchor.y) * texture.orig.height;\n }\n\n if (texture.rotate) {\n wt.copy(canvasRenderWorldTransform);\n wt = canvasRenderWorldTransform;\n _math.GroupD8.matrixAppendRotationInv(wt, texture.rotate, dx, dy);\n // the anchor has already been applied above, so lets set it to zero\n dx = 0;\n dy = 0;\n }\n\n dx -= width / 2;\n dy -= height / 2;\n\n // Allow for pixel rounding\n if (renderer.roundPixels) {\n renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution | 0, wt.ty * renderer.resolution | 0);\n\n dx = dx | 0;\n dy = dy | 0;\n } else {\n renderer.context.setTransform(wt.a, wt.b, wt.c, wt.d, wt.tx * renderer.resolution, wt.ty * renderer.resolution);\n }\n\n var resolution = texture.baseTexture.resolution;\n\n if (sprite.tint !== 0xFFFFFF) {\n if (sprite.cachedTint !== sprite.tint || sprite.tintedTexture.tintId !== sprite._texture._updateID) {\n sprite.cachedTint = sprite.tint;\n\n // TODO clean up caching - how to clean up the caches?\n sprite.tintedTexture = _CanvasTinter2.default.getTintedTexture(sprite, sprite.tint);\n }\n\n renderer.context.drawImage(sprite.tintedTexture, 0, 0, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution);\n } else {\n renderer.context.drawImage(texture.baseTexture.source, texture._frame.x * resolution, texture._frame.y * resolution, width * resolution, height * resolution, dx * renderer.resolution, dy * renderer.resolution, width * renderer.resolution, height * renderer.resolution);\n }\n }\n };\n\n /**\n * destroy the sprite object.\n *\n */\n\n\n CanvasSpriteRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return CanvasSpriteRenderer;\n}();\n\nexports.default = CanvasSpriteRenderer;\n\n\n_CanvasRenderer2.default.registerPlugin('sprite', CanvasSpriteRenderer);\n//# sourceMappingURL=CanvasSpriteRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/canvas/CanvasSpriteRenderer.js\n// module id = 548\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @class\n * @memberof PIXI\n */\nvar Buffer = function () {\n /**\n * @param {number} size - The size of the buffer in bytes.\n */\n function Buffer(size) {\n _classCallCheck(this, Buffer);\n\n this.vertices = new ArrayBuffer(size);\n\n /**\n * View on the vertices as a Float32Array for positions\n *\n * @member {Float32Array}\n */\n this.float32View = new Float32Array(this.vertices);\n\n /**\n * View on the vertices as a Uint32Array for uvs\n *\n * @member {Float32Array}\n */\n this.uint32View = new Uint32Array(this.vertices);\n }\n\n /**\n * Destroys the buffer.\n *\n */\n\n\n Buffer.prototype.destroy = function destroy() {\n this.vertices = null;\n this.positions = null;\n this.uvs = null;\n this.colors = null;\n };\n\n return Buffer;\n}();\n\nexports.default = Buffer;\n//# sourceMappingURL=BatchBuffer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/webgl/BatchBuffer.js\n// module id = 549\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _ObjectRenderer2 = require('../../renderers/webgl/utils/ObjectRenderer');\n\nvar _ObjectRenderer3 = _interopRequireDefault(_ObjectRenderer2);\n\nvar _WebGLRenderer = require('../../renderers/webgl/WebGLRenderer');\n\nvar _WebGLRenderer2 = _interopRequireDefault(_WebGLRenderer);\n\nvar _createIndicesForQuads = require('../../utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nvar _generateMultiTextureShader = require('./generateMultiTextureShader');\n\nvar _generateMultiTextureShader2 = _interopRequireDefault(_generateMultiTextureShader);\n\nvar _checkMaxIfStatmentsInShader = require('../../renderers/webgl/utils/checkMaxIfStatmentsInShader');\n\nvar _checkMaxIfStatmentsInShader2 = _interopRequireDefault(_checkMaxIfStatmentsInShader);\n\nvar _BatchBuffer = require('./BatchBuffer');\n\nvar _BatchBuffer2 = _interopRequireDefault(_BatchBuffer);\n\nvar _settings = require('../../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _utils = require('../../utils');\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _bitTwiddle = require('bit-twiddle');\n\nvar _bitTwiddle2 = _interopRequireDefault(_bitTwiddle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TICK = 0;\nvar TEXTURE_TICK = 0;\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * @class\n * @private\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\n\nvar SpriteRenderer = function (_ObjectRenderer) {\n _inherits(SpriteRenderer, _ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n function SpriteRenderer(renderer) {\n _classCallCheck(this, SpriteRenderer);\n\n /**\n * Number of values sent in the vertex buffer.\n * aVertexPosition(2), aTextureCoord(1), aColor(1), aTextureId(1) = 5\n *\n * @member {number}\n */\n var _this = _possibleConstructorReturn(this, _ObjectRenderer.call(this, renderer));\n\n _this.vertSize = 5;\n\n /**\n * The size of the vertex information in bytes.\n *\n * @member {number}\n */\n _this.vertByteSize = _this.vertSize * 4;\n\n /**\n * The number of images in the SpriteRenderer before it flushes.\n *\n * @member {number}\n */\n _this.size = _settings2.default.SPRITE_BATCH_SIZE; // 2000 is a nice balance between mobile / desktop\n\n // the total number of bytes in our batch\n // let numVerts = this.size * 4 * this.vertByteSize;\n\n _this.buffers = [];\n for (var i = 1; i <= _bitTwiddle2.default.nextPow2(_this.size); i *= 2) {\n _this.buffers.push(new _BatchBuffer2.default(i * 4 * _this.vertByteSize));\n }\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n _this.indices = (0, _createIndicesForQuads2.default)(_this.size);\n\n /**\n * The default shaders that is used if a sprite doesn't have a more specific one.\n * there is a shader for each number of textures that can be rendererd.\n * These shaders will also be generated on the fly as required.\n * @member {PIXI.Shader[]}\n */\n _this.shader = null;\n\n _this.currentIndex = 0;\n _this.groups = [];\n\n for (var k = 0; k < _this.size; k++) {\n _this.groups[k] = { textures: [], textureCount: 0, ids: [], size: 0, start: 0, blend: 0 };\n }\n\n _this.sprites = [];\n\n _this.vertexBuffers = [];\n _this.vaos = [];\n\n _this.vaoMax = 2;\n _this.vertexCount = 0;\n\n _this.renderer.on('prerender', _this.onPrerender, _this);\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n SpriteRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n if (this.renderer.legacy) {\n this.MAX_TEXTURES = 1;\n } else {\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), _settings2.default.SPRITE_MAX_TEXTURES);\n\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = (0, _checkMaxIfStatmentsInShader2.default)(this.MAX_TEXTURES, gl);\n }\n\n this.shader = (0, _generateMultiTextureShader2.default)(gl, this.MAX_TEXTURES);\n\n // create a couple of buffers\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n // we use the second shader as the first one depending on your browser may omit aTextureId\n // as it is not used by the shader so is optimized out.\n\n this.renderer.bindVao(null);\n\n var attrs = this.shader.attributes;\n\n for (var i = 0; i < this.vaoMax; i++) {\n /* eslint-disable max-len */\n var vertexBuffer = this.vertexBuffers[i] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n /* eslint-enable max-len */\n\n // build the vao object that will render..\n var vao = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(vertexBuffer, attrs.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(vertexBuffer, attrs.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(vertexBuffer, attrs.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4);\n\n if (attrs.aTextureId) {\n vao.addAttribute(vertexBuffer, attrs.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n }\n\n this.vaos[i] = vao;\n }\n\n this.vao = this.vaos[0];\n this.currentBlendMode = 99999;\n\n this.boundTextures = new Array(this.MAX_TEXTURES);\n };\n\n /**\n * Called before the renderer starts rendering.\n *\n */\n\n\n SpriteRenderer.prototype.onPrerender = function onPrerender() {\n this.vertexCount = 0;\n };\n\n /**\n * Renders the sprite object.\n *\n * @param {PIXI.Sprite} sprite - the sprite to render when using this spritebatch\n */\n\n\n SpriteRenderer.prototype.render = function render(sprite) {\n // TODO set blend modes..\n // check texture..\n if (this.currentIndex >= this.size) {\n this.flush();\n }\n\n // get the uvs for the texture\n\n // if the uvs have not updated then no point rendering just yet!\n if (!sprite._texture._uvs) {\n return;\n }\n\n // push a texture.\n // increment the batchsize\n this.sprites[this.currentIndex++] = sprite;\n };\n\n /**\n * Renders the content and empties the current batch.\n *\n */\n\n\n SpriteRenderer.prototype.flush = function flush() {\n if (this.currentIndex === 0) {\n return;\n }\n\n var gl = this.renderer.gl;\n var MAX_TEXTURES = this.MAX_TEXTURES;\n\n var np2 = _bitTwiddle2.default.nextPow2(this.currentIndex);\n var log2 = _bitTwiddle2.default.log2(np2);\n var buffer = this.buffers[log2];\n\n var sprites = this.sprites;\n var groups = this.groups;\n\n var float32View = buffer.float32View;\n var uint32View = buffer.uint32View;\n\n var boundTextures = this.boundTextures;\n var rendererBoundTextures = this.renderer.boundTextures;\n var touch = this.renderer.textureGC.count;\n\n var index = 0;\n var nextTexture = void 0;\n var currentTexture = void 0;\n var groupCount = 1;\n var textureCount = 0;\n var currentGroup = groups[0];\n var vertexData = void 0;\n var uvs = void 0;\n var blendMode = _utils.premultiplyBlendMode[sprites[0]._texture.baseTexture.premultipliedAlpha ? 1 : 0][sprites[0].blendMode];\n\n currentGroup.textureCount = 0;\n currentGroup.start = 0;\n currentGroup.blend = blendMode;\n\n TICK++;\n\n var i = void 0;\n\n // copy textures..\n for (i = 0; i < MAX_TEXTURES; ++i) {\n boundTextures[i] = rendererBoundTextures[i];\n boundTextures[i]._virtalBoundId = i;\n }\n\n for (i = 0; i < this.currentIndex; ++i) {\n // upload the sprite elemetns...\n // they have all ready been calculated so we just need to push them into the buffer.\n var sprite = sprites[i];\n\n nextTexture = sprite._texture.baseTexture;\n\n var spriteBlendMode = _utils.premultiplyBlendMode[Number(nextTexture.premultipliedAlpha)][sprite.blendMode];\n\n if (blendMode !== spriteBlendMode) {\n // finish a group..\n blendMode = spriteBlendMode;\n\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n\n if (nextTexture._enabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n\n currentGroup.size = i - currentGroup.start;\n\n textureCount = 0;\n\n currentGroup = groups[groupCount++];\n currentGroup.blend = blendMode;\n currentGroup.textureCount = 0;\n currentGroup.start = i;\n }\n\n nextTexture.touched = touch;\n\n if (nextTexture._virtalBoundId === -1) {\n for (var j = 0; j < MAX_TEXTURES; ++j) {\n var tIndex = (j + TEXTURE_TICK) % MAX_TEXTURES;\n\n var t = boundTextures[tIndex];\n\n if (t._enabled !== TICK) {\n TEXTURE_TICK++;\n\n t._virtalBoundId = -1;\n\n nextTexture._virtalBoundId = tIndex;\n\n boundTextures[tIndex] = nextTexture;\n break;\n }\n }\n }\n\n nextTexture._enabled = TICK;\n\n currentGroup.textureCount++;\n currentGroup.ids[textureCount] = nextTexture._virtalBoundId;\n currentGroup.textures[textureCount++] = nextTexture;\n }\n }\n\n vertexData = sprite.vertexData;\n\n // TODO this sum does not need to be set each frame..\n uvs = sprite._texture._uvs.uvsUint32;\n\n if (this.renderer.roundPixels) {\n var resolution = this.renderer.resolution;\n\n // xy\n float32View[index] = (vertexData[0] * resolution | 0) / resolution;\n float32View[index + 1] = (vertexData[1] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 5] = (vertexData[2] * resolution | 0) / resolution;\n float32View[index + 6] = (vertexData[3] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 10] = (vertexData[4] * resolution | 0) / resolution;\n float32View[index + 11] = (vertexData[5] * resolution | 0) / resolution;\n\n // xy\n float32View[index + 15] = (vertexData[6] * resolution | 0) / resolution;\n float32View[index + 16] = (vertexData[7] * resolution | 0) / resolution;\n } else {\n // xy\n float32View[index] = vertexData[0];\n float32View[index + 1] = vertexData[1];\n\n // xy\n float32View[index + 5] = vertexData[2];\n float32View[index + 6] = vertexData[3];\n\n // xy\n float32View[index + 10] = vertexData[4];\n float32View[index + 11] = vertexData[5];\n\n // xy\n float32View[index + 15] = vertexData[6];\n float32View[index + 16] = vertexData[7];\n }\n\n uint32View[index + 2] = uvs[0];\n uint32View[index + 7] = uvs[1];\n uint32View[index + 12] = uvs[2];\n uint32View[index + 17] = uvs[3];\n /* eslint-disable max-len */\n var alpha = Math.min(sprite.worldAlpha, 1.0);\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && nextTexture.premultipliedAlpha ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n\n uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = argb;\n float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId;\n /* eslint-enable max-len */\n\n index += 20;\n }\n\n currentGroup.size = i - currentGroup.start;\n\n if (!_settings2.default.CAN_UPLOAD_SAME_BUFFER) {\n // this is still needed for IOS performance..\n // it really does not like uploading to the same buffer in a single frame!\n if (this.vaoMax <= this.vertexCount) {\n this.vaoMax++;\n\n var attrs = this.shader.attributes;\n\n /* eslint-disable max-len */\n var vertexBuffer = this.vertexBuffers[this.vertexCount] = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, null, gl.STREAM_DRAW);\n /* eslint-enable max-len */\n\n // build the vao object that will render..\n var vao = this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(vertexBuffer, attrs.aVertexPosition, gl.FLOAT, false, this.vertByteSize, 0).addAttribute(vertexBuffer, attrs.aTextureCoord, gl.UNSIGNED_SHORT, true, this.vertByteSize, 2 * 4).addAttribute(vertexBuffer, attrs.aColor, gl.UNSIGNED_BYTE, true, this.vertByteSize, 3 * 4);\n\n if (attrs.aTextureId) {\n vao.addAttribute(vertexBuffer, attrs.aTextureId, gl.FLOAT, false, this.vertByteSize, 4 * 4);\n }\n\n this.vaos[this.vertexCount] = vao;\n }\n\n this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, false);\n\n this.vertexCount++;\n } else {\n // lets use the faster option, always use buffer number 0\n this.vertexBuffers[this.vertexCount].upload(buffer.vertices, 0, true);\n }\n\n for (i = 0; i < MAX_TEXTURES; ++i) {\n rendererBoundTextures[i]._virtalBoundId = -1;\n }\n\n // render the groups..\n for (i = 0; i < groupCount; ++i) {\n var group = groups[i];\n var groupTextureCount = group.textureCount;\n\n for (var _j = 0; _j < groupTextureCount; _j++) {\n currentTexture = group.textures[_j];\n\n // reset virtual ids..\n // lets do a quick check..\n if (rendererBoundTextures[group.ids[_j]] !== currentTexture) {\n this.renderer.bindTexture(currentTexture, group.ids[_j], true);\n }\n\n // reset the virtualId..\n currentTexture._virtalBoundId = -1;\n }\n\n // set the blend mode..\n this.renderer.state.setBlendMode(group.blend);\n\n gl.drawElements(gl.TRIANGLES, group.size * 6, gl.UNSIGNED_SHORT, group.start * 6 * 2);\n }\n\n // reset elements for the next flush\n this.currentIndex = 0;\n };\n\n /**\n * Starts a new sprite batch.\n */\n\n\n SpriteRenderer.prototype.start = function start() {\n this.renderer.bindShader(this.shader);\n\n if (_settings2.default.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.bindVao(this.vaos[this.vertexCount]);\n\n this.vertexBuffers[this.vertexCount].bind();\n }\n };\n\n /**\n * Stops and flushes the current batch.\n *\n */\n\n\n SpriteRenderer.prototype.stop = function stop() {\n this.flush();\n };\n\n /**\n * Destroys the SpriteRenderer.\n *\n */\n\n\n SpriteRenderer.prototype.destroy = function destroy() {\n for (var i = 0; i < this.vaoMax; i++) {\n if (this.vertexBuffers[i]) {\n this.vertexBuffers[i].destroy();\n }\n if (this.vaos[i]) {\n this.vaos[i].destroy();\n }\n }\n\n if (this.indexBuffer) {\n this.indexBuffer.destroy();\n }\n\n this.renderer.off('prerender', this.onPrerender, this);\n\n _ObjectRenderer.prototype.destroy.call(this);\n\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n\n this.vertexBuffers = null;\n this.vaos = null;\n this.indexBuffer = null;\n this.indices = null;\n\n this.sprites = null;\n\n for (var _i = 0; _i < this.buffers.length; ++_i) {\n this.buffers[_i].destroy();\n }\n };\n\n return SpriteRenderer;\n}(_ObjectRenderer3.default);\n\nexports.default = SpriteRenderer;\n\n\n_WebGLRenderer2.default.registerPlugin('sprite', SpriteRenderer);\n//# sourceMappingURL=SpriteRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/webgl/SpriteRenderer.js\n// module id = 550\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = generateMultiTextureShader;\n\nvar _Shader = require('../../Shader');\n\nvar _Shader2 = _interopRequireDefault(_Shader);\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar fragTemplate = ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'varying float vTextureId;', 'uniform sampler2D uSamplers[%count%];', 'void main(void){', 'vec4 color;', 'float textureId = floor(vTextureId+0.5);', '%forloop%', 'gl_FragColor = color * vColor;', '}'].join('\\n');\n\nfunction generateMultiTextureShader(gl, maxTextures) {\n var vertexSrc = 'precision highp float;\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\nattribute float aTextureId;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vTextureId = aTextureId;\\n vColor = aColor;\\n}\\n';\n var fragmentSrc = fragTemplate;\n\n fragmentSrc = fragmentSrc.replace(/%count%/gi, maxTextures);\n fragmentSrc = fragmentSrc.replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n\n var shader = new _Shader2.default(gl, vertexSrc, fragmentSrc);\n\n var sampleValues = [];\n\n for (var i = 0; i < maxTextures; i++) {\n sampleValues[i] = i;\n }\n\n shader.bind();\n shader.uniforms.uSamplers = sampleValues;\n\n return shader;\n}\n\nfunction generateSampleSrc(maxTextures) {\n var src = '';\n\n src += '\\n';\n src += '\\n';\n\n for (var i = 0; i < maxTextures; i++) {\n if (i > 0) {\n src += '\\nelse ';\n }\n\n if (i < maxTextures - 1) {\n src += 'if(textureId == ' + i + '.0)';\n }\n\n src += '\\n{';\n src += '\\n\\tcolor = texture2D(uSamplers[' + i + '], vTextureCoord);';\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n}\n//# sourceMappingURL=generateMultiTextureShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/sprites/webgl/generateMultiTextureShader.js\n// module id = 551\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Sprite2 = require('../sprites/Sprite');\n\nvar _Sprite3 = _interopRequireDefault(_Sprite2);\n\nvar _Texture = require('../textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _math = require('../math');\n\nvar _utils = require('../utils');\n\nvar _const = require('../const');\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _TextStyle = require('./TextStyle');\n\nvar _TextStyle2 = _interopRequireDefault(_TextStyle);\n\nvar _TextMetrics = require('./TextMetrics');\n\nvar _TextMetrics2 = _interopRequireDefault(_TextMetrics);\n\nvar _trimCanvas = require('../utils/trimCanvas');\n\nvar _trimCanvas2 = _interopRequireDefault(_trimCanvas);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint max-depth: [2, 8] */\n\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true\n};\n\n/**\n * A Text Object will create a line or multiple lines of text. To split a line you can use '\\n' in your text string,\n * or add a wordWrap property set to true and and wordWrapWidth property with a value in the style object.\n *\n * A Text can be created directly from a string and a style object\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\n\nvar Text = function (_Sprite) {\n _inherits(Text, _Sprite);\n\n /**\n * @param {string} text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n _classCallCheck(this, Text);\n\n canvas = canvas || document.createElement('canvas');\n\n canvas.width = 3;\n canvas.height = 3;\n\n var texture = _Texture2.default.fromCanvas(canvas, _settings2.default.SCALE_MODE, 'text');\n\n texture.orig = new _math.Rectangle();\n texture.trim = new _math.Rectangle();\n\n // base texture is already automatically added to the cache, now adding the actual texture\n var _this = _possibleConstructorReturn(this, _Sprite.call(this, texture));\n\n _Texture2.default.addToCache(_this._texture, _this._texture.baseTexture.textureCacheIds[0]);\n\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.canvas = canvas;\n\n /**\n * The canvas 2d context that everything is drawn with\n * @member {CanvasRenderingContext2D}\n */\n _this.context = _this.canvas.getContext('2d');\n\n /**\n * The resolution / device pixel ratio of the canvas. This is set automatically by the renderer.\n * @member {number}\n * @default 1\n */\n _this.resolution = _settings2.default.RESOLUTION;\n\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = null;\n\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._style = null;\n /**\n * Private listener to track style changes.\n *\n * @member {Function}\n * @private\n */\n _this._styleListener = null;\n\n /**\n * Private tracker for the current font.\n *\n * @member {string}\n * @private\n */\n _this._font = '';\n\n _this.text = text;\n _this.style = style;\n\n _this.localStyleID = -1;\n return _this;\n }\n\n /**\n * Renders text and updates it when needed.\n *\n * @private\n * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n\n\n Text.prototype.updateText = function updateText(respectDirty) {\n var style = this._style;\n\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n\n if (!this.dirty && respectDirty) {\n return;\n }\n\n this._font = this._style.toFontString();\n\n var context = this.context;\n var measured = _TextMetrics2.default.measureText(this._text, this._style, this._style.wordWrap, this.canvas);\n var width = measured.width;\n var height = measured.height;\n var lines = measured.lines;\n var lineHeight = measured.lineHeight;\n var lineWidths = measured.lineWidths;\n var maxLineWidth = measured.maxLineWidth;\n var fontProperties = measured.fontProperties;\n\n this.canvas.width = Math.ceil((width + style.padding * 2) * this.resolution);\n this.canvas.height = Math.ceil((height + style.padding * 2) * this.resolution);\n\n context.scale(this.resolution, this.resolution);\n\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n\n context.font = this._font;\n context.strokeStyle = style.stroke;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n\n var linePositionX = void 0;\n var linePositionY = void 0;\n\n if (style.dropShadow) {\n context.fillStyle = style.dropShadowColor;\n context.globalAlpha = style.dropShadowAlpha;\n context.shadowBlur = style.dropShadowBlur;\n\n if (style.dropShadowBlur > 0) {\n context.shadowColor = style.dropShadowColor;\n }\n\n var xShadowOffset = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n var yShadowOffset = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;\n\n for (var i = 0; i < lines.length; i++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = style.strokeThickness / 2 + i * lineHeight + fontProperties.ascent;\n\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i];\n } else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i]) / 2;\n }\n\n if (style.fill) {\n this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding);\n\n if (style.stroke && style.strokeThickness) {\n context.strokeStyle = style.dropShadowColor;\n this.drawLetterSpacing(lines[i], linePositionX + xShadowOffset + style.padding, linePositionY + yShadowOffset + style.padding, true);\n context.strokeStyle = style.stroke;\n }\n }\n }\n }\n\n // reset the shadow blur and alpha that was set by the drop shadow, for the regular text\n context.shadowBlur = 0;\n context.globalAlpha = 1;\n\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines);\n\n // draw lines line by line\n for (var _i = 0; _i < lines.length; _i++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = style.strokeThickness / 2 + _i * lineHeight + fontProperties.ascent;\n\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[_i];\n } else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[_i]) / 2;\n }\n\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[_i], linePositionX + style.padding, linePositionY + style.padding, true);\n }\n\n if (style.fill) {\n this.drawLetterSpacing(lines[_i], linePositionX + style.padding, linePositionY + style.padding);\n }\n }\n\n this.updateTexture();\n };\n\n /**\n * Render the text with letter-spacing.\n * @param {string} text - The text to draw\n * @param {number} x - Horizontal position to draw the text\n * @param {number} y - Vertical position to draw the text\n * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n * @private\n */\n\n\n Text.prototype.drawLetterSpacing = function drawLetterSpacing(text, x, y) {\n var isStroke = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var style = this._style;\n\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n\n if (letterSpacing === 0) {\n if (isStroke) {\n this.context.strokeText(text, x, y);\n } else {\n this.context.fillText(text, x, y);\n }\n\n return;\n }\n\n var characters = String.prototype.split.call(text, '');\n var currentPosition = x;\n var index = 0;\n var current = '';\n\n while (index < text.length) {\n current = characters[index++];\n if (isStroke) {\n this.context.strokeText(current, currentPosition, y);\n } else {\n this.context.fillText(current, currentPosition, y);\n }\n currentPosition += this.context.measureText(current).width + letterSpacing;\n }\n };\n\n /**\n * Updates texture size based on canvas size\n *\n * @private\n */\n\n\n Text.prototype.updateTexture = function updateTexture() {\n var canvas = this.canvas;\n\n if (this._style.trim) {\n var trimmed = (0, _trimCanvas2.default)(canvas);\n\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n\n var texture = this._texture;\n var style = this._style;\n var padding = style.trim ? 0 : style.padding;\n var baseTexture = texture.baseTexture;\n\n baseTexture.hasLoaded = true;\n baseTexture.resolution = this.resolution;\n\n baseTexture.realWidth = canvas.width;\n baseTexture.realHeight = canvas.height;\n baseTexture.width = canvas.width / this.resolution;\n baseTexture.height = canvas.height / this.resolution;\n\n texture.trim.width = texture._frame.width = canvas.width / this.resolution;\n texture.trim.height = texture._frame.height = canvas.height / this.resolution;\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n\n texture.orig.width = texture._frame.width - padding * 2;\n texture.orig.height = texture._frame.height - padding * 2;\n\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n\n baseTexture.emit('update', baseTexture);\n\n this.dirty = false;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n Text.prototype.renderWebGL = function renderWebGL(renderer) {\n if (this.resolution !== renderer.resolution) {\n this.resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n _Sprite.prototype.renderWebGL.call(this, renderer);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The renderer\n */\n\n\n Text.prototype._renderCanvas = function _renderCanvas(renderer) {\n if (this.resolution !== renderer.resolution) {\n this.resolution = renderer.resolution;\n this.dirty = true;\n }\n\n this.updateText(true);\n\n _Sprite.prototype._renderCanvas.call(this, renderer);\n };\n\n /**\n * Gets the local bounds of the text object.\n *\n * @param {Rectangle} rect - The output rectangle.\n * @return {Rectangle} The bounds.\n */\n\n\n Text.prototype.getLocalBounds = function getLocalBounds(rect) {\n this.updateText(true);\n\n return _Sprite.prototype.getLocalBounds.call(this, rect);\n };\n\n /**\n * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.\n */\n\n\n Text.prototype._calculateBounds = function _calculateBounds() {\n this.updateText(true);\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n\n /**\n * Method to be called upon a TextStyle change.\n * @private\n */\n\n\n Text.prototype._onStyleChange = function _onStyleChange() {\n this.dirty = true;\n };\n\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\n\n\n Text.prototype._generateFillStyle = function _generateFillStyle(style, lines) {\n if (!Array.isArray(style.fill)) {\n return style.fill;\n }\n\n // cocoon on canvas+ cannot generate textures, so use the first colour instead\n if (navigator.isCocoonJS) {\n return style.fill[0];\n }\n\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient = void 0;\n var totalIterations = void 0;\n var currentIteration = void 0;\n var stop = void 0;\n\n var width = this.canvas.width / this.resolution;\n var height = this.canvas.height / this.resolution;\n\n // make a copy of the style settings, so we can manipulate them later\n var fill = style.fill.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(style.fill[0]);\n fillGradientStops.unshift(0);\n\n fill.push(style.fill[style.fill.length - 1]);\n fillGradientStops.push(1);\n\n if (style.fillGradientType === _const.TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, 0, width / 2, height);\n\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n totalIterations = (fill.length + 1) * lines.length;\n currentIteration = 0;\n for (var _i2 = 0; _i2 < lines.length; _i2++) {\n currentIteration += 1;\n for (var j = 0; j < fill.length; j++) {\n if (typeof fillGradientStops[j] === 'number') {\n stop = fillGradientStops[j] / lines.length + _i2 / lines.length;\n } else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[j]);\n currentIteration++;\n }\n }\n } else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(0, height / 2, width, height / 2);\n\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n totalIterations = fill.length + 1;\n currentIteration = 1;\n\n for (var _i3 = 0; _i3 < fill.length; _i3++) {\n if (typeof fillGradientStops[_i3] === 'number') {\n stop = fillGradientStops[_i3];\n } else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[_i3]);\n currentIteration++;\n }\n }\n\n return gradient;\n };\n\n /**\n * Destroys this text object.\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n\n\n Text.prototype.destroy = function destroy(options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n\n options = Object.assign({}, defaultDestroyOptions, options);\n\n _Sprite.prototype.destroy.call(this, options);\n\n // make sure to reset the the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n\n this._style = null;\n };\n\n /**\n * The width of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(Text, [{\n key: 'width',\n get: function get() {\n this.updateText(true);\n\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.updateText(true);\n\n var s = (0, _utils.sign)(this.scale.x) || 1;\n\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n }\n\n /**\n * The height of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n this.updateText(true);\n\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.updateText(true);\n\n var s = (0, _utils.sign)(this.scale.y) || 1;\n\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n }\n\n /**\n * Set the style of the text. Set up an event listener to listen for changes on the style\n * object and mark the text as dirty.\n *\n * @member {object|PIXI.TextStyle}\n */\n\n }, {\n key: 'style',\n get: function get() {\n return this._style;\n },\n set: function set(style) // eslint-disable-line require-jsdoc\n {\n style = style || {};\n\n if (style instanceof _TextStyle2.default) {\n this._style = style;\n } else {\n this._style = new _TextStyle2.default(style);\n }\n\n this.localStyleID = -1;\n this.dirty = true;\n }\n\n /**\n * Set the copy for the text object. To split a line you can use '\\n'.\n *\n * @member {string}\n */\n\n }, {\n key: 'text',\n get: function get() {\n return this._text;\n },\n set: function set(text) // eslint-disable-line require-jsdoc\n {\n text = String(text === '' || text === null || text === undefined ? ' ' : text);\n\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n }\n }]);\n\n return Text;\n}(_Sprite3.default);\n\nexports.default = Text;\n//# sourceMappingURL=Text.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/text/Text.js\n// module id = 552\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _ = require('../');\n\nvar _utils = require('../utils');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Utility class for maintaining reference to a collection\n * of Textures on a single Spritesheet.\n *\n * @class\n * @memberof PIXI\n */\nvar Spritesheet = function () {\n _createClass(Spritesheet, null, [{\n key: 'BATCH_SIZE',\n\n /**\n * The maximum number of Textures to build per process.\n *\n * @type {number}\n * @default 1000\n */\n get: function get() {\n return 1000;\n }\n\n /**\n * @param {PIXI.BaseTexture} baseTexture Reference to the source BaseTexture object.\n * @param {Object} data - Spritesheet image data.\n * @param {string} [resolutionFilename] - The filename to consider when determining\n * the resolution of the spritesheet. If not provided, the imageUrl will\n * be used on the BaseTexture.\n */\n\n }]);\n\n function Spritesheet(baseTexture, data) {\n var resolutionFilename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n _classCallCheck(this, Spritesheet);\n\n /**\n * Reference to ths source texture\n * @type {PIXI.BaseTexture}\n */\n this.baseTexture = baseTexture;\n\n /**\n * Map of spritesheet textures.\n * @type {Object}\n */\n this.textures = {};\n\n /**\n * Reference to the original JSON data.\n * @type {Object}\n */\n this.data = data;\n\n /**\n * The resolution of the spritesheet.\n * @type {number}\n */\n this.resolution = this._updateResolution(resolutionFilename || this.baseTexture.imageUrl);\n\n /**\n * Map of spritesheet frames.\n * @type {Object}\n * @private\n */\n this._frames = this.data.frames;\n\n /**\n * Collection of frame names.\n * @type {string[]}\n * @private\n */\n this._frameKeys = Object.keys(this._frames);\n\n /**\n * Current batch index being processed.\n * @type {number}\n * @private\n */\n this._batchIndex = 0;\n\n /**\n * Callback when parse is completed.\n * @type {Function}\n * @private\n */\n this._callback = null;\n }\n\n /**\n * Generate the resolution from the filename or fallback\n * to the meta.scale field of the JSON data.\n *\n * @private\n * @param {string} resolutionFilename - The filename to use for resolving\n * the default resolution.\n * @return {number} Resolution to use for spritesheet.\n */\n\n\n Spritesheet.prototype._updateResolution = function _updateResolution(resolutionFilename) {\n var scale = this.data.meta.scale;\n\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = (0, _utils.getResolutionOfUrl)(resolutionFilename, null);\n\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? parseFloat(scale) : 1;\n }\n\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n this.baseTexture.resolution = resolution;\n this.baseTexture.update();\n }\n\n return resolution;\n };\n\n /**\n * Parser spritesheet from loaded data. This is done asynchronously\n * to prevent creating too many Texture within a single process.\n *\n * @param {Function} callback - Callback when complete returns\n * a map of the Textures for this spritesheet.\n */\n\n\n Spritesheet.prototype.parse = function parse(callback) {\n this._batchIndex = 0;\n this._callback = callback;\n\n if (this._frameKeys.length <= Spritesheet.BATCH_SIZE) {\n this._processFrames(0);\n this._parseComplete();\n } else {\n this._nextBatch();\n }\n };\n\n /**\n * Process a batch of frames\n *\n * @private\n * @param {number} initialFrameIndex - The index of frame to start.\n */\n\n\n Spritesheet.prototype._processFrames = function _processFrames(initialFrameIndex) {\n var frameIndex = initialFrameIndex;\n var maxFrames = Spritesheet.BATCH_SIZE;\n var sourceScale = this.baseTexture.sourceScale;\n\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n var i = this._frameKeys[frameIndex];\n var rect = this._frames[i].frame;\n\n if (rect) {\n var frame = null;\n var trim = null;\n var orig = new _.Rectangle(0, 0, Math.floor(this._frames[i].sourceSize.w * sourceScale) / this.resolution, Math.floor(this._frames[i].sourceSize.h * sourceScale) / this.resolution);\n\n if (this._frames[i].rotated) {\n frame = new _.Rectangle(Math.floor(rect.x * sourceScale) / this.resolution, Math.floor(rect.y * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution);\n } else {\n frame = new _.Rectangle(Math.floor(rect.x * sourceScale) / this.resolution, Math.floor(rect.y * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution);\n }\n\n // Check to see if the sprite is trimmed\n if (this._frames[i].trimmed) {\n trim = new _.Rectangle(Math.floor(this._frames[i].spriteSourceSize.x * sourceScale) / this.resolution, Math.floor(this._frames[i].spriteSourceSize.y * sourceScale) / this.resolution, Math.floor(rect.w * sourceScale) / this.resolution, Math.floor(rect.h * sourceScale) / this.resolution);\n }\n\n this.textures[i] = new _.Texture(this.baseTexture, frame, orig, trim, this._frames[i].rotated ? 2 : 0);\n\n // lets also add the frame to pixi's global cache for fromFrame and fromImage functions\n _.Texture.addToCache(this.textures[i], i);\n }\n\n frameIndex++;\n }\n };\n\n /**\n * The parse has completed.\n *\n * @private\n */\n\n\n Spritesheet.prototype._parseComplete = function _parseComplete() {\n var callback = this._callback;\n\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n };\n\n /**\n * Begin the next batch of textures.\n *\n * @private\n */\n\n\n Spritesheet.prototype._nextBatch = function _nextBatch() {\n var _this = this;\n\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) {\n _this._nextBatch();\n } else {\n _this._parseComplete();\n }\n }, 0);\n };\n\n /**\n * Destroy Spritesheet and don't use after this.\n *\n * @param {boolean} [destroyBase=false] Whether to destroy the base texture as well\n */\n\n\n Spritesheet.prototype.destroy = function destroy() {\n var destroyBase = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n for (var i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n this.baseTexture.destroy();\n }\n this.baseTexture = null;\n };\n\n return Spritesheet;\n}();\n\nexports.default = Spritesheet;\n//# sourceMappingURL=Spritesheet.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/textures/Spritesheet.js\n// module id = 553\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _settings = require('../settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nvar _const = require('../const');\n\nvar _TickerListener = require('./TickerListener');\n\nvar _TickerListener2 = _interopRequireDefault(_TickerListener);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n * This class is composed around listeners\n * meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary,\n * e.g. When the ticker is started and the emitter has listeners.\n *\n * @class\n * @memberof PIXI.ticker\n */\nvar Ticker = function () {\n /**\n *\n */\n function Ticker() {\n var _this = this;\n\n _classCallCheck(this, Ticker);\n\n /**\n * The first listener. All new listeners added are chained on this.\n * @private\n * @type {TickerListener}\n */\n this._head = new _TickerListener2.default(null, null, Infinity);\n\n /**\n * Internal current frame request ID\n * @private\n */\n this._requestId = null;\n\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n * @private\n */\n this._maxElapsedMS = 100;\n\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.ticker.Ticker#start} automatically\n * when a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.autoStart = false;\n\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.ticker.Ticker#minFPS}\n * and is scaled with {@link PIXI.ticker.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n *\n * @member {number}\n * @default 1\n */\n this.deltaTime = 1;\n\n /**\n * Time elapsed in milliseconds from last frame to this frame.\n * Opposed to what the scalar {@link PIXI.ticker.Ticker#deltaTime}\n * is based, this value is neither capped nor scaled.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n *\n * @member {number}\n * @default 16.66\n */\n this.elapsedMS = 1 / _settings2.default.TARGET_FPMS;\n\n /**\n * The last time {@link PIXI.ticker.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * @member {number}\n * @default -1\n */\n this.lastTime = -1;\n\n /**\n * Factor of current {@link PIXI.ticker.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n *\n * @member {number}\n * @default 1\n */\n this.speed = 1;\n\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.ticker.Ticker#start} has been called.\n * `false` if {@link PIXI.ticker.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.ticker.Ticker#autoStart} being `true`\n * and a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.started = false;\n\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n *\n * @private\n * @param {number} time - Time since last tick.\n */\n this._tick = function (time) {\n _this._requestId = null;\n\n if (_this.started) {\n // Invoke listeners now\n _this.update(time);\n // Listener side effects may have modified ticker state.\n if (_this.started && _this._requestId === null && _this._head.next) {\n _this._requestId = requestAnimationFrame(_this._tick);\n }\n }\n };\n }\n\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n *\n * @private\n */\n\n\n Ticker.prototype._requestIfNeeded = function _requestIfNeeded() {\n if (this._requestId === null && this._head.next) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._requestId = requestAnimationFrame(this._tick);\n }\n };\n\n /**\n * Conditionally cancels a pending animation frame.\n *\n * @private\n */\n\n\n Ticker.prototype._cancelIfNeeded = function _cancelIfNeeded() {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n };\n\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n *\n * @private\n */\n\n\n Ticker.prototype._startIfPossible = function _startIfPossible() {\n if (this.started) {\n this._requestIfNeeded();\n } else if (this.autoStart) {\n this.start();\n }\n };\n\n /**\n * Register a handler for tick events. Calls continuously unless\n * it is removed or the ticker is stopped.\n *\n * @param {Function} fn - The listener function to be added for updates\n * @param {Function} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.add = function add(fn, context) {\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL;\n\n return this._addListener(new _TickerListener2.default(fn, context, priority));\n };\n\n /**\n * Add a handler for the tick event which is only execute once.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.addOnce = function addOnce(fn, context) {\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.UPDATE_PRIORITY.NORMAL;\n\n return this._addListener(new _TickerListener2.default(fn, context, priority, true));\n };\n\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n *\n * @private\n * @param {TickerListener} listener - Current listener being added.\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype._addListener = function _addListener(listener) {\n // For attaching to head\n var current = this._head.next;\n var previous = this._head;\n\n // Add the first item\n if (!current) {\n listener.connect(previous);\n } else {\n // Go from highest to lowest priority\n while (current) {\n if (listener.priority > current.priority) {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n\n // Not yet connected\n if (!listener.previous) {\n listener.connect(previous);\n }\n }\n\n this._startIfPossible();\n\n return this;\n };\n\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n *\n * @param {Function} fn - The listener function to be removed\n * @param {Function} [context] - The listener context to be removed\n * @returns {PIXI.ticker.Ticker} This instance of a ticker\n */\n\n\n Ticker.prototype.remove = function remove(fn, context) {\n var listener = this._head.next;\n\n while (listener) {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context)) {\n listener = listener.destroy();\n } else {\n listener = listener.next;\n }\n }\n\n if (!this._head.next) {\n this._cancelIfNeeded();\n }\n\n return this;\n };\n\n /**\n * Starts the ticker. If the ticker has listeners\n * a new animation frame is requested at this point.\n */\n\n\n Ticker.prototype.start = function start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n };\n\n /**\n * Stops the ticker. If the ticker has requested\n * an animation frame it is canceled at this point.\n */\n\n\n Ticker.prototype.stop = function stop() {\n if (this.started) {\n this.started = false;\n this._cancelIfNeeded();\n }\n };\n\n /**\n * Destroy the ticker and don't use after this. Calling\n * this method removes all references to internal events.\n */\n\n\n Ticker.prototype.destroy = function destroy() {\n this.stop();\n\n var listener = this._head.next;\n\n while (listener) {\n listener = listener.destroy(true);\n }\n\n this._head.destroy();\n this._head = null;\n };\n\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.ticker.Ticker#elapsedMS},\n * the current {@link PIXI.ticker.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.ticker.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n *\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n\n\n Ticker.prototype.update = function update() {\n var currentTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();\n\n var elapsedMS = void 0;\n\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n\n if (currentTime > this.lastTime) {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n\n this.deltaTime = elapsedMS * _settings2.default.TARGET_FPMS * this.speed;\n\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n var head = this._head;\n\n // Invoke listeners added to internal emitter\n var listener = head.next;\n\n while (listener) {\n listener = listener.emit(this.deltaTime);\n }\n\n if (!head.next) {\n this._cancelIfNeeded();\n }\n } else {\n this.deltaTime = this.elapsedMS = 0;\n }\n\n this.lastTime = currentTime;\n };\n\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.ticker.Ticker#speed}, which is specific\n * to scaling {@link PIXI.ticker.Ticker#deltaTime}.\n *\n * @member {number}\n * @readonly\n */\n\n\n _createClass(Ticker, [{\n key: 'FPS',\n get: function get() {\n return 1000 / this.elapsedMS;\n }\n\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.ticker.Ticker#update}.\n * This value is used to cap {@link PIXI.ticker.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.ticker.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n *\n * @member {number}\n * @default 10\n */\n\n }, {\n key: 'minFPS',\n get: function get() {\n return 1000 / this._maxElapsedMS;\n },\n set: function set(fps) // eslint-disable-line require-jsdoc\n {\n // Clamp: 0 to TARGET_FPMS\n var minFPMS = Math.min(Math.max(0, fps) / 1000, _settings2.default.TARGET_FPMS);\n\n this._maxElapsedMS = 1 / minFPMS;\n }\n }]);\n\n return Ticker;\n}();\n\nexports.default = Ticker;\n//# sourceMappingURL=Ticker.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/ticker/Ticker.js\n// module id = 554\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n *\n * @private\n * @class\n * @memberof PIXI.ticker\n */\nvar TickerListener = function () {\n /**\n * Constructor\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} [context=null] - The listener context\n * @param {number} [priority=0] - The priority for emitting\n * @param {boolean} [once=false] - If the handler should fire once\n */\n function TickerListener(fn) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n _classCallCheck(this, TickerListener);\n\n /**\n * The handler function to execute.\n * @member {Function}\n */\n this.fn = fn;\n\n /**\n * The calling to execute.\n * @member {Function}\n */\n this.context = context;\n\n /**\n * The current priority.\n * @member {number}\n */\n this.priority = priority;\n\n /**\n * If this should only execute once.\n * @member {boolean}\n */\n this.once = once;\n\n /**\n * The next item in chain.\n * @member {TickerListener}\n */\n this.next = null;\n\n /**\n * The previous item in chain.\n * @member {TickerListener}\n */\n this.previous = null;\n\n /**\n * `true` if this listener has been destroyed already.\n * @member {boolean}\n * @private\n */\n this._destroyed = false;\n }\n\n /**\n * Simple compare function to figure out if a function and context match.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {Function} context - The listener context\n * @return {boolean} `true` if the listener match the arguments\n */\n\n\n TickerListener.prototype.match = function match(fn, context) {\n context = context || null;\n\n return this.fn === fn && this.context === context;\n };\n\n /**\n * Emit by calling the current function.\n * @param {number} deltaTime - time since the last emit.\n * @return {TickerListener} Next ticker\n */\n\n\n TickerListener.prototype.emit = function emit(deltaTime) {\n if (this.fn) {\n if (this.context) {\n this.fn.call(this.context, deltaTime);\n } else {\n this.fn(deltaTime);\n }\n }\n\n var redirect = this.next;\n\n if (this.once) {\n this.destroy(true);\n }\n\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed) {\n this.next = null;\n }\n\n return redirect;\n };\n\n /**\n * Connect to the list.\n * @param {TickerListener} previous - Input node, previous listener\n */\n\n\n TickerListener.prototype.connect = function connect(previous) {\n this.previous = previous;\n if (previous.next) {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n };\n\n /**\n * Destroy and don't use after this.\n * @param {boolean} [hard = false] `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @return {TickerListener} The listener to redirect while emitting or removing.\n */\n\n\n TickerListener.prototype.destroy = function destroy() {\n var hard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this._destroyed = true;\n this.fn = null;\n this.context = null;\n\n // Disconnect, hook up next and previous\n if (this.previous) {\n this.previous.next = this.next;\n }\n\n if (this.next) {\n this.next.previous = this.previous;\n }\n\n // Redirect to the next item\n var redirect = this.previous;\n\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n\n return redirect;\n };\n\n return TickerListener;\n}();\n\nexports.default = TickerListener;\n//# sourceMappingURL=TickerListener.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/ticker/TickerListener.js\n// module id = 555\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.default = canUploadSameBuffer;\nfunction canUploadSameBuffer() {\n\t// Uploading the same buffer multiple times in a single frame can cause perf issues.\n\t// Apparent on IOS so only check for that at the moment\n\t// this check may become more complex if this issue pops up elsewhere.\n\tvar ios = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);\n\n\treturn !ios;\n}\n//# sourceMappingURL=canUploadSameBuffer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/canUploadSameBuffer.js\n// module id = 556\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = determineCrossOrigin;\n\nvar _url2 = require('url');\n\nvar _url3 = _interopRequireDefault(_url2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar tempAnchor = void 0;\n\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n *\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\nfunction determineCrossOrigin(url) {\n var loc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location;\n\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n }\n\n // default is window.location\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n url = _url3.default.parse(tempAnchor.href);\n\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n\n // if cross origin\n if (url.hostname !== loc.hostname || !samePort || url.protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n}\n//# sourceMappingURL=determineCrossOrigin.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/determineCrossOrigin.js\n// module id = 557\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = mapPremultipliedBlendModes;\n\nvar _const = require('../const');\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n *\n * @memberof PIXI\n * @function mapPremultipliedBlendModes\n * @private\n * @param {Array} [array] - The array to output into.\n * @return {Array} Mapped modes.\n */\n\nfunction mapPremultipliedBlendModes() {\n var pm = [];\n var npm = [];\n\n for (var i = 0; i < 32; i++) {\n pm[i] = i;\n npm[i] = i;\n }\n\n pm[_const.BLEND_MODES.NORMAL_NPM] = _const.BLEND_MODES.NORMAL;\n pm[_const.BLEND_MODES.ADD_NPM] = _const.BLEND_MODES.ADD;\n pm[_const.BLEND_MODES.SCREEN_NPM] = _const.BLEND_MODES.SCREEN;\n\n npm[_const.BLEND_MODES.NORMAL] = _const.BLEND_MODES.NORMAL_NPM;\n npm[_const.BLEND_MODES.ADD] = _const.BLEND_MODES.ADD_NPM;\n npm[_const.BLEND_MODES.SCREEN] = _const.BLEND_MODES.SCREEN_NPM;\n\n var array = [];\n\n array.push(npm);\n array.push(pm);\n\n return array;\n}\n//# sourceMappingURL=mapPremultipliedBlendModes.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/mapPremultipliedBlendModes.js\n// module id = 558\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = maxRecommendedTextures;\n\nvar _ismobilejs = require('ismobilejs');\n\nvar _ismobilejs2 = _interopRequireDefault(_ismobilejs);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction maxRecommendedTextures(max) {\n if (_ismobilejs2.default.tablet || _ismobilejs2.default.phone) {\n // check if the res is iphone 6 or higher..\n return 4;\n }\n\n // desktop should be ok\n return max;\n}\n//# sourceMappingURL=maxRecommendedTextures.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/maxRecommendedTextures.js\n// module id = 559\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\nexports.mixin = mixin;\nexports.delayMixin = delayMixin;\nexports.performMixins = performMixins;\n/**\n * Mixes all enumerable properties and methods from a source object to a target object.\n *\n * @memberof PIXI.utils.mixins\n * @function mixin\n * @param {object} target The prototype or instance that properties and methods should be added to.\n * @param {object} source The source of properties and methods to mix in.\n */\nfunction mixin(target, source) {\n if (!target || !source) return;\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n var keys = Object.keys(source);\n\n // loop through properties\n for (var i = 0; i < keys.length; ++i) {\n var propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(target, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));\n }\n}\n\nvar mixins = [];\n\n/**\n * Queues a mixin to be handled towards the end of the initialization of PIXI, so that deprecation\n * can take effect.\n *\n * @memberof PIXI.utils.mixins\n * @function delayMixin\n * @private\n * @param {object} target The prototype or instance that properties and methods should be added to.\n * @param {object} source The source of properties and methods to mix in.\n */\nfunction delayMixin(target, source) {\n mixins.push(target, source);\n}\n\n/**\n * Handles all mixins queued via delayMixin().\n *\n * @memberof PIXI.utils.mixins\n * @function performMixins\n * @private\n */\nfunction performMixins() {\n for (var i = 0; i < mixins.length; i += 2) {\n mixin(mixins[i], mixins[i + 1]);\n }\n mixins.length = 0;\n}\n//# sourceMappingURL=mixin.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/mixin.js\n// module id = 560\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n/**\n * Mixins functionality to make an object have \"plugins\".\n *\n * @example\n * function MyObject() {}\n *\n * pluginTarget.mixin(MyObject);\n *\n * @mixin\n * @memberof PIXI.utils\n * @param {object} obj - The object to mix into.\n */\nfunction pluginTarget(obj) {\n obj.__plugins = {};\n\n /**\n * Adds a plugin to an object\n *\n * @param {string} pluginName - The events that should be listed.\n * @param {Function} ctor - The constructor function for the plugin.\n */\n obj.registerPlugin = function registerPlugin(pluginName, ctor) {\n obj.__plugins[pluginName] = ctor;\n };\n\n /**\n * Instantiates all the plugins of this object\n *\n */\n obj.prototype.initPlugins = function initPlugins() {\n this.plugins = this.plugins || {};\n\n for (var o in obj.__plugins) {\n this.plugins[o] = new obj.__plugins[o](this);\n }\n };\n\n /**\n * Removes all the plugins of this object\n *\n */\n obj.prototype.destroyPlugins = function destroyPlugins() {\n for (var o in this.plugins) {\n this.plugins[o].destroy();\n this.plugins[o] = null;\n }\n\n this.plugins = null;\n };\n}\n\nexports.default = {\n /**\n * Mixes in the properties of the pluginTarget into another object\n *\n * @param {object} obj - The obj to mix into\n */\n mixin: function mixin(obj) {\n pluginTarget(obj);\n }\n};\n//# sourceMappingURL=pluginTarget.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/pluginTarget.js\n// module id = 561\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = trimCanvas;\n/**\n * Trim transparent borders from a canvas\n *\n * @memberof PIXI\n * @function trimCanvas\n * @private\n * @param {HTMLCanvasElement} canvas - the canvas to trim\n * @returns {object} Trim data\n */\nfunction trimCanvas(canvas) {\n // https://gist.github.com/remy/784508\n\n var width = canvas.width;\n var height = canvas.height;\n\n var context = canvas.getContext('2d');\n var imageData = context.getImageData(0, 0, width, height);\n var pixels = imageData.data;\n var len = pixels.length;\n\n var bound = {\n top: null,\n left: null,\n right: null,\n bottom: null\n };\n var i = void 0;\n var x = void 0;\n var y = void 0;\n\n for (i = 0; i < len; i += 4) {\n if (pixels[i + 3] !== 0) {\n x = i / 4 % width;\n y = ~~(i / 4 / width);\n\n if (bound.top === null) {\n bound.top = y;\n }\n\n if (bound.left === null) {\n bound.left = x;\n } else if (x < bound.left) {\n bound.left = x;\n }\n\n if (bound.right === null) {\n bound.right = x + 1;\n } else if (bound.right < x) {\n bound.right = x + 1;\n }\n\n if (bound.bottom === null) {\n bound.bottom = y;\n } else if (bound.bottom < y) {\n bound.bottom = y;\n }\n }\n }\n\n width = bound.right - bound.left;\n height = bound.bottom - bound.top + 1;\n\n var data = context.getImageData(bound.left, bound.top, width, height);\n\n return {\n height: height,\n width: width,\n data: data\n };\n}\n//# sourceMappingURL=trimCanvas.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/core/utils/trimCanvas.js\n// module id = 562\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.default = deprecation;\n// provide method to give a stack track for warnings\n// useful for tracking-down where deprecated methods/properties/classes\n// are being used within the code\nfunction warn(msg) {\n // @if DEBUG\n /* eslint-disable no-console */\n var stack = new Error().stack;\n\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('Deprecation Warning: ', msg);\n } else {\n // chop off the stack trace which includes pixi.js internal calls\n stack = stack.split('\\n').splice(3).join('\\n');\n\n if (console.groupCollapsed) {\n console.groupCollapsed('%cDeprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', msg);\n console.warn(stack);\n console.groupEnd();\n } else {\n console.warn('Deprecation Warning: ', msg);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n // @endif\n}\n\nfunction deprecation(core) {\n var mesh = core.mesh,\n particles = core.particles,\n extras = core.extras,\n filters = core.filters,\n prepare = core.prepare,\n loaders = core.loaders,\n interaction = core.interaction;\n\n\n Object.defineProperties(core, {\n\n /**\n * @class\n * @private\n * @name SpriteBatch\n * @memberof PIXI\n * @see PIXI.ParticleContainer\n * @throws {ReferenceError} SpriteBatch does not exist any more, please use the new ParticleContainer instead.\n * @deprecated since version 3.0.0\n */\n SpriteBatch: {\n get: function get() {\n throw new ReferenceError('SpriteBatch does not exist any more, ' + 'please use the new ParticleContainer instead.');\n }\n },\n\n /**\n * @class\n * @private\n * @name AssetLoader\n * @memberof PIXI\n * @see PIXI.loaders.Loader\n * @throws {ReferenceError} The loader system was overhauled in PixiJS v3,\n * please see the new PIXI.loaders.Loader class.\n * @deprecated since version 3.0.0\n */\n AssetLoader: {\n get: function get() {\n throw new ReferenceError('The loader system was overhauled in PixiJS v3, ' + 'please see the new PIXI.loaders.Loader class.');\n }\n },\n\n /**\n * @class\n * @private\n * @name Stage\n * @memberof PIXI\n * @see PIXI.Container\n * @deprecated since version 3.0.0\n */\n Stage: {\n get: function get() {\n warn('You do not need to use a PIXI Stage any more, you can simply render any container.');\n\n return core.Container;\n }\n },\n\n /**\n * @class\n * @private\n * @name DisplayObjectContainer\n * @memberof PIXI\n * @see PIXI.Container\n * @deprecated since version 3.0.0\n */\n DisplayObjectContainer: {\n get: function get() {\n warn('DisplayObjectContainer has been shortened to Container, please use Container from now on.');\n\n return core.Container;\n }\n },\n\n /**\n * @class\n * @private\n * @name Strip\n * @memberof PIXI\n * @see PIXI.mesh.Mesh\n * @deprecated since version 3.0.0\n */\n Strip: {\n get: function get() {\n warn('The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on.');\n\n return mesh.Mesh;\n }\n },\n\n /**\n * @class\n * @private\n * @name Rope\n * @memberof PIXI\n * @see PIXI.mesh.Rope\n * @deprecated since version 3.0.0\n */\n Rope: {\n get: function get() {\n warn('The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on.');\n\n return mesh.Rope;\n }\n },\n\n /**\n * @class\n * @private\n * @name ParticleContainer\n * @memberof PIXI\n * @see PIXI.particles.ParticleContainer\n * @deprecated since version 4.0.0\n */\n ParticleContainer: {\n get: function get() {\n warn('The ParticleContainer class has been moved to particles.ParticleContainer, ' + 'please use particles.ParticleContainer from now on.');\n\n return particles.ParticleContainer;\n }\n },\n\n /**\n * @class\n * @private\n * @name MovieClip\n * @memberof PIXI\n * @see PIXI.extras.MovieClip\n * @deprecated since version 3.0.0\n */\n MovieClip: {\n get: function get() {\n warn('The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite.');\n\n return extras.AnimatedSprite;\n }\n },\n\n /**\n * @class\n * @private\n * @name TilingSprite\n * @memberof PIXI\n * @see PIXI.extras.TilingSprite\n * @deprecated since version 3.0.0\n */\n TilingSprite: {\n get: function get() {\n warn('The TilingSprite class has been moved to extras.TilingSprite, ' + 'please use extras.TilingSprite from now on.');\n\n return extras.TilingSprite;\n }\n },\n\n /**\n * @class\n * @private\n * @name BitmapText\n * @memberof PIXI\n * @see PIXI.extras.BitmapText\n * @deprecated since version 3.0.0\n */\n BitmapText: {\n get: function get() {\n warn('The BitmapText class has been moved to extras.BitmapText, ' + 'please use extras.BitmapText from now on.');\n\n return extras.BitmapText;\n }\n },\n\n /**\n * @class\n * @private\n * @name blendModes\n * @memberof PIXI\n * @see PIXI.BLEND_MODES\n * @deprecated since version 3.0.0\n */\n blendModes: {\n get: function get() {\n warn('The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on.');\n\n return core.BLEND_MODES;\n }\n },\n\n /**\n * @class\n * @private\n * @name scaleModes\n * @memberof PIXI\n * @see PIXI.SCALE_MODES\n * @deprecated since version 3.0.0\n */\n scaleModes: {\n get: function get() {\n warn('The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on.');\n\n return core.SCALE_MODES;\n }\n },\n\n /**\n * @class\n * @private\n * @name BaseTextureCache\n * @memberof PIXI\n * @see PIXI.utils.BaseTextureCache\n * @deprecated since version 3.0.0\n */\n BaseTextureCache: {\n get: function get() {\n warn('The BaseTextureCache class has been moved to utils.BaseTextureCache, ' + 'please use utils.BaseTextureCache from now on.');\n\n return core.utils.BaseTextureCache;\n }\n },\n\n /**\n * @class\n * @private\n * @name TextureCache\n * @memberof PIXI\n * @see PIXI.utils.TextureCache\n * @deprecated since version 3.0.0\n */\n TextureCache: {\n get: function get() {\n warn('The TextureCache class has been moved to utils.TextureCache, ' + 'please use utils.TextureCache from now on.');\n\n return core.utils.TextureCache;\n }\n },\n\n /**\n * @namespace\n * @private\n * @name math\n * @memberof PIXI\n * @see PIXI\n * @deprecated since version 3.0.6\n */\n math: {\n get: function get() {\n warn('The math namespace is deprecated, please access members already accessible on PIXI.');\n\n return core;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.AbstractFilter\n * @see PIXI.Filter\n * @deprecated since version 3.0.6\n */\n AbstractFilter: {\n get: function get() {\n warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n return core.Filter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.TransformManual\n * @see PIXI.TransformBase\n * @deprecated since version 4.0.0\n */\n TransformManual: {\n get: function get() {\n warn('TransformManual has been renamed to TransformBase, please update your pixi-spine');\n\n return core.TransformBase;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.TARGET_FPMS\n * @see PIXI.settings.TARGET_FPMS\n * @deprecated since version 4.2.0\n */\n TARGET_FPMS: {\n get: function get() {\n warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n return core.settings.TARGET_FPMS;\n },\n set: function set(value) {\n warn('PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS');\n\n core.settings.TARGET_FPMS = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.FILTER_RESOLUTION\n * @see PIXI.settings.FILTER_RESOLUTION\n * @deprecated since version 4.2.0\n */\n FILTER_RESOLUTION: {\n get: function get() {\n warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n return core.settings.FILTER_RESOLUTION;\n },\n set: function set(value) {\n warn('PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION');\n\n core.settings.FILTER_RESOLUTION = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.RESOLUTION\n * @see PIXI.settings.RESOLUTION\n * @deprecated since version 4.2.0\n */\n RESOLUTION: {\n get: function get() {\n warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n return core.settings.RESOLUTION;\n },\n set: function set(value) {\n warn('PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION');\n\n core.settings.RESOLUTION = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.MIPMAP_TEXTURES\n * @see PIXI.settings.MIPMAP_TEXTURES\n * @deprecated since version 4.2.0\n */\n MIPMAP_TEXTURES: {\n get: function get() {\n warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n return core.settings.MIPMAP_TEXTURES;\n },\n set: function set(value) {\n warn('PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES');\n\n core.settings.MIPMAP_TEXTURES = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.SPRITE_BATCH_SIZE\n * @see PIXI.settings.SPRITE_BATCH_SIZE\n * @deprecated since version 4.2.0\n */\n SPRITE_BATCH_SIZE: {\n get: function get() {\n warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n return core.settings.SPRITE_BATCH_SIZE;\n },\n set: function set(value) {\n warn('PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE');\n\n core.settings.SPRITE_BATCH_SIZE = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.SPRITE_MAX_TEXTURES\n * @see PIXI.settings.SPRITE_MAX_TEXTURES\n * @deprecated since version 4.2.0\n */\n SPRITE_MAX_TEXTURES: {\n get: function get() {\n warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n return core.settings.SPRITE_MAX_TEXTURES;\n },\n set: function set(value) {\n warn('PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES');\n\n core.settings.SPRITE_MAX_TEXTURES = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.RETINA_PREFIX\n * @see PIXI.settings.RETINA_PREFIX\n * @deprecated since version 4.2.0\n */\n RETINA_PREFIX: {\n get: function get() {\n warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n return core.settings.RETINA_PREFIX;\n },\n set: function set(value) {\n warn('PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX');\n\n core.settings.RETINA_PREFIX = value;\n }\n },\n\n /**\n * @static\n * @constant\n * @name PIXI.DEFAULT_RENDER_OPTIONS\n * @see PIXI.settings.RENDER_OPTIONS\n * @deprecated since version 4.2.0\n */\n DEFAULT_RENDER_OPTIONS: {\n get: function get() {\n warn('PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS');\n\n return core.settings.RENDER_OPTIONS;\n }\n }\n });\n\n // Move the default properties to settings\n var defaults = [{ parent: 'TRANSFORM_MODE', target: 'TRANSFORM_MODE' }, { parent: 'GC_MODES', target: 'GC_MODE' }, { parent: 'WRAP_MODES', target: 'WRAP_MODE' }, { parent: 'SCALE_MODES', target: 'SCALE_MODE' }, { parent: 'PRECISION', target: 'PRECISION_FRAGMENT' }];\n\n var _loop = function _loop(i) {\n var deprecation = defaults[i];\n\n Object.defineProperty(core[deprecation.parent], 'DEFAULT', {\n get: function get() {\n warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, ' + ('please use PIXI.settings.' + deprecation.target));\n\n return core.settings[deprecation.target];\n },\n set: function set(value) {\n warn('PIXI.' + deprecation.parent + '.DEFAULT has been deprecated, ' + ('please use PIXI.settings.' + deprecation.target));\n\n core.settings[deprecation.target] = value;\n }\n });\n };\n\n for (var i = 0; i < defaults.length; i++) {\n _loop(i);\n }\n\n Object.defineProperties(core.settings, {\n\n /**\n * @static\n * @name PRECISION\n * @memberof PIXI.settings\n * @see PIXI.PRECISION\n * @deprecated since version 4.4.0\n */\n PRECISION: {\n get: function get() {\n warn('PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT');\n\n return core.settings.PRECISION_FRAGMENT;\n },\n set: function set(value) {\n warn('PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT');\n\n core.settings.PRECISION_FRAGMENT = value;\n }\n }\n });\n\n if (extras.AnimatedSprite) {\n Object.defineProperties(extras, {\n\n /**\n * @class\n * @name MovieClip\n * @memberof PIXI.extras\n * @see PIXI.extras.AnimatedSprite\n * @deprecated since version 4.2.0\n */\n MovieClip: {\n get: function get() {\n warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.');\n\n return extras.AnimatedSprite;\n }\n }\n });\n }\n\n core.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution) {\n warn('generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)');\n\n return renderer.generateTexture(this, scaleMode, resolution);\n };\n\n core.Graphics.prototype.generateTexture = function generateTexture(scaleMode, resolution) {\n warn('graphics generate texture has moved to the renderer. ' + 'Or to render a graphics to a texture using canvas please use generateCanvasTexture');\n\n return this.generateCanvasTexture(scaleMode, resolution);\n };\n\n core.RenderTexture.prototype.render = function render(displayObject, matrix, clear, updateTransform) {\n this.legacyRenderer.render(displayObject, this, clear, matrix, !updateTransform);\n warn('RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)');\n };\n\n core.RenderTexture.prototype.getImage = function getImage(target) {\n warn('RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)');\n\n return this.legacyRenderer.extract.image(target);\n };\n\n core.RenderTexture.prototype.getBase64 = function getBase64(target) {\n warn('RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)');\n\n return this.legacyRenderer.extract.base64(target);\n };\n\n core.RenderTexture.prototype.getCanvas = function getCanvas(target) {\n warn('RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)');\n\n return this.legacyRenderer.extract.canvas(target);\n };\n\n core.RenderTexture.prototype.getPixels = function getPixels(target) {\n warn('RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)');\n\n return this.legacyRenderer.pixels(target);\n };\n\n /**\n * @method\n * @private\n * @name PIXI.Sprite#setTexture\n * @see PIXI.Sprite#texture\n * @deprecated since version 3.0.0\n * @param {PIXI.Texture} texture - The texture to set to.\n */\n core.Sprite.prototype.setTexture = function setTexture(texture) {\n this.texture = texture;\n warn('setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;');\n };\n\n if (extras.BitmapText) {\n /**\n * @method\n * @name PIXI.extras.BitmapText#setText\n * @see PIXI.extras.BitmapText#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\n extras.BitmapText.prototype.setText = function setText(text) {\n this.text = text;\n warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \\'my text\\';');\n };\n }\n\n /**\n * @method\n * @name PIXI.Text#setText\n * @see PIXI.Text#text\n * @deprecated since version 3.0.0\n * @param {string} text - The text to set to.\n */\n core.Text.prototype.setText = function setText(text) {\n this.text = text;\n warn('setText is now deprecated, please use the text property, e.g : myText.text = \\'my text\\';');\n };\n\n /**\n * Calculates the ascent, descent and fontSize of a given fontStyle\n *\n * @name PIXI.Text.calculateFontProperties\n * @see PIXI.TextMetrics.measureFont\n * @deprecated since version 4.5.0\n * @param {string} font - String representing the style of the font\n * @return {Object} Font properties object\n */\n core.Text.calculateFontProperties = function calculateFontProperties(font) {\n warn('Text.calculateFontProperties is now deprecated, please use the TextMetrics.measureFont');\n\n return core.TextMetrics.measureFont(font);\n };\n\n Object.defineProperties(core.Text, {\n fontPropertiesCache: {\n get: function get() {\n warn('Text.fontPropertiesCache is deprecated');\n\n return core.TextMetrics._fonts;\n }\n },\n fontPropertiesCanvas: {\n get: function get() {\n warn('Text.fontPropertiesCanvas is deprecated');\n\n return core.TextMetrics._canvas;\n }\n },\n fontPropertiesContext: {\n get: function get() {\n warn('Text.fontPropertiesContext is deprecated');\n\n return core.TextMetrics._context;\n }\n }\n });\n\n /**\n * @method\n * @name PIXI.Text#setStyle\n * @see PIXI.Text#style\n * @deprecated since version 3.0.0\n * @param {*} style - The style to set to.\n */\n core.Text.prototype.setStyle = function setStyle(style) {\n this.style = style;\n warn('setStyle is now deprecated, please use the style property, e.g : myText.style = style;');\n };\n\n /**\n * @method\n * @name PIXI.Text#determineFontProperties\n * @see PIXI.Text#measureFontProperties\n * @deprecated since version 4.2.0\n * @private\n * @param {string} fontStyle - String representing the style of the font\n * @return {Object} Font properties object\n */\n core.Text.prototype.determineFontProperties = function determineFontProperties(fontStyle) {\n warn('determineFontProperties is now deprecated, please use TextMetrics.measureFont method');\n\n return core.TextMetrics.measureFont(fontStyle);\n };\n\n /**\n * @method\n * @name PIXI.Text.getFontStyle\n * @see PIXI.TextMetrics.getFontStyle\n * @deprecated since version 4.5.0\n * @param {PIXI.TextStyle} style - The style to use.\n * @return {string} Font string\n */\n core.Text.getFontStyle = function getFontStyle(style) {\n warn('getFontStyle is now deprecated, please use TextStyle.toFontString() instead');\n\n style = style || {};\n\n if (!(style instanceof core.TextStyle)) {\n style = new core.TextStyle(style);\n }\n\n return style.toFontString();\n };\n\n Object.defineProperties(core.TextStyle.prototype, {\n /**\n * Set all properties of a font as a single string\n *\n * @name PIXI.TextStyle#font\n * @deprecated since version 4.0.0\n */\n font: {\n get: function get() {\n warn('text style property \\'font\\' is now deprecated, please use the ' + '\\'fontFamily\\', \\'fontSize\\', \\'fontStyle\\', \\'fontVariant\\' and \\'fontWeight\\' properties from now on');\n\n var fontSizeString = typeof this._fontSize === 'number' ? this._fontSize + 'px' : this._fontSize;\n\n return this._fontStyle + ' ' + this._fontVariant + ' ' + this._fontWeight + ' ' + fontSizeString + ' ' + this._fontFamily;\n },\n set: function set(font) {\n warn('text style property \\'font\\' is now deprecated, please use the ' + '\\'fontFamily\\',\\'fontSize\\',fontStyle\\',\\'fontVariant\\' and \\'fontWeight\\' properties from now on');\n\n // can work out fontStyle from search of whole string\n if (font.indexOf('italic') > 1) {\n this._fontStyle = 'italic';\n } else if (font.indexOf('oblique') > -1) {\n this._fontStyle = 'oblique';\n } else {\n this._fontStyle = 'normal';\n }\n\n // can work out fontVariant from search of whole string\n if (font.indexOf('small-caps') > -1) {\n this._fontVariant = 'small-caps';\n } else {\n this._fontVariant = 'normal';\n }\n\n // fontWeight and fontFamily are tricker to find, but it's easier to find the fontSize due to it's units\n var splits = font.split(' ');\n var fontSizeIndex = -1;\n\n this._fontSize = 26;\n for (var i = 0; i < splits.length; ++i) {\n if (splits[i].match(/(px|pt|em|%)/)) {\n fontSizeIndex = i;\n this._fontSize = splits[i];\n break;\n }\n }\n\n // we can now search for fontWeight as we know it must occur before the fontSize\n this._fontWeight = 'normal';\n for (var _i = 0; _i < fontSizeIndex; ++_i) {\n if (splits[_i].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)) {\n this._fontWeight = splits[_i];\n break;\n }\n }\n\n // and finally join everything together after the fontSize in case the font family has multiple words\n if (fontSizeIndex > -1 && fontSizeIndex < splits.length - 1) {\n this._fontFamily = '';\n for (var _i2 = fontSizeIndex + 1; _i2 < splits.length; ++_i2) {\n this._fontFamily += splits[_i2] + ' ';\n }\n\n this._fontFamily = this._fontFamily.slice(0, -1);\n } else {\n this._fontFamily = 'Arial';\n }\n\n this.styleID++;\n }\n }\n });\n\n /**\n * @method\n * @name PIXI.Texture#setFrame\n * @see PIXI.Texture#setFrame\n * @deprecated since version 3.0.0\n * @param {PIXI.Rectangle} frame - The frame to set.\n */\n core.Texture.prototype.setFrame = function setFrame(frame) {\n this.frame = frame;\n warn('setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;');\n };\n\n /**\n * @static\n * @function\n * @name PIXI.Texture.addTextureToCache\n * @see PIXI.Texture.addToCache\n * @deprecated since 4.5.0\n * @param {PIXI.Texture} texture - The Texture to add to the cache.\n * @param {string} id - The id that the texture will be stored against.\n */\n core.Texture.addTextureToCache = function addTextureToCache(texture, id) {\n core.Texture.addToCache(texture, id);\n warn('Texture.addTextureToCache is deprecated, please use Texture.addToCache from now on.');\n };\n\n /**\n * @static\n * @function\n * @name PIXI.Texture.removeTextureFromCache\n * @see PIXI.Texture.removeFromCache\n * @deprecated since 4.5.0\n * @param {string} id - The id of the texture to be removed\n * @return {PIXI.Texture|null} The texture that was removed\n */\n core.Texture.removeTextureFromCache = function removeTextureFromCache(id) {\n warn('Texture.removeTextureFromCache is deprecated, please use Texture.removeFromCache from now on. ' + 'Be aware that Texture.removeFromCache does not automatically its BaseTexture from the BaseTextureCache. ' + 'For that, use BaseTexture.removeFromCache');\n\n core.BaseTexture.removeFromCache(id);\n\n return core.Texture.removeFromCache(id);\n };\n\n Object.defineProperties(filters, {\n\n /**\n * @class\n * @private\n * @name PIXI.filters.AbstractFilter\n * @see PIXI.AbstractFilter\n * @deprecated since version 3.0.6\n */\n AbstractFilter: {\n get: function get() {\n warn('AstractFilter has been renamed to Filter, please use PIXI.Filter');\n\n return core.AbstractFilter;\n }\n },\n\n /**\n * @class\n * @private\n * @name PIXI.filters.SpriteMaskFilter\n * @see PIXI.SpriteMaskFilter\n * @deprecated since version 3.0.6\n */\n SpriteMaskFilter: {\n get: function get() {\n warn('filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on.');\n\n return core.SpriteMaskFilter;\n }\n }\n });\n\n /**\n * @method\n * @name PIXI.utils.uuid\n * @see PIXI.utils.uid\n * @deprecated since version 3.0.6\n * @return {number} The uid\n */\n core.utils.uuid = function () {\n warn('utils.uuid() is deprecated, please use utils.uid() from now on.');\n\n return core.utils.uid();\n };\n\n /**\n * @method\n * @name PIXI.utils.canUseNewCanvasBlendModes\n * @see PIXI.CanvasTinter\n * @deprecated\n * @return {boolean} Can use blend modes.\n */\n core.utils.canUseNewCanvasBlendModes = function () {\n warn('utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on');\n\n return core.CanvasTinter.canUseMultiply;\n };\n\n var saidHello = true;\n\n /**\n * @name PIXI.utils._saidHello\n * @type {boolean}\n * @see PIXI.utils.skipHello\n * @deprecated since 4.1.0\n */\n Object.defineProperty(core.utils, '_saidHello', {\n set: function set(bool) {\n if (bool) {\n warn('PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()');\n this.skipHello();\n }\n saidHello = bool;\n },\n get: function get() {\n return saidHello;\n }\n });\n\n if (prepare.BasePrepare) {\n /**\n * @method\n * @name PIXI.prepare.BasePrepare#register\n * @see PIXI.prepare.BasePrepare#registerFindHook\n * @deprecated since version 4.4.2\n * @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @return {PIXI.BasePrepare} Instance of plugin for chaining.\n */\n prepare.BasePrepare.prototype.register = function register(addHook, uploadHook) {\n warn('renderer.plugins.prepare.register is now deprecated, ' + 'please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook');\n\n if (addHook) {\n this.registerFindHook(addHook);\n }\n\n if (uploadHook) {\n this.registerUploadHook(uploadHook);\n }\n\n return this;\n };\n }\n\n if (prepare.canvas) {\n /**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.canvas.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\n Object.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', {\n set: function set() {\n warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n // because we don't have a reference to the renderer, we can't actually set\n // the uploads per frame, so we'll have to stick with the warning.\n },\n get: function get() {\n warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');\n\n return NaN;\n }\n });\n }\n\n if (prepare.webgl) {\n /**\n * The number of graphics or textures to upload to the GPU.\n *\n * @name PIXI.prepare.webgl.UPLOADS_PER_FRAME\n * @static\n * @type {number}\n * @see PIXI.prepare.BasePrepare.limiter\n * @deprecated since 4.2.0\n */\n Object.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', {\n set: function set() {\n warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');\n // because we don't have a reference to the renderer, we can't actually set\n // the uploads per frame, so we'll have to stick with the warning.\n },\n get: function get() {\n warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');\n\n return NaN;\n }\n });\n }\n\n if (loaders.Loader) {\n var Resource = loaders.Resource;\n var Loader = loaders.Loader;\n\n Object.defineProperties(Resource.prototype, {\n isJson: {\n get: function get() {\n warn('The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`.');\n\n return this.type === Resource.TYPE.JSON;\n }\n },\n isXml: {\n get: function get() {\n warn('The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`.');\n\n return this.type === Resource.TYPE.XML;\n }\n },\n isImage: {\n get: function get() {\n warn('The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`.');\n\n return this.type === Resource.TYPE.IMAGE;\n }\n },\n isAudio: {\n get: function get() {\n warn('The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`.');\n\n return this.type === Resource.TYPE.AUDIO;\n }\n },\n isVideo: {\n get: function get() {\n warn('The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`.');\n\n return this.type === Resource.TYPE.VIDEO;\n }\n }\n });\n\n Object.defineProperties(Loader.prototype, {\n before: {\n get: function get() {\n warn('The before() method is deprecated, please use pre().');\n\n return this.pre;\n }\n },\n after: {\n get: function get() {\n warn('The after() method is deprecated, please use use().');\n\n return this.use;\n }\n }\n });\n }\n\n if (interaction.interactiveTarget) {\n /**\n * @name PIXI.interaction.interactiveTarget#defaultCursor\n * @static\n * @type {number}\n * @see PIXI.interaction.interactiveTarget#cursor\n * @deprecated since 4.3.0\n */\n Object.defineProperty(interaction.interactiveTarget, 'defaultCursor', {\n set: function set(value) {\n warn('Property defaultCursor has been replaced with \\'cursor\\'. ');\n this.cursor = value;\n },\n get: function get() {\n warn('Property defaultCursor has been replaced with \\'cursor\\'. ');\n\n return this.cursor;\n }\n });\n }\n\n if (interaction.InteractionManager) {\n /**\n * @name PIXI.interaction.InteractionManager#defaultCursorStyle\n * @static\n * @type {string}\n * @see PIXI.interaction.InteractionManager#cursorStyles\n * @deprecated since 4.3.0\n */\n Object.defineProperty(interaction.InteractionManager, 'defaultCursorStyle', {\n set: function set(value) {\n warn('Property defaultCursorStyle has been replaced with \\'cursorStyles.default\\'. ');\n this.cursorStyles.default = value;\n },\n get: function get() {\n warn('Property defaultCursorStyle has been replaced with \\'cursorStyles.default\\'. ');\n\n return this.cursorStyles.default;\n }\n });\n\n /**\n * @name PIXI.interaction.InteractionManager#currentCursorStyle\n * @static\n * @type {string}\n * @see PIXI.interaction.InteractionManager#cursorStyles\n * @deprecated since 4.3.0\n */\n Object.defineProperty(interaction.InteractionManager, 'currentCursorStyle', {\n set: function set(value) {\n warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');\n this.currentCursorMode = value;\n },\n get: function get() {\n warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');\n\n return this.currentCursorMode;\n }\n });\n }\n}\n//# sourceMappingURL=deprecation.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/deprecation.js\n// module id = 563\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TEMP_RECT = new core.Rectangle();\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI.extract\n */\n\nvar CanvasExtract = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n function CanvasExtract(renderer) {\n _classCallCheck(this, CanvasExtract);\n\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.extract.CanvasExtract} extract\n * @memberof PIXI.CanvasRenderer#\n * @see PIXI.extract.CanvasExtract\n */\n renderer.extract = this;\n }\n\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */\n\n\n CanvasExtract.prototype.image = function image(target) {\n var image = new Image();\n\n image.src = this.base64(target);\n\n return image;\n };\n\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `CanvasExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */\n\n\n CanvasExtract.prototype.base64 = function base64(target) {\n return this.canvas(target).toDataURL();\n };\n\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n\n\n CanvasExtract.prototype.canvas = function canvas(target) {\n var renderer = this.renderer;\n var context = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n context = renderTexture.baseTexture._canvasRenderTarget.context;\n resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n frame = renderTexture.frame;\n } else {\n context = renderer.rootContext;\n\n frame = TEMP_RECT;\n frame.width = this.renderer.width;\n frame.height = this.renderer.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var canvasBuffer = new core.CanvasRenderTarget(width, height);\n var canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height);\n\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */\n\n\n CanvasExtract.prototype.pixels = function pixels(target) {\n var renderer = this.renderer;\n var context = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n context = renderTexture.baseTexture._canvasRenderTarget.context;\n resolution = renderTexture.baseTexture._canvasRenderTarget.resolution;\n frame = renderTexture.frame;\n } else {\n context = renderer.rootContext;\n\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n }\n\n return context.getImageData(0, 0, frame.width * resolution, frame.height * resolution).data;\n };\n\n /**\n * Destroys the extract\n *\n */\n\n\n CanvasExtract.prototype.destroy = function destroy() {\n this.renderer.extract = null;\n this.renderer = null;\n };\n\n return CanvasExtract;\n}();\n\nexports.default = CanvasExtract;\n\n\ncore.CanvasRenderer.registerPlugin('extract', CanvasExtract);\n//# sourceMappingURL=CanvasExtract.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extract/canvas/CanvasExtract.js\n// module id = 564\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLExtract = require('./webgl/WebGLExtract');\n\nObject.defineProperty(exports, 'webgl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLExtract).default;\n }\n});\n\nvar _CanvasExtract = require('./canvas/CanvasExtract');\n\nObject.defineProperty(exports, 'canvas', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasExtract).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extract/index.js\n// module id = 565\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar TEMP_RECT = new core.Rectangle();\nvar BYTES_PER_PIXEL = 4;\n\n/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI.extract\n */\n\nvar WebGLExtract = function () {\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function WebGLExtract(renderer) {\n _classCallCheck(this, WebGLExtract);\n\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.extract.WebGLExtract} extract\n * @memberof PIXI.WebGLRenderer#\n * @see PIXI.extract.WebGLExtract\n */\n renderer.extract = this;\n }\n\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */\n\n\n WebGLExtract.prototype.image = function image(target) {\n var image = new Image();\n\n image.src = this.base64(target);\n\n return image;\n };\n\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `WebGLExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */\n\n\n WebGLExtract.prototype.base64 = function base64(target) {\n return this.canvas(target).toDataURL();\n };\n\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n\n\n WebGLExtract.prototype.canvas = function canvas(target) {\n var renderer = this.renderer;\n var textureBuffer = void 0;\n var resolution = void 0;\n var frame = void 0;\n var flipY = false;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = this.renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n resolution = textureBuffer.resolution;\n frame = renderTexture.frame;\n flipY = false;\n } else {\n textureBuffer = this.renderer.rootRenderTarget;\n resolution = textureBuffer.resolution;\n flipY = true;\n\n frame = TEMP_RECT;\n frame.width = textureBuffer.size.width;\n frame.height = textureBuffer.size.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var canvasBuffer = new core.CanvasRenderTarget(width, height);\n\n if (textureBuffer) {\n // bind the buffer\n renderer.bindRenderTarget(textureBuffer);\n\n // set up an array of pixels\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n // read pixels to the array\n var gl = renderer.gl;\n\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n\n // add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n\n canvasData.data.set(webglPixels);\n\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n\n // pulling pixels\n if (flipY) {\n canvasBuffer.context.scale(1, -1);\n canvasBuffer.context.drawImage(canvasBuffer.canvas, 0, -height);\n }\n }\n\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */\n\n\n WebGLExtract.prototype.pixels = function pixels(target) {\n var renderer = this.renderer;\n var textureBuffer = void 0;\n var resolution = void 0;\n var frame = void 0;\n var renderTexture = void 0;\n\n if (target) {\n if (target instanceof core.RenderTexture) {\n renderTexture = target;\n } else {\n renderTexture = this.renderer.generateTexture(target);\n }\n }\n\n if (renderTexture) {\n textureBuffer = renderTexture.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID];\n resolution = textureBuffer.resolution;\n frame = renderTexture.frame;\n } else {\n textureBuffer = this.renderer.rootRenderTarget;\n resolution = textureBuffer.resolution;\n\n frame = TEMP_RECT;\n frame.width = textureBuffer.size.width;\n frame.height = textureBuffer.size.height;\n }\n\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n\n if (textureBuffer) {\n // bind the buffer\n renderer.bindRenderTarget(textureBuffer);\n // read pixels to the array\n var gl = renderer.gl;\n\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n }\n\n return webglPixels;\n };\n\n /**\n * Destroys the extract\n *\n */\n\n\n WebGLExtract.prototype.destroy = function destroy() {\n this.renderer.extract = null;\n this.renderer = null;\n };\n\n return WebGLExtract;\n}();\n\nexports.default = WebGLExtract;\n\n\ncore.WebGLRenderer.registerPlugin('extract', WebGLExtract);\n//# sourceMappingURL=WebGLExtract.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extract/webgl/WebGLExtract.js\n// module id = 566\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @typedef FrameObject\n * @type {object}\n * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame\n * @property {number} time - the duration of the frame in ms\n */\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.fromImage(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let mc = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\nvar AnimatedSprite = function (_core$Sprite) {\n _inherits(AnimatedSprite, _core$Sprite);\n\n /**\n * @param {PIXI.Texture[]|FrameObject[]} textures - an array of {@link PIXI.Texture} or frame\n * objects that make up the animation\n * @param {boolean} [autoUpdate=true] - Whether to use PIXI.ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n _classCallCheck(this, AnimatedSprite);\n\n /**\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Sprite.call(this, textures[0] instanceof core.Texture ? textures[0] : textures[0].texture));\n\n _this._textures = null;\n\n /**\n * @private\n */\n _this._durations = null;\n\n _this.textures = textures;\n\n /**\n * `true` uses PIXI.ticker.shared to auto update animation time.\n * @type {boolean}\n * @default true\n * @private\n */\n _this._autoUpdate = autoUpdate !== false;\n\n /**\n * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower\n *\n * @member {number}\n * @default 1\n */\n _this.animationSpeed = 1;\n\n /**\n * Whether or not the animate sprite repeats after playing.\n *\n * @member {boolean}\n * @default true\n */\n _this.loop = true;\n\n /**\n * Function to call when a AnimatedSprite finishes playing\n *\n * @member {Function}\n */\n _this.onComplete = null;\n\n /**\n * Function to call when a AnimatedSprite changes which texture is being rendered\n *\n * @member {Function}\n */\n _this.onFrameChange = null;\n\n /**\n * Function to call when 'loop' is true, and an AnimatedSprite is played and loops around to start again\n *\n * @member {Function}\n */\n _this.onLoop = null;\n\n /**\n * Elapsed time since animation has been started, used internally to display current texture\n *\n * @member {number}\n * @private\n */\n _this._currentTime = 0;\n\n /**\n * Indicates if the AnimatedSprite is currently playing\n *\n * @member {boolean}\n * @readonly\n */\n _this.playing = false;\n return _this;\n }\n\n /**\n * Stops the AnimatedSprite\n *\n */\n\n\n AnimatedSprite.prototype.stop = function stop() {\n if (!this.playing) {\n return;\n }\n\n this.playing = false;\n if (this._autoUpdate) {\n core.ticker.shared.remove(this.update, this);\n }\n };\n\n /**\n * Plays the AnimatedSprite\n *\n */\n\n\n AnimatedSprite.prototype.play = function play() {\n if (this.playing) {\n return;\n }\n\n this.playing = true;\n if (this._autoUpdate) {\n core.ticker.shared.add(this.update, this, core.UPDATE_PRIORITY.HIGH);\n }\n };\n\n /**\n * Stops the AnimatedSprite and goes to a specific frame\n *\n * @param {number} frameNumber - frame index to stop at\n */\n\n\n AnimatedSprite.prototype.gotoAndStop = function gotoAndStop(frameNumber) {\n this.stop();\n\n var previousFrame = this.currentFrame;\n\n this._currentTime = frameNumber;\n\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite\n *\n * @param {number} frameNumber - frame index to start at\n */\n\n\n AnimatedSprite.prototype.gotoAndPlay = function gotoAndPlay(frameNumber) {\n var previousFrame = this.currentFrame;\n\n this._currentTime = frameNumber;\n\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n\n this.play();\n };\n\n /**\n * Updates the object transform for rendering.\n *\n * @private\n * @param {number} deltaTime - Time since last tick.\n */\n\n\n AnimatedSprite.prototype.update = function update(deltaTime) {\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n\n lag += elapsed / 60 * 1000;\n\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n\n var sign = Math.sign(this.animationSpeed * deltaTime);\n\n this._currentTime = Math.floor(this._currentTime);\n\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n\n this._currentTime += lag / this._durations[this.currentFrame];\n } else {\n this._currentTime += elapsed;\n }\n\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n\n if (this.onComplete) {\n this.onComplete();\n }\n } else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n\n if (this.onComplete) {\n this.onComplete();\n }\n } else if (previousFrame !== this.currentFrame) {\n if (this.loop && this.onLoop) {\n if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {\n this.onLoop();\n } else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {\n this.onLoop();\n }\n }\n\n this.updateTexture();\n }\n };\n\n /**\n * Updates the displayed texture to match the current frame index\n *\n * @private\n */\n\n\n AnimatedSprite.prototype.updateTexture = function updateTexture() {\n this._texture = this._textures[this.currentFrame];\n this._textureID = -1;\n this.cachedTint = 0xFFFFFF;\n\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n\n /**\n * Stops the AnimatedSprite and destroys it\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n\n\n AnimatedSprite.prototype.destroy = function destroy(options) {\n this.stop();\n _core$Sprite.prototype.destroy.call(this, options);\n };\n\n /**\n * A short hand way of creating a movieclip from an array of frame ids\n *\n * @static\n * @param {string[]} frames - The array of frames ids the movieclip will use as its texture frames\n * @return {AnimatedSprite} The new animated sprite with the specified frames.\n */\n\n\n AnimatedSprite.fromFrames = function fromFrames(frames) {\n var textures = [];\n\n for (var i = 0; i < frames.length; ++i) {\n textures.push(core.Texture.fromFrame(frames[i]));\n }\n\n return new AnimatedSprite(textures);\n };\n\n /**\n * A short hand way of creating a movieclip from an array of image ids\n *\n * @static\n * @param {string[]} images - the array of image urls the movieclip will use as its texture frames\n * @return {AnimatedSprite} The new animate sprite with the specified images as frames.\n */\n\n\n AnimatedSprite.fromImages = function fromImages(images) {\n var textures = [];\n\n for (var i = 0; i < images.length; ++i) {\n textures.push(core.Texture.fromImage(images[i]));\n }\n\n return new AnimatedSprite(textures);\n };\n\n /**\n * totalFrames is the total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n *\n * @readonly\n * @member {number}\n * @default 0\n */\n\n\n _createClass(AnimatedSprite, [{\n key: 'totalFrames',\n get: function get() {\n return this._textures.length;\n }\n\n /**\n * The array of textures used for this AnimatedSprite\n *\n * @member {PIXI.Texture[]}\n */\n\n }, {\n key: 'textures',\n get: function get() {\n return this._textures;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (value[0] instanceof core.Texture) {\n this._textures = value;\n this._durations = null;\n } else {\n this._textures = [];\n this._durations = [];\n\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n this.gotoAndStop(0);\n this.updateTexture();\n }\n\n /**\n * The AnimatedSprites current frame index\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'currentFrame',\n get: function get() {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n\n return currentFrame;\n }\n }]);\n\n return AnimatedSprite;\n}(core.Sprite);\n\nexports.default = AnimatedSprite;\n//# sourceMappingURL=AnimatedSprite.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/AnimatedSprite.js\n// module id = 567\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ObservablePoint = require('../core/math/ObservablePoint');\n\nvar _ObservablePoint2 = _interopRequireDefault(_ObservablePoint);\n\nvar _settings = require('../core/settings');\n\nvar _settings2 = _interopRequireDefault(_settings);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font. To\n * split a line you can use '\\n', '\\r' or '\\r\\n' in your string. You can generate the fnt files using:\n *\n * A BitmapText can only be created when the font is loaded\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.extras.BitmapText(\"text using a fancy font!\", {font: \"35px Desyrel\", align: \"right\"});\n * ```\n *\n * http://www.angelcode.com/products/bmfont/ for windows or\n * http://www.bmglyph.com/ for mac.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.extras\n */\nvar BitmapText = function (_core$Container) {\n _inherits(BitmapText, _core$Container);\n\n /**\n * @param {string} text - The copy that you would like the text to display\n * @param {object} style - The style parameters\n * @param {string|object} style.font - The font descriptor for the object, can be passed as a string of form\n * \"24px FontName\" or \"FontName\" or as an object with explicit name/size properties.\n * @param {string} [style.font.name] - The bitmap font id\n * @param {number} [style.font.size] - The size of the font in pixels, e.g. 24\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'), does not affect\n * single line text\n * @param {number} [style.tint=0xFFFFFF] - The tint color\n */\n function BitmapText(text) {\n var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, BitmapText);\n\n /**\n * Private tracker for the width of the overall text\n *\n * @member {number}\n * @private\n */\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n _this._textWidth = 0;\n\n /**\n * Private tracker for the height of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textHeight = 0;\n\n /**\n * Private tracker for the letter sprite pool.\n *\n * @member {PIXI.Sprite[]}\n * @private\n */\n _this._glyphs = [];\n\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._font = {\n tint: style.tint !== undefined ? style.tint : 0xFFFFFF,\n align: style.align || 'left',\n name: null,\n size: 0\n };\n\n /**\n * Private tracker for the current font.\n *\n * @member {object}\n * @private\n */\n _this.font = style.font; // run font setter\n\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = text;\n\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n * @private\n */\n _this._maxWidth = 0;\n\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align.\n *\n * @member {number}\n * @private\n */\n _this._maxLineHeight = 0;\n\n /**\n * Text anchor. read-only\n *\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new _ObservablePoint2.default(function () {\n _this.dirty = true;\n }, _this, 0, 0);\n\n /**\n * The dirty state of this object.\n *\n * @member {boolean}\n */\n _this.dirty = false;\n\n _this.updateText();\n return _this;\n }\n\n /**\n * Renders text and updates it when needed\n *\n * @private\n */\n\n\n BitmapText.prototype.updateText = function updateText() {\n var data = BitmapText.fonts[this._font.name];\n var scale = this._font.size / data.size;\n var pos = new core.Point();\n var chars = [];\n var lineWidths = [];\n\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastSpace = -1;\n var lastSpaceWidth = 0;\n var spacesRemoved = 0;\n var maxLineHeight = 0;\n\n for (var i = 0; i < this.text.length; i++) {\n var charCode = this.text.charCodeAt(i);\n\n if (/(\\s)/.test(this.text.charAt(i))) {\n lastSpace = i;\n lastSpaceWidth = lastLineWidth;\n }\n\n if (/(?:\\r\\n|\\r|\\n)/.test(this.text.charAt(i))) {\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n line++;\n\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n\n if (lastSpace !== -1 && this._maxWidth > 0 && pos.x * scale > this._maxWidth) {\n core.utils.removeItems(chars, lastSpace - spacesRemoved, i - lastSpace);\n i = lastSpace;\n lastSpace = -1;\n ++spacesRemoved;\n\n lineWidths.push(lastSpaceWidth);\n maxLineWidth = Math.max(maxLineWidth, lastSpaceWidth);\n line++;\n\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n\n var charData = data.chars[charCode];\n\n if (!charData) {\n continue;\n }\n\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n\n chars.push({\n texture: charData.texture,\n line: line,\n charCode: charCode,\n position: new core.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)\n });\n lastLineWidth = pos.x + (charData.texture.width + charData.xOffset);\n pos.x += charData.xAdvance;\n maxLineHeight = Math.max(maxLineHeight, charData.yOffset + charData.texture.height);\n prevCharCode = charCode;\n }\n\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n\n var lineAlignOffsets = [];\n\n for (var _i = 0; _i <= line; _i++) {\n var alignOffset = 0;\n\n if (this._font.align === 'right') {\n alignOffset = maxLineWidth - lineWidths[_i];\n } else if (this._font.align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[_i]) / 2;\n }\n\n lineAlignOffsets.push(alignOffset);\n }\n\n var lenChars = chars.length;\n var tint = this.tint;\n\n for (var _i2 = 0; _i2 < lenChars; _i2++) {\n var c = this._glyphs[_i2]; // get the next glyph sprite\n\n if (c) {\n c.texture = chars[_i2].texture;\n } else {\n c = new core.Sprite(chars[_i2].texture);\n this._glyphs.push(c);\n }\n\n c.position.x = (chars[_i2].position.x + lineAlignOffsets[chars[_i2].line]) * scale;\n c.position.y = chars[_i2].position.y * scale;\n c.scale.x = c.scale.y = scale;\n c.tint = tint;\n\n if (!c.parent) {\n this.addChild(c);\n }\n }\n\n // remove unnecessary children.\n for (var _i3 = lenChars; _i3 < this._glyphs.length; ++_i3) {\n this.removeChild(this._glyphs[_i3]);\n }\n\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n for (var _i4 = 0; _i4 < lenChars; _i4++) {\n this._glyphs[_i4].x -= this._textWidth * this.anchor.x;\n this._glyphs[_i4].y -= this._textHeight * this.anchor.y;\n }\n }\n this._maxLineHeight = maxLineHeight * scale;\n };\n\n /**\n * Updates the transform of this object\n *\n * @private\n */\n\n\n BitmapText.prototype.updateTransform = function updateTransform() {\n this.validate();\n this.containerUpdateTransform();\n };\n\n /**\n * Validates text before calling parent's getLocalBounds\n *\n * @return {PIXI.Rectangle} The rectangular bounding area\n */\n\n\n BitmapText.prototype.getLocalBounds = function getLocalBounds() {\n this.validate();\n\n return _core$Container.prototype.getLocalBounds.call(this);\n };\n\n /**\n * Updates text when needed\n *\n * @private\n */\n\n\n BitmapText.prototype.validate = function validate() {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n };\n\n /**\n * The tint of the BitmapText object\n *\n * @member {number}\n */\n\n\n /**\n * Register a bitmap font with data and a texture.\n *\n * @static\n * @param {XMLDocument} xml - The XML document data.\n * @param {PIXI.Texture} texture - Texture with all symbols.\n * @return {Object} Result font object with font, size, lineHeight and char fields.\n */\n BitmapText.registerFont = function registerFont(xml, texture) {\n var data = {};\n var info = xml.getElementsByTagName('info')[0];\n var common = xml.getElementsByTagName('common')[0];\n var res = texture.baseTexture.resolution || _settings2.default.RESOLUTION;\n\n data.font = info.getAttribute('face');\n data.size = parseInt(info.getAttribute('size'), 10);\n data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10) / res;\n data.chars = {};\n\n // parse letters\n var letters = xml.getElementsByTagName('char');\n\n for (var i = 0; i < letters.length; i++) {\n var letter = letters[i];\n var charCode = parseInt(letter.getAttribute('id'), 10);\n\n var textureRect = new core.Rectangle(parseInt(letter.getAttribute('x'), 10) / res + texture.frame.x / res, parseInt(letter.getAttribute('y'), 10) / res + texture.frame.y / res, parseInt(letter.getAttribute('width'), 10) / res, parseInt(letter.getAttribute('height'), 10) / res);\n\n data.chars[charCode] = {\n xOffset: parseInt(letter.getAttribute('xoffset'), 10) / res,\n yOffset: parseInt(letter.getAttribute('yoffset'), 10) / res,\n xAdvance: parseInt(letter.getAttribute('xadvance'), 10) / res,\n kerning: {},\n texture: new core.Texture(texture.baseTexture, textureRect)\n\n };\n }\n\n // parse kernings\n var kernings = xml.getElementsByTagName('kerning');\n\n for (var _i5 = 0; _i5 < kernings.length; _i5++) {\n var kerning = kernings[_i5];\n var first = parseInt(kerning.getAttribute('first'), 10) / res;\n var second = parseInt(kerning.getAttribute('second'), 10) / res;\n var amount = parseInt(kerning.getAttribute('amount'), 10) / res;\n\n if (data.chars[second]) {\n data.chars[second].kerning[first] = amount;\n }\n }\n\n // I'm leaving this as a temporary fix so we can test the bitmap fonts in v3\n // but it's very likely to change\n BitmapText.fonts[data.font] = data;\n\n return data;\n };\n\n _createClass(BitmapText, [{\n key: 'tint',\n get: function get() {\n return this._font.tint;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._font.tint = typeof value === 'number' && value >= 0 ? value : 0xFFFFFF;\n\n this.dirty = true;\n }\n\n /**\n * The alignment of the BitmapText object\n *\n * @member {string}\n * @default 'left'\n */\n\n }, {\n key: 'align',\n get: function get() {\n return this._font.align;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._font.align = value || 'left';\n\n this.dirty = true;\n }\n\n /**\n * The anchor sets the origin point of the text.\n * The default is 0,0 this means the text's origin is the top left\n * Setting the anchor to 0.5,0.5 means the text's origin is centered\n * Setting the anchor to 1,1 would mean the text's origin point will be the bottom right corner\n *\n * @member {PIXI.Point | number}\n */\n\n }, {\n key: 'anchor',\n get: function get() {\n return this._anchor;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (typeof value === 'number') {\n this._anchor.set(value);\n } else {\n this._anchor.copy(value);\n }\n }\n\n /**\n * The font descriptor of the BitmapText object\n *\n * @member {string|object}\n */\n\n }, {\n key: 'font',\n get: function get() {\n return this._font;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (!value) {\n return;\n }\n\n if (typeof value === 'string') {\n value = value.split(' ');\n\n this._font.name = value.length === 1 ? value[0] : value.slice(1).join(' ');\n this._font.size = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this._font.name].size;\n } else {\n this._font.name = value.name;\n this._font.size = typeof value.size === 'number' ? value.size : parseInt(value.size, 10);\n }\n\n this.dirty = true;\n }\n\n /**\n * The text of the BitmapText object\n *\n * @member {string}\n */\n\n }, {\n key: 'text',\n get: function get() {\n return this._text;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n value = value.toString() || ' ';\n if (this._text === value) {\n return;\n }\n this._text = value;\n this.dirty = true;\n }\n\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n */\n\n }, {\n key: 'maxWidth',\n get: function get() {\n return this._maxWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n if (this._maxWidth === value) {\n return;\n }\n this._maxWidth = value;\n this.dirty = true;\n }\n\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align.\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'maxLineHeight',\n get: function get() {\n this.validate();\n\n return this._maxLineHeight;\n }\n\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'textWidth',\n get: function get() {\n this.validate();\n\n return this._textWidth;\n }\n\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object\n *\n * @member {number}\n * @readonly\n */\n\n }, {\n key: 'textHeight',\n get: function get() {\n this.validate();\n\n return this._textHeight;\n }\n }]);\n\n return BitmapText;\n}(core.Container);\n\nexports.default = BitmapText;\n\n\nBitmapText.fonts = {};\n//# sourceMappingURL=BitmapText.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/BitmapText.js\n// module id = 568\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _CanvasTinter = require('../core/sprites/canvas/CanvasTinter');\n\nvar _CanvasTinter2 = _interopRequireDefault(_CanvasTinter);\n\nvar _TextureTransform = require('./TextureTransform');\n\nvar _TextureTransform2 = _interopRequireDefault(_TextureTransform);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempPoint = new core.Point();\n\n/**\n * A tiling sprite is a fast way of rendering a tiling image\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI.extras\n */\n\nvar TilingSprite = function (_core$Sprite) {\n _inherits(TilingSprite, _core$Sprite);\n\n /**\n * @param {PIXI.Texture} texture - the texture of the tiling sprite\n * @param {number} [width=100] - the width of the tiling sprite\n * @param {number} [height=100] - the height of the tiling sprite\n */\n function TilingSprite(texture) {\n var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n\n _classCallCheck(this, TilingSprite);\n\n /**\n * Tile transform\n *\n * @member {PIXI.TransformStatic}\n */\n var _this = _possibleConstructorReturn(this, _core$Sprite.call(this, texture));\n\n _this.tileTransform = new core.TransformStatic();\n\n // /// private\n\n /**\n * The with of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._width = width;\n\n /**\n * The height of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._height = height;\n\n /**\n * Canvas pattern\n *\n * @type {CanvasPattern}\n * @private\n */\n _this._canvasPattern = null;\n\n /**\n * transform that is applied to UV to get the texture coords\n *\n * @member {PIXI.extras.TextureTransform}\n */\n _this.uvTransform = texture.transform || new _TextureTransform2.default(texture);\n\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_renderWebGL' method.\n *\n * @member {string}\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n\n /**\n * Whether or not anchor affects uvs\n *\n * @member {boolean}\n * @default false\n */\n _this.uvRespectAnchor = false;\n return _this;\n }\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n\n\n /**\n * @private\n */\n TilingSprite.prototype._onTextureUpdate = function _onTextureUpdate() {\n if (this.uvTransform) {\n this.uvTransform.texture = this._texture;\n }\n this.cachedTint = 0xFFFFFF;\n };\n\n /**\n * Renders the object using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The renderer\n */\n\n\n TilingSprite.prototype._renderWebGL = function _renderWebGL(renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n\n if (!texture || !texture.valid) {\n return;\n }\n\n this.tileTransform.updateLocalTransform();\n this.uvTransform.update();\n\n renderer.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - a reference to the canvas renderer\n */\n\n\n TilingSprite.prototype._renderCanvas = function _renderCanvas(renderer) {\n var texture = this._texture;\n\n if (!texture.baseTexture.hasLoaded) {\n return;\n }\n\n var context = renderer.context;\n var transform = this.worldTransform;\n var resolution = renderer.resolution;\n var baseTexture = texture.baseTexture;\n var baseTextureResolution = baseTexture.resolution;\n var modX = this.tilePosition.x / this.tileScale.x % texture._frame.width * baseTextureResolution;\n var modY = this.tilePosition.y / this.tileScale.y % texture._frame.height * baseTextureResolution;\n\n // create a nice shiny pattern!\n if (this._textureID !== this._texture._updateID || this.cachedTint !== this.tint) {\n this._textureID = this._texture._updateID;\n // cut an object from a spritesheet..\n var tempCanvas = new core.CanvasRenderTarget(texture._frame.width, texture._frame.height, baseTextureResolution);\n\n // Tint the tiling sprite\n if (this.tint !== 0xFFFFFF) {\n this.tintedTexture = _CanvasTinter2.default.getTintedTexture(this, this.tint);\n tempCanvas.context.drawImage(this.tintedTexture, 0, 0);\n } else {\n tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x * baseTextureResolution, -texture._frame.y * baseTextureResolution);\n }\n this.cachedTint = this.tint;\n this._canvasPattern = tempCanvas.context.createPattern(tempCanvas.canvas, 'repeat');\n }\n\n // set context state..\n context.globalAlpha = this.worldAlpha;\n context.setTransform(transform.a * resolution, transform.b * resolution, transform.c * resolution, transform.d * resolution, transform.tx * resolution, transform.ty * resolution);\n\n renderer.setBlendMode(this.blendMode);\n\n // fill the pattern!\n context.fillStyle = this._canvasPattern;\n\n // TODO - this should be rolled into the setTransform above..\n context.scale(this.tileScale.x / baseTextureResolution, this.tileScale.y / baseTextureResolution);\n\n var anchorX = this.anchor.x * -this._width;\n var anchorY = this.anchor.y * -this._height;\n\n if (this.uvRespectAnchor) {\n context.translate(modX, modY);\n\n context.fillRect(-modX + anchorX, -modY + anchorY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution);\n } else {\n context.translate(modX + anchorX, modY + anchorY);\n\n context.fillRect(-modX, -modY, this._width / this.tileScale.x * baseTextureResolution, this._height / this.tileScale.y * baseTextureResolution);\n }\n };\n\n /**\n * Updates the bounds of the tiling sprite.\n *\n * @private\n */\n\n\n TilingSprite.prototype._calculateBounds = function _calculateBounds() {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n\n\n TilingSprite.prototype.getLocalBounds = function getLocalBounds(rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._x);\n\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new core.Rectangle();\n }\n\n rect = this._localBoundsRect;\n }\n\n return this._bounds.getRectangle(rect);\n }\n\n return _core$Sprite.prototype.getLocalBounds.call(this, rect);\n };\n\n /**\n * Checks if a point is inside this tiling sprite.\n *\n * @param {PIXI.Point} point - the point to check\n * @return {boolean} Whether or not the sprite contains the point.\n */\n\n\n TilingSprite.prototype.containsPoint = function containsPoint(point) {\n this.worldTransform.applyInverse(point, tempPoint);\n\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n\n return false;\n };\n\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n\n\n TilingSprite.prototype.destroy = function destroy(options) {\n _core$Sprite.prototype.destroy.call(this, options);\n\n this.tileTransform = null;\n this.uvTransform = null;\n };\n\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {number|string|PIXI.BaseTexture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @return {PIXI.Texture} The newly created texture\n */\n\n\n TilingSprite.from = function from(source, width, height) {\n return new TilingSprite(core.Texture.from(source), width, height);\n };\n\n /**\n * Helper function that creates a tiling sprite that will use a texture from the TextureCache based on the frameId\n * The frame ids are created when a Texture packer file has been loaded\n *\n * @static\n * @param {string} frameId - The frame Id of the texture in the cache\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the frameId\n */\n\n\n TilingSprite.fromFrame = function fromFrame(frameId, width, height) {\n var texture = core.utils.TextureCache[frameId];\n\n if (!texture) {\n throw new Error('The frameId \"' + frameId + '\" does not exist in the texture cache ' + this);\n }\n\n return new TilingSprite(texture, width, height);\n };\n\n /**\n * Helper function that creates a sprite that will contain a texture based on an image url\n * If the image is not in the texture cache it will be loaded\n *\n * @static\n * @param {string} imageId - The image url of the texture\n * @param {number} width - the width of the tiling sprite\n * @param {number} height - the height of the tiling sprite\n * @param {boolean} [crossorigin] - if you want to specify the cross-origin parameter\n * @param {number} [scaleMode=PIXI.settings.SCALE_MODE] - if you want to specify the scale mode,\n * see {@link PIXI.SCALE_MODES} for possible values\n * @return {PIXI.extras.TilingSprite} A new TilingSprite using a texture from the texture cache matching the image id\n */\n\n\n TilingSprite.fromImage = function fromImage(imageId, width, height, crossorigin, scaleMode) {\n return new TilingSprite(core.Texture.fromImage(imageId, crossorigin, scaleMode), width, height);\n };\n\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n\n _createClass(TilingSprite, [{\n key: 'clampMargin',\n get: function get() {\n return this.uvTransform.clampMargin;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uvTransform.clampMargin = value;\n this.uvTransform.update(true);\n }\n\n /**\n * The scaling of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'tileScale',\n get: function get() {\n return this.tileTransform.scale;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tileTransform.scale.copy(value);\n }\n\n /**\n * The offset of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n\n }, {\n key: 'tilePosition',\n get: function get() {\n return this.tileTransform.position;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.tileTransform.position.copy(value);\n }\n }, {\n key: 'width',\n get: function get() {\n return this._width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._width = value;\n }\n\n /**\n * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this._height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._height = value;\n }\n }]);\n\n return TilingSprite;\n}(core.Sprite);\n\nexports.default = TilingSprite;\n//# sourceMappingURL=TilingSprite.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/TilingSprite.js\n// module id = 569\n// module chunks = 0","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _Texture = require('../core/textures/Texture');\n\nvar _Texture2 = _interopRequireDefault(_Texture);\n\nvar _BaseTexture = require('../core/textures/BaseTexture');\n\nvar _BaseTexture2 = _interopRequireDefault(_BaseTexture);\n\nvar _utils = require('../core/utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DisplayObject = core.DisplayObject;\nvar _tempMatrix = new core.Matrix();\n\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = false;\n\n// figured theres no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n */\n\nvar CacheData =\n/**\n *\n */\nfunction CacheData() {\n _classCallCheck(this, CacheData);\n\n this.textureCacheId = null;\n\n this.originalRenderWebGL = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n\n this.originalUpdateTransform = null;\n this.originalHitTest = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.sprite = null;\n};\n\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to 'false'\n *\n * IMPORTANT GOTCHA - make sure that all your textures are preloaded BEFORE setting this property to true\n * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function get() {\n return this._cacheAsBitmap;\n },\n set: function set(value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n\n this._cacheAsBitmap = value;\n\n var data = void 0;\n\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n\n data = this._cacheData;\n\n data.originalRenderWebGL = this.renderWebGL;\n data.originalRenderCanvas = this.renderCanvas;\n\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this._calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n\n data.originalDestroy = this.destroy;\n\n data.originalContainsPoint = this.containsPoint;\n\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n\n this.renderWebGL = this._renderCachedWebGL;\n this.renderCanvas = this._renderCachedCanvas;\n\n this.destroy = this._cacheAsBitmapDestroy;\n } else {\n data = this._cacheData;\n\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n\n this.renderWebGL = data.originalRenderWebGL;\n this.renderCanvas = data.originalRenderCanvas;\n this._calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n\n this.destroy = data.originalDestroy;\n\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n }\n }\n});\n\n/**\n * Renders a cached version of the sprite with WebGL\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedWebGL = function _renderCachedWebGL(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n this._initCachedDisplayObject(renderer);\n\n this._cacheData.sprite._transformID = -1;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderWebGL(renderer);\n};\n\n/**\n * Prepares the WebGL renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n\n this.alpha = 1;\n\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.currentRenderer.flush();\n // this.filters= [];\n\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds().clone();\n\n // add some padding!\n if (this._filters) {\n var padding = this._filters[0].padding;\n\n bounds.pad(padding);\n }\n\n // for now we cache the current renderTarget that the webGL renderer is currently using.\n // this could be more elegent..\n var cachedRenderTarget = renderer._activeRenderTarget;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n var stack = renderer.filterManager.filterStack;\n\n // this renderTexture will be used to store the cached DisplayObject\n\n var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n var textureCacheId = 'cacheAsBitmap_' + (0, _utils.uid)();\n\n this._cacheData.textureCacheId = textureCacheId;\n\n _BaseTexture2.default.addToCache(renderTexture.baseTexture, textureCacheId);\n _Texture2.default.addToCache(renderTexture, textureCacheId);\n\n // need to set //\n var m = _tempMatrix;\n\n m.tx = -bounds.x;\n m.ty = -bounds.y;\n\n // reset\n this.transform.worldTransform.identity();\n\n // set all properties to there original so we can render to a texture\n this.renderWebGL = this._cacheData.originalRenderWebGL;\n\n renderer.render(this, renderTexture, true, m, true);\n // now restore the state be setting the new properties\n\n renderer.bindRenderTarget(cachedRenderTarget);\n\n renderer.filterManager.filterStack = stack;\n\n this.renderWebGL = this._renderCachedWebGL;\n this.updateTransform = this.displayObjectUpdateTransform;\n\n this._mask = null;\n this.filterArea = null;\n\n // create our cached sprite\n var cachedSprite = new core.Sprite(renderTexture);\n\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n\n // easy bounds..\n this._calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n\n this._cacheData.sprite = cachedSprite;\n\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this.updateTransform();\n }\n\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Renders a cached version of the sprite with canvas\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n\n this._initCachedDisplayObjectCanvas(renderer);\n\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n\n this._cacheData.sprite.renderCanvas(renderer);\n};\n\n// TODO this can be the same as the webGL verison.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n *\n * @private\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.WebGLRenderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds();\n\n var cacheAlpha = this.alpha;\n\n this.alpha = 1;\n\n var cachedRenderTarget = renderer.context;\n\n var renderTexture = core.RenderTexture.create(bounds.width | 0, bounds.height | 0);\n\n var textureCacheId = 'cacheAsBitmap_' + (0, _utils.uid)();\n\n this._cacheData.textureCacheId = textureCacheId;\n\n _BaseTexture2.default.addToCache(renderTexture.baseTexture, textureCacheId);\n _Texture2.default.addToCache(renderTexture, textureCacheId);\n\n // need to set //\n var m = _tempMatrix;\n\n this.transform.localTransform.copy(m);\n m.invert();\n\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n\n // renderTexture.render(this, m, true);\n renderer.render(this, renderTexture, true, m, false);\n\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n\n this.renderCanvas = this._renderCachedCanvas;\n this._calculateBounds = this._calculateCachedBounds;\n\n this._mask = null;\n this.filterArea = null;\n\n // create our cached sprite\n var cachedSprite = new core.Sprite(renderTexture);\n\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite._bounds = this._bounds;\n cachedSprite.alpha = cacheAlpha;\n\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n } else {\n this.updateTransform();\n }\n\n this.updateTransform = this.displayObjectUpdateTransform;\n\n this._cacheData.sprite = cachedSprite;\n\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n\n/**\n * Calculates the bounds of the cached sprite\n *\n * @private\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._cacheData.sprite._calculateBounds();\n};\n\n/**\n * Gets the bounds of the cached sprite.\n *\n * @private\n * @return {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds();\n};\n\n/**\n * Destroys the cached sprite.\n *\n * @private\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n\n _BaseTexture2.default.removeFromCache(this._cacheData.textureCacheId);\n _Texture2.default.removeFromCache(this._cacheData.textureCacheId);\n\n this._cacheData.textureCacheId = null;\n};\n\n/**\n * Destroys the cached object.\n *\n * @private\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * Used when destroying containers, see the Container.destroy method.\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) {\n this.cacheAsBitmap = false;\n this.destroy(options);\n};\n//# sourceMappingURL=cacheAsBitmap.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/cacheAsBitmap.js\n// module id = 570\n// module chunks = 0","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * The instance name of the object.\n *\n * @memberof PIXI.DisplayObject#\n * @member {string}\n */\ncore.DisplayObject.prototype.name = null;\n\n/**\n * Returns the display object in the container\n *\n * @memberof PIXI.Container#\n * @param {string} name - instance name\n * @return {PIXI.DisplayObject} The child with the specified name.\n */\ncore.Container.prototype.getChildByName = function getChildByName(name) {\n for (var i = 0; i < this.children.length; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n\n return null;\n};\n//# sourceMappingURL=getChildByName.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/getChildByName.js\n// module id = 571\n// module chunks = 0","'use strict';\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n *\n * @memberof PIXI.DisplayObject#\n * @param {Point} point - the point to write the global value to. If null a new point will be returned\n * @param {boolean} skipUpdate - setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost\n * @return {Point} The updated point\n */\ncore.DisplayObject.prototype.getGlobalPosition = function getGlobalPosition() {\n var point = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new core.Point();\n var skipUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n } else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n\n return point;\n};\n//# sourceMappingURL=getGlobalPosition.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/getGlobalPosition.js\n// module id = 572\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _const = require('../../core/const');\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar tempMat = new core.Matrix();\n\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI.extras\n * @extends PIXI.ObjectRenderer\n */\n\nvar TilingSpriteRenderer = function (_core$ObjectRenderer) {\n _inherits(TilingSpriteRenderer, _core$ObjectRenderer);\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n _classCallCheck(this, TilingSpriteRenderer);\n\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n _this.simpleShader = null;\n _this.quad = null;\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n TilingSpriteRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n vec4 sample = texture2D(uSampler, coord);\\n gl_FragColor = sample * uColor;\\n}\\n');\n this.simpleShader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\n\\nvoid main(void)\\n{\\n vec4 sample = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = sample * uColor;\\n}\\n');\n\n this.renderer.bindVao(null);\n this.quad = new core.Quad(gl, this.renderer.state.attribState);\n this.quad.initVao(this.shader);\n };\n\n /**\n *\n * @param {PIXI.extras.TilingSprite} ts tilingSprite to be rendered\n */\n\n\n TilingSpriteRenderer.prototype.render = function render(ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n\n renderer.bindVao(quad.vao);\n\n var vertices = quad.vertices;\n\n vertices[0] = vertices[6] = ts._width * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n\n vertices[2] = vertices[4] = ts._width * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n\n if (ts.uvRespectAnchor) {\n vertices = quad.uvs;\n\n vertices[0] = vertices[6] = -ts.anchor.x;\n vertices[1] = vertices[3] = -ts.anchor.y;\n\n vertices[2] = vertices[4] = 1.0 - ts.anchor.x;\n vertices[5] = vertices[7] = 1.0 - ts.anchor.y;\n }\n\n quad.upload();\n\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvTransform;\n var isSimple = baseTex.isPowerOfTwo && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === _const.WRAP_MODES.CLAMP) {\n baseTex.wrapMode = _const.WRAP_MODES.REPEAT;\n }\n } else {\n isSimple = baseTex.wrapMode !== _const.WRAP_MODES.CLAMP;\n }\n }\n\n var shader = isSimple ? this.simpleShader : this.shader;\n\n renderer.bindShader(shader);\n\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n\n tempMat.invert();\n if (isSimple) {\n tempMat.prepend(uv.mapCoord);\n } else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n\n shader.uniforms.uTransform = tempMat.toArray(true);\n shader.uniforms.uColor = core.utils.premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.premultipliedAlpha);\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n\n shader.uniforms.uSampler = renderer.bindTexture(tex);\n\n renderer.setBlendMode(core.utils.correctBlendMode(ts.blendMode, baseTex.premultipliedAlpha));\n\n quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n\n return TilingSpriteRenderer;\n}(core.ObjectRenderer);\n\nexports.default = TilingSpriteRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\n//# sourceMappingURL=TilingSpriteRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/extras/webgl/TilingSpriteRenderer.js\n// module id = 573\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BlurXFilter = require('./BlurXFilter');\n\nvar _BlurXFilter2 = _interopRequireDefault(_BlurXFilter);\n\nvar _BlurYFilter = require('./BlurYFilter');\n\nvar _BlurYFilter2 = _interopRequireDefault(_BlurYFilter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilter = function (_core$Filter) {\n _inherits(BlurFilter, _core$Filter);\n\n /**\n * @param {number} strength - The strength of the blur filter.\n * @param {number} quality - The quality of the blur filter.\n * @param {number} resolution - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n _classCallCheck(this, BlurFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this));\n\n _this.blurXFilter = new _BlurXFilter2.default(strength, quality, resolution, kernelSize);\n _this.blurYFilter = new _BlurYFilter2.default(strength, quality, resolution, kernelSize);\n\n _this.padding = 0;\n _this.resolution = resolution || core.settings.RESOLUTION;\n _this.quality = quality || 4;\n _this.blur = strength || 8;\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n\n\n BlurFilter.prototype.apply = function apply(filterManager, input, output) {\n var renderTarget = filterManager.getRenderTarget(true);\n\n this.blurXFilter.apply(filterManager, input, renderTarget, true);\n this.blurYFilter.apply(filterManager, renderTarget, output, false);\n\n filterManager.returnRenderTarget(renderTarget);\n };\n\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n *\n * @member {number}\n * @default 2\n */\n\n\n _createClass(BlurFilter, [{\n key: 'blur',\n get: function get() {\n return this.blurXFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the number of passes for blur. More passes means higher quaility bluring.\n *\n * @member {number}\n * @default 1\n */\n\n }, {\n key: 'quality',\n get: function get() {\n return this.blurXFilter.quality;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n }\n\n /**\n * Sets the strength of the blurX property\n *\n * @member {number}\n * @default 2\n */\n\n }, {\n key: 'blurX',\n get: function get() {\n return this.blurXFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurXFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the strength of the blurY property\n *\n * @member {number}\n * @default 2\n */\n\n }, {\n key: 'blurY',\n get: function get() {\n return this.blurYFilter.blur;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurYFilter.blur = value;\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n\n /**\n * Sets the blendmode of the filter\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n */\n\n }, {\n key: 'blendMode',\n get: function get() {\n return this.blurYFilter._blendMode;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.blurYFilter._blendMode = value;\n }\n }]);\n\n return BlurFilter;\n}(core.Filter);\n\nexports.default = BlurFilter;\n//# sourceMappingURL=BlurFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/blur/BlurFilter.js\n// module id = 574\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = function (_core$Filter) {\n _inherits(ColorMatrixFilter, _core$Filter);\n\n /**\n *\n */\n function ColorMatrixFilter() {\n _classCallCheck(this, ColorMatrixFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float m[20];\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (uAlpha == 0.0) {\\n gl_FragColor = c;\\n return;\\n }\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n }\\n\\n vec4 result;\\n\\n result.r = (m[0] * c.r);\\n result.r += (m[1] * c.g);\\n result.r += (m[2] * c.b);\\n result.r += (m[3] * c.a);\\n result.r += m[4];\\n\\n result.g = (m[5] * c.r);\\n result.g += (m[6] * c.g);\\n result.g += (m[7] * c.b);\\n result.g += (m[8] * c.a);\\n result.g += m[9];\\n\\n result.b = (m[10] * c.r);\\n result.b += (m[11] * c.g);\\n result.b += (m[12] * c.b);\\n result.b += (m[13] * c.a);\\n result.b += m[14];\\n\\n result.a = (m[15] * c.r);\\n result.a += (m[16] * c.g);\\n result.a += (m[17] * c.b);\\n result.a += (m[18] * c.a);\\n result.a += m[19];\\n\\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\\n\\n // Premultiply alpha again.\\n rgb *= result.a;\\n\\n gl_FragColor = vec4(rgb, result.a);\\n}\\n'));\n\n _this.uniforms.m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];\n\n _this.alpha = 1;\n return _this;\n }\n\n /**\n * Transforms current matrix and set the new one\n *\n * @param {number[]} matrix - 5x4 matrix\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype._loadMatrix = function _loadMatrix(matrix) {\n var multiply = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var newMatrix = matrix;\n\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n\n /**\n * Multiplies two mat5's\n *\n * @private\n * @param {number[]} out - 5x4 matrix the receiving matrix\n * @param {number[]} a - 5x4 matrix the first operand\n * @param {number[]} b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n\n\n ColorMatrixFilter.prototype._multiply = function _multiply(out, a, b) {\n // Red Channel\n out[0] = a[0] * b[0] + a[1] * b[5] + a[2] * b[10] + a[3] * b[15];\n out[1] = a[0] * b[1] + a[1] * b[6] + a[2] * b[11] + a[3] * b[16];\n out[2] = a[0] * b[2] + a[1] * b[7] + a[2] * b[12] + a[3] * b[17];\n out[3] = a[0] * b[3] + a[1] * b[8] + a[2] * b[13] + a[3] * b[18];\n out[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19] + a[4];\n\n // Green Channel\n out[5] = a[5] * b[0] + a[6] * b[5] + a[7] * b[10] + a[8] * b[15];\n out[6] = a[5] * b[1] + a[6] * b[6] + a[7] * b[11] + a[8] * b[16];\n out[7] = a[5] * b[2] + a[6] * b[7] + a[7] * b[12] + a[8] * b[17];\n out[8] = a[5] * b[3] + a[6] * b[8] + a[7] * b[13] + a[8] * b[18];\n out[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19] + a[9];\n\n // Blue Channel\n out[10] = a[10] * b[0] + a[11] * b[5] + a[12] * b[10] + a[13] * b[15];\n out[11] = a[10] * b[1] + a[11] * b[6] + a[12] * b[11] + a[13] * b[16];\n out[12] = a[10] * b[2] + a[11] * b[7] + a[12] * b[12] + a[13] * b[17];\n out[13] = a[10] * b[3] + a[11] * b[8] + a[12] * b[13] + a[13] * b[18];\n out[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19] + a[14];\n\n // Alpha Channel\n out[15] = a[15] * b[0] + a[16] * b[5] + a[17] * b[10] + a[18] * b[15];\n out[16] = a[15] * b[1] + a[16] * b[6] + a[17] * b[11] + a[18] * b[16];\n out[17] = a[15] * b[2] + a[16] * b[7] + a[17] * b[12] + a[18] * b[17];\n out[18] = a[15] * b[3] + a[16] * b[8] + a[17] * b[13] + a[18] * b[18];\n out[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19] + a[19];\n\n return out;\n };\n\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n *\n * @private\n * @param {number[]} matrix - 5x4 matrix\n * @return {number[]} 5x4 matrix with all values between 0-1\n */\n\n\n ColorMatrixFilter.prototype._colorMatrix = function _colorMatrix(matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n\n return m;\n };\n\n /**\n * Adjusts brightness\n *\n * @param {number} b - value of the brigthness (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.brightness = function brightness(b, multiply) {\n var matrix = [b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the matrices in grey scales\n *\n * @param {number} scale - value of the grey (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.greyscale = function greyscale(scale, multiply) {\n var matrix = [scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, scale, scale, scale, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the black and white matrice.\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.blackAndWhite = function blackAndWhite(multiply) {\n var matrix = [0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the hue property of the color\n *\n * @param {number} rotation - in degrees\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.hue = function hue(rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n\n var a00 = cosR + (1.0 - cosR) * w;\n var a01 = w * (1.0 - cosR) - sqrW * sinR;\n var a02 = w * (1.0 - cosR) + sqrW * sinR;\n\n var a10 = w * (1.0 - cosR) + sqrW * sinR;\n var a11 = cosR + w * (1.0 - cosR);\n var a12 = w * (1.0 - cosR) - sqrW * sinR;\n\n var a20 = w * (1.0 - cosR) - sqrW * sinR;\n var a21 = w * (1.0 - cosR) + sqrW * sinR;\n var a22 = cosR + w * (1.0 - cosR);\n\n var matrix = [a00, a01, a02, 0, 0, a10, a11, a12, 0, 0, a20, a21, a22, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n *\n * @param {number} amount - value of the contrast (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.contrast = function contrast(amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -0.5 * (v - 1);\n\n var matrix = [v, 0, 0, 0, o, 0, v, 0, 0, o, 0, 0, v, 0, o, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n *\n * @param {number} amount - The saturation amount (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.saturate = function saturate() {\n var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var multiply = arguments[1];\n\n var x = amount * 2 / 3 + 1;\n var y = (x - 1) * -0.5;\n\n var matrix = [x, y, y, 0, 0, y, x, y, 0, 0, y, y, x, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Desaturate image (remove color)\n *\n * Call the saturate function\n *\n */\n\n\n ColorMatrixFilter.prototype.desaturate = function desaturate() // eslint-disable-line no-unused-vars\n {\n this.saturate(-1);\n };\n\n /**\n * Negative image (inverse of classic rgb matrix)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.negative = function negative(multiply) {\n var matrix = [0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Sepia image\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.sepia = function sepia(multiply) {\n var matrix = [0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.technicolor = function technicolor(multiply) {\n var matrix = [1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Polaroid filter\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.polaroid = function polaroid(multiply) {\n var matrix = [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.toBGR = function toBGR(multiply) {\n var matrix = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.kodachrome = function kodachrome(multiply) {\n var matrix = [1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.browni = function browni(multiply) {\n var matrix = [0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Vintage filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.vintage = function vintage(multiply) {\n var matrix = [0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n *\n * @param {number} desaturation - Tone values.\n * @param {number} toned - Tone values.\n * @param {string} lightColor - Tone values, example: `0xFFE580`\n * @param {string} darkColor - Tone values, example: `0xFFE580`\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.colorTone = function colorTone(desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n\n var lR = (lightColor >> 16 & 0xFF) / 255;\n var lG = (lightColor >> 8 & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n\n var dR = (darkColor >> 16 & 0xFF) / 255;\n var dG = (darkColor >> 8 & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n\n var matrix = [0.3, 0.59, 0.11, 0, 0, lR, lG, lB, desaturation, 0, dR, dG, dB, toned, 0, lR - dR, lG - dG, lB - dB, 0, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Night effect\n *\n * @param {number} intensity - The intensity of the night effect.\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.night = function night(intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [intensity * -2.0, -intensity, 0, 0, 0, -intensity, 0, intensity, 0, 0, 0, intensity, intensity * 2.0, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n *\n * @param {number} amount - how much the predator feels his future victim\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.predator = function predator(amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount, -4.794486999511719 * amount, -2.8746118545532227 * amount, 0 * amount, 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount, 9.193157196044922 * amount, -2.951810836791992 * amount, 0 * amount, -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount, -4.2375030517578125 * amount, 7.476448059082031 * amount, 0 * amount, 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * LSD effect\n *\n * Multiply the current matrix\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n\n\n ColorMatrixFilter.prototype.lsd = function lsd(multiply) {\n var matrix = [2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, multiply);\n };\n\n /**\n * Erase the current matrix by setting the default one\n *\n */\n\n\n ColorMatrixFilter.prototype.reset = function reset() {\n var matrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];\n\n this._loadMatrix(matrix, false);\n };\n\n /**\n * The matrix of the color matrix filter\n *\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n\n\n _createClass(ColorMatrixFilter, [{\n key: 'matrix',\n get: function get() {\n return this.uniforms.m;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.m = value;\n }\n\n /**\n * The opacity value to use when mixing the original and resultant colors.\n *\n * When the value is 0, the original color is used without modification.\n * When the value is 1, the result color is used.\n * When in the range (0, 1) the color is interpolated between the original and result by this amount.\n *\n * @member {number}\n * @default 1\n */\n\n }, {\n key: 'alpha',\n get: function get() {\n return this.uniforms.uAlpha;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uAlpha = value;\n }\n }]);\n\n return ColorMatrixFilter;\n}(core.Filter);\n\n// Americanized alias\n\n\nexports.default = ColorMatrixFilter;\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n//# sourceMappingURL=ColorMatrixFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/colormatrix/ColorMatrixFilter.js\n// module id = 575\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object. You can\n * use this filter to apply all manor of crazy warping effects. Currently the r\n * property of the texture is used to offset the x and the g property of the texture\n * is used to offset the y.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = function (_core$Filter) {\n _inherits(DisplacementFilter, _core$Filter);\n\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param {number} scale - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n _classCallCheck(this, DisplacementFilter);\n\n var maskMatrix = new core.Matrix();\n\n sprite.renderable = false;\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\n\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform vec4 filterClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy *= scale;\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), filterClamp.xy, filterClamp.zw));\\n}\\n'));\n\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n\n _this.uniforms.mapSampler = sprite._texture;\n _this.uniforms.filterMatrix = maskMatrix;\n _this.uniforms.scale = { x: 1, y: 1 };\n\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n\n _this.scale = new core.Point(scale, scale);\n return _this;\n }\n\n /**\n * Applies the filter.\n *\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n\n\n DisplacementFilter.prototype.apply = function apply(filterManager, input, output) {\n var ratio = 1 / output.destinationFrame.width * (output.size.width / input.size.width);\n\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x * ratio;\n this.uniforms.scale.y = this.scale.y * ratio;\n\n // draw the filter...\n filterManager.applyFilter(this, input, output);\n };\n\n /**\n * The texture used for the displacement map. Must be power of 2 sized texture.\n *\n * @member {PIXI.Texture}\n */\n\n\n _createClass(DisplacementFilter, [{\n key: 'map',\n get: function get() {\n return this.uniforms.mapSampler;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.mapSampler = value;\n }\n }]);\n\n return DisplacementFilter;\n}(core.Filter);\n\nexports.default = DisplacementFilter;\n//# sourceMappingURL=DisplacementFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/displacement/DisplacementFilter.js\n// module id = 576\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n *\n * Basic FXAA implementation based on the code on geeks3d.com with the\n * modification that the texture2DLod stuff was removed since it's\n * unsupported by WebGL.\n *\n * @see https://github.com/mitsuhiko/webgl-meincraft\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n *\n */\nvar FXAAFilter = function (_core$Filter) {\n _inherits(FXAAFilter, _core$Filter);\n\n /**\n *\n */\n function FXAAFilter() {\n _classCallCheck(this, FXAAFilter);\n\n // TODO - needs work\n return _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n '\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nuniform vec4 filterArea;\\n\\nvarying vec2 vTextureCoord;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\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\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n\\n vec2 fragCoord = vTextureCoord * filterArea.xy;\\n\\n texcoords(fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}',\n // fragment shader\n 'varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it\\'s\\n unsupported by WebGL.\\n \\n --\\n \\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n \\n Copyright (c) 2011 by Armin Ronacher.\\n \\n Some rights reserved.\\n \\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\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 \\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF 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\\nvoid main() {\\n\\n vec2 fragCoord = vTextureCoord * filterArea.xy;\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n'));\n }\n\n return FXAAFilter;\n}(core.Filter);\n\nexports.default = FXAAFilter;\n//# sourceMappingURL=FXAAFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/fxaa/FXAAFilter.js\n// module id = 577\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _FXAAFilter = require('./fxaa/FXAAFilter');\n\nObject.defineProperty(exports, 'FXAAFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FXAAFilter).default;\n }\n});\n\nvar _NoiseFilter = require('./noise/NoiseFilter');\n\nObject.defineProperty(exports, 'NoiseFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NoiseFilter).default;\n }\n});\n\nvar _DisplacementFilter = require('./displacement/DisplacementFilter');\n\nObject.defineProperty(exports, 'DisplacementFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_DisplacementFilter).default;\n }\n});\n\nvar _BlurFilter = require('./blur/BlurFilter');\n\nObject.defineProperty(exports, 'BlurFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurFilter).default;\n }\n});\n\nvar _BlurXFilter = require('./blur/BlurXFilter');\n\nObject.defineProperty(exports, 'BlurXFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurXFilter).default;\n }\n});\n\nvar _BlurYFilter = require('./blur/BlurYFilter');\n\nObject.defineProperty(exports, 'BlurYFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BlurYFilter).default;\n }\n});\n\nvar _ColorMatrixFilter = require('./colormatrix/ColorMatrixFilter');\n\nObject.defineProperty(exports, 'ColorMatrixFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ColorMatrixFilter).default;\n }\n});\n\nvar _VoidFilter = require('./void/VoidFilter');\n\nObject.defineProperty(exports, 'VoidFilter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_VoidFilter).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/index.js\n// module id = 578\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @author Vico @vicocotea\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n */\n\n/**\n * A Noise effect filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar NoiseFilter = function (_core$Filter) {\n _inherits(NoiseFilter, _core$Filter);\n\n /**\n * @param {number} noise - The noise intensity, should be a normalized value in the range [0, 1].\n * @param {number} seed - A random seed for the noise generation. Default is `Math.random()`.\n */\n function NoiseFilter() {\n var noise = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;\n var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Math.random();\n\n _classCallCheck(this, NoiseFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float uNoise;\\nuniform float uSeed;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float randomValue = rand(gl_FragCoord.xy * uSeed);\\n float diff = (randomValue - 0.5) * uNoise;\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n }\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n // Premultiply alpha again.\\n color.rgb *= color.a;\\n\\n gl_FragColor = color;\\n}\\n'));\n\n _this.noise = noise;\n _this.seed = seed;\n return _this;\n }\n\n /**\n * The amount of noise to apply, this value should be in the range (0, 1].\n *\n * @member {number}\n * @default 0.5\n */\n\n\n _createClass(NoiseFilter, [{\n key: 'noise',\n get: function get() {\n return this.uniforms.uNoise;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uNoise = value;\n }\n\n /**\n * A seed value to apply to the random noise generation. `Math.random()` is a good value to use.\n *\n * @member {number}\n */\n\n }, {\n key: 'seed',\n get: function get() {\n return this.uniforms.uSeed;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this.uniforms.uSeed = value;\n }\n }]);\n\n return NoiseFilter;\n}(core.Filter);\n\nexports.default = NoiseFilter;\n//# sourceMappingURL=NoiseFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/noise/NoiseFilter.js\n// module id = 579\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _path = require('path');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Does nothing. Very handy.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar VoidFilter = function (_core$Filter) {\n _inherits(VoidFilter, _core$Filter);\n\n /**\n *\n */\n function VoidFilter() {\n _classCallCheck(this, VoidFilter);\n\n var _this = _possibleConstructorReturn(this, _core$Filter.call(this,\n // vertex shader\n 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}',\n // fragment shader\n 'varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n}\\n'));\n\n _this.glShaderKey = 'void';\n return _this;\n }\n\n return VoidFilter;\n}(core.Filter);\n\nexports.default = VoidFilter;\n//# sourceMappingURL=VoidFilter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/filters/void/VoidFilter.js\n// module id = 580\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _InteractionData = require('./InteractionData');\n\nvar _InteractionData2 = _interopRequireDefault(_InteractionData);\n\nvar _InteractionEvent = require('./InteractionEvent');\n\nvar _InteractionEvent2 = _interopRequireDefault(_InteractionEvent);\n\nvar _InteractionTrackingData = require('./InteractionTrackingData');\n\nvar _InteractionTrackingData2 = _interopRequireDefault(_InteractionTrackingData);\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _interactiveTarget = require('./interactiveTarget');\n\nvar _interactiveTarget2 = _interopRequireDefault(_interactiveTarget);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// Mix interactiveTarget into core.DisplayObject.prototype, after deprecation has been handled\ncore.utils.mixins.delayMixin(core.DisplayObject.prototype, _interactiveTarget2.default);\n\nvar MOUSE_POINTER_ID = 'MOUSE';\n\n// helpers for hitTest() - only used inside hitTest()\nvar hitTestEvent = {\n target: null,\n data: {\n global: null\n }\n};\n\n/**\n * The interaction manager deals with mouse, touch and pointer events. Any DisplayObject can be interactive\n * if its interactive parameter is set to true\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.interaction\n *\n * @class\n * @extends EventEmitter\n * @memberof PIXI.interaction\n */\n\nvar InteractionManager = function (_EventEmitter) {\n _inherits(InteractionManager, _EventEmitter);\n\n /**\n * @param {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - A reference to the current renderer\n * @param {object} [options] - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Frequency increases the interaction events will be checked.\n */\n function InteractionManager(renderer, options) {\n _classCallCheck(this, InteractionManager);\n\n var _this = _possibleConstructorReturn(this, _EventEmitter.call(this));\n\n options = options || {};\n\n /**\n * The renderer this interaction manager works for.\n *\n * @member {PIXI.SystemRenderer}\n */\n _this.renderer = renderer;\n\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n\n /**\n * Frequency in milliseconds that the mousemove, moveover & mouseout interaction events will be checked.\n *\n * @member {number}\n * @default 10\n */\n _this.interactionFrequency = options.interactionFrequency || 10;\n\n /**\n * The mouse data\n *\n * @member {PIXI.interaction.InteractionData}\n */\n _this.mouse = new _InteractionData2.default();\n _this.mouse.identifier = MOUSE_POINTER_ID;\n\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n\n /**\n * Actively tracked InteractionData\n *\n * @private\n * @member {Object.}\n */\n _this.activeInteractionData = {};\n _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse;\n\n /**\n * Pool of unused InteractionData\n *\n * @private\n * @member {PIXI.interation.InteractionData[]}\n */\n _this.interactionDataPool = [];\n\n /**\n * An event data object to handle all the event tracking/dispatching\n *\n * @member {object}\n */\n _this.eventData = new _InteractionEvent2.default();\n\n /**\n * The DOM element to bind to.\n *\n * @private\n * @member {HTMLElement}\n */\n _this.interactionDOMElement = null;\n\n /**\n * This property determines if mousemove and touchmove events are fired only when the cursor\n * is over the object.\n * Setting to true will make things work more in line with how the DOM verison works.\n * Setting to false can make things easier for things like dragging\n * It is currently set to false as this is how PixiJS used to work. This will be set to true in\n * future versions of pixi.\n *\n * @member {boolean}\n * @default false\n */\n _this.moveWhenInside = false;\n\n /**\n * Have events been attached to the dom element?\n *\n * @private\n * @member {boolean}\n */\n _this.eventsAdded = false;\n\n /**\n * Is the mouse hovering over the renderer?\n *\n * @private\n * @member {boolean}\n */\n _this.mouseOverRenderer = false;\n\n /**\n * Does the device support touch events\n * https://www.w3.org/TR/touch-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsTouchEvents = 'ontouchstart' in window;\n\n /**\n * Does the device support pointer events\n * https://www.w3.org/Submission/pointer-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsPointerEvents = !!window.PointerEvent;\n\n // this will make it so that you don't have to call bind all the time\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerCancel = _this.onPointerCancel.bind(_this);\n _this.processPointerCancel = _this.processPointerCancel.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for interactionDOMElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object.)>}\n */\n _this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer'\n };\n\n /**\n * The mode of the cursor that is being used.\n * The value of this is a key from the cursorStyles dictionary.\n *\n * @member {string}\n */\n _this.currentCursorMode = null;\n\n /**\n * Internal cached let.\n *\n * @private\n * @member {string}\n */\n _this.cursor = null;\n\n /**\n * Internal cached let.\n *\n * @private\n * @member {PIXI.Point}\n */\n _this._tempPoint = new core.Point();\n\n /**\n * The current resolution / device pixel ratio.\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = 1;\n\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n *\n * @event PIXI.interaction.InteractionManager#mousedown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n *\n * @event PIXI.interaction.InteractionManager#rightdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n *\n * @event PIXI.interaction.InteractionManager#mouseup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n *\n * @event PIXI.interaction.InteractionManager#rightup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n *\n * @event PIXI.interaction.InteractionManager#click\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n *\n * @event PIXI.interaction.InteractionManager#rightclick\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.interaction.InteractionManager#event:mousedown}.\n *\n * @event PIXI.interaction.InteractionManager#mouseupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.interaction.InteractionManager#event:rightdown}.\n *\n * @event PIXI.interaction.InteractionManager#rightupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n *\n * @event PIXI.interaction.InteractionManager#mousemove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n *\n * @event PIXI.interaction.InteractionManager#mouseover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n *\n * @event PIXI.interaction.InteractionManager#mouseout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n *\n * @event PIXI.interaction.InteractionManager#pointerdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n *\n * @event PIXI.interaction.InteractionManager#pointerup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a pointer event\n *\n * @event PIXI.interaction.InteractionManager#pointercancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n *\n * @event PIXI.interaction.InteractionManager#pointertap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.interaction.InteractionManager#event:pointerdown}.\n *\n * @event PIXI.interaction.InteractionManager#pointerupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved while over the display object\n *\n * @event PIXI.interaction.InteractionManager#pointermove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved onto the display object\n *\n * @event PIXI.interaction.InteractionManager#pointerover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved off the display object\n *\n * @event PIXI.interaction.InteractionManager#pointerout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n *\n * @event PIXI.interaction.InteractionManager#touchstart\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n *\n * @event PIXI.interaction.InteractionManager#touchend\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a touch\n *\n * @event PIXI.interaction.InteractionManager#touchcancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n *\n * @event PIXI.interaction.InteractionManager#tap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.interaction.InteractionManager#event:touchstart}.\n *\n * @event PIXI.interaction.InteractionManager#touchendoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n *\n * @event PIXI.interaction.InteractionManager#touchmove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#click\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.interaction.InteractionEvent} event - Interaction event\n */\n return _this;\n }\n\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n *\n * @param {PIXI.Point} globalPoint - A point to hit test with, in global space.\n * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @return {PIXI.DisplayObject} The hit display object, if any.\n */\n\n\n InteractionManager.prototype.hitTest = function hitTest(globalPoint, root) {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root) {\n root = this.renderer._lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n\n return hitTestEvent.target;\n };\n\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to deletegate\n * another DOM element to receive those events.\n *\n * @param {HTMLCanvasElement} element - the DOM element which will receive mouse and touch events.\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).\n * @private\n */\n\n\n InteractionManager.prototype.setTargetElement = function setTargetElement(element) {\n var resolution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n this.removeEvents();\n\n this.interactionDOMElement = element;\n\n this.resolution = resolution;\n\n this.addEvents();\n };\n\n /**\n * Registers all the DOM events\n *\n * @private\n */\n\n\n InteractionManager.prototype.addEvents = function addEvents() {\n if (!this.interactionDOMElement) {\n return;\n }\n\n core.ticker.shared.add(this.update, this, core.UPDATE_PRIORITY.INTERACTION);\n\n if (window.navigator.msPointerEnabled) {\n this.interactionDOMElement.style['-ms-content-zooming'] = 'none';\n this.interactionDOMElement.style['-ms-touch-action'] = 'none';\n } else if (this.supportsPointerEvents) {\n this.interactionDOMElement.style['touch-action'] = 'none';\n }\n\n /**\n * These events are added first, so that if pointer events are normalised, they are fired\n * in the same order as non-normalised events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n window.document.addEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n window.addEventListener('pointercancel', this.onPointerCancel, true);\n window.addEventListener('pointerup', this.onPointerUp, true);\n } else {\n window.document.addEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n window.addEventListener('mouseup', this.onPointerUp, true);\n }\n\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n\n this.eventsAdded = true;\n };\n\n /**\n * Removes all the DOM events that were previously registered\n *\n * @private\n */\n\n\n InteractionManager.prototype.removeEvents = function removeEvents() {\n if (!this.interactionDOMElement) {\n return;\n }\n\n core.ticker.shared.remove(this.update, this);\n\n if (window.navigator.msPointerEnabled) {\n this.interactionDOMElement.style['-ms-content-zooming'] = '';\n this.interactionDOMElement.style['-ms-touch-action'] = '';\n } else if (this.supportsPointerEvents) {\n this.interactionDOMElement.style['touch-action'] = '';\n }\n\n if (this.supportsPointerEvents) {\n window.document.removeEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true);\n window.removeEventListener('pointercancel', this.onPointerCancel, true);\n window.removeEventListener('pointerup', this.onPointerUp, true);\n } else {\n window.document.removeEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true);\n window.removeEventListener('mouseup', this.onPointerUp, true);\n }\n\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n\n this.interactionDOMElement = null;\n\n this.eventsAdded = false;\n };\n\n /**\n * Updates the state of interactive objects.\n * Invoked by a throttled ticker update from {@link PIXI.ticker.shared}.\n *\n * @param {number} deltaTime - time delta since last tick\n */\n\n\n InteractionManager.prototype.update = function update(deltaTime) {\n this._deltaTime += deltaTime;\n\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n\n this._deltaTime = 0;\n\n if (!this.interactionDOMElement) {\n return;\n }\n\n // if the user move the mouse this check has already been done using the mouse move!\n if (this.didMove) {\n this.didMove = false;\n\n return;\n }\n\n this.cursor = null;\n\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (var k in this.activeInteractionData) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k)) {\n var interactionData = this.activeInteractionData[k];\n\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch') {\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData);\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerOverOut, true);\n }\n }\n }\n\n this.setCursorMode(this.cursor);\n\n // TODO\n };\n\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n *\n * @param {string} mode - cursor mode, a key from the cursorStyles dictionary\n */\n\n\n InteractionManager.prototype.setCursorMode = function setCursorMode(mode) {\n mode = mode || 'default';\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode) {\n return;\n }\n this.currentCursorMode = mode;\n var style = this.cursorStyles[mode];\n\n // only do things if there is a cursor style for it\n if (style) {\n switch (typeof style === 'undefined' ? 'undefined' : _typeof(style)) {\n case 'string':\n // string styles are handled as cursor CSS\n this.interactionDOMElement.style.cursor = style;\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n Object.assign(this.interactionDOMElement.style, style);\n break;\n }\n } else if (typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n };\n\n /**\n * Dispatches an event on the display object that was interacted with\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {object} eventData - the event data object\n * @private\n */\n\n\n InteractionManager.prototype.dispatchEvent = function dispatchEvent(displayObject, eventString, eventData) {\n if (!eventData.stopped) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n\n displayObject.emit(eventString, eventData);\n\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n *\n * @param {PIXI.Point} point - the point that the result will be stored in\n * @param {number} x - the x coord of the position to map\n * @param {number} y - the y coord of the position to map\n */\n\n\n InteractionManager.prototype.mapPositionToPoint = function mapPositionToPoint(point, x, y) {\n var rect = void 0;\n\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = { x: 0, y: 0, width: 0, height: 0 };\n } else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n\n var resolutionMultiplier = navigator.isCocoonJS ? this.resolution : 1.0 / this.resolution;\n\n point.x = (x - rect.left) * (this.interactionDOMElement.width / rect.width) * resolutionMultiplier;\n point.y = (y - rect.top) * (this.interactionDOMElement.height / rect.height) * resolutionMultiplier;\n };\n\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @param {boolean} [interactive] - Whether the displayObject is interactive\n * @return {boolean} returns true if the displayObject hit the point\n */\n\n\n InteractionManager.prototype.processInteractive = function processInteractive(interactionEvent, displayObject, func, hitTest, interactive) {\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n\n var point = interactionEvent.data.global;\n\n // Took a little while to rework this function correctly! But now it is done and nice and optimised. ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimisation once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimisation is that an object is not hit test directly if a child has already been hit.\n\n interactive = displayObject.interactive || interactive;\n\n var hit = false;\n var interactiveParent = interactive;\n\n // if the displayobject has a hitArea, then it does not need to hitTest children.\n if (displayObject.hitArea) {\n interactiveParent = false;\n }\n // it has a mask! Then lets hit test that before continuing\n else if (hitTest && displayObject._mask) {\n if (!displayObject._mask.containsPoint(point)) {\n hitTest = false;\n }\n }\n\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n\n // time to get recursive.. if this function will return if something is hit..\n var childHit = this.processInteractive(interactionEvent, child, func, hitTest, interactiveParent);\n\n if (childHit) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n\n if (childHit) {\n if (interactionEvent.target) {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target) {\n if (displayObject.hitArea) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {\n hit = true;\n }\n } else if (displayObject.containsPoint) {\n if (displayObject.containsPoint(point)) {\n hit = true;\n }\n }\n }\n\n if (displayObject.interactive) {\n if (hit && !interactionEvent.target) {\n interactionEvent.target = displayObject;\n }\n\n if (func) {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n\n return hit;\n };\n\n /**\n * Is called when the pointer button is pressed down on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being pressed down\n */\n\n\n InteractionManager.prototype.onPointerDown = function onPointerDown(originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return;\n\n var events = this.normalizeToPointerData(originalEvent);\n\n /**\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n\n if (this.autoPreventDefault && events[0].isNormalized) {\n originalEvent.preventDefault();\n }\n\n var eventLen = events.length;\n\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerDown, true);\n\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch') {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n };\n\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerDown = function processPointerDown(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n\n if (hit) {\n if (!displayObject.trackedPointers[id]) {\n displayObject.trackedPointers[id] = new _InteractionTrackingData2.default(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n } else if (data.pointerType === 'mouse' || data.pointerType === 'pen') {\n var isRightButton = data.button === 2;\n\n if (isRightButton) {\n displayObject.trackedPointers[id].rightDown = true;\n } else {\n displayObject.trackedPointers[id].leftDown = true;\n }\n\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n };\n\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being released\n * @param {boolean} cancelled - true if the pointer is cancelled\n * @param {Function} func - Function passed to {@link processInteractive}\n */\n\n\n InteractionManager.prototype.onPointerComplete = function onPointerComplete(originalEvent, cancelled, func) {\n var events = this.normalizeToPointerData(originalEvent);\n\n var eventLen = events.length;\n\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n var eventAppend = originalEvent.target !== this.interactionDOMElement ? 'outside' : '';\n\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, func, cancelled || !eventAppend);\n\n this.emit(cancelled ? 'pointercancel' : 'pointerup' + eventAppend, interactionEvent);\n\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n\n this.emit(isRightButton ? 'rightup' + eventAppend : 'mouseup' + eventAppend, interactionEvent);\n } else if (event.pointerType === 'touch') {\n this.emit(cancelled ? 'touchcancel' : 'touchend' + eventAppend, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId, interactionData);\n }\n }\n };\n\n /**\n * Is called when the pointer button is cancelled\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n\n\n InteractionManager.prototype.onPointerCancel = function onPointerCancel(event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch') return;\n\n this.onPointerComplete(event, true, this.processPointerCancel);\n };\n\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n */\n\n\n InteractionManager.prototype.processPointerCancel = function processPointerCancel(interactionEvent, displayObject) {\n var data = interactionEvent.data;\n\n var id = interactionEvent.data.identifier;\n\n if (displayObject.trackedPointers[id] !== undefined) {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n };\n\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n\n\n InteractionManager.prototype.onPointerUp = function onPointerUp(event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch') return;\n\n this.onPointerComplete(event, false, this.processPointerUp);\n };\n\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerUp = function processPointerUp(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n\n var id = interactionEvent.data.identifier;\n\n var trackingData = displayObject.trackedPointers[id];\n\n var isTouch = data.pointerType === 'touch';\n\n var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen';\n\n // Mouse only\n if (isMouse) {\n var isRightButton = data.button === 2;\n\n var flags = _InteractionTrackingData2.default.FLAGS;\n\n var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n\n var isDown = trackingData !== undefined && trackingData.flags & test;\n\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n\n if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n }\n } else if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData) {\n if (isRightButton) {\n trackingData.rightDown = false;\n } else {\n trackingData.leftDown = false;\n }\n }\n }\n\n // Pointers and Touches, and Mouse\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchend', interactionEvent);\n\n if (trackingData) {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n if (isTouch) {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n } else if (trackingData) {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent);\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n };\n\n /**\n * Is called when the pointer moves across the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer moving\n */\n\n\n InteractionManager.prototype.onPointerMove = function onPointerMove(originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return;\n\n var events = this.normalizeToPointerData(originalEvent);\n\n if (events[0].pointerType === 'mouse') {\n this.didMove = true;\n\n this.cursor = null;\n }\n\n var eventLen = events.length;\n\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = originalEvent;\n\n var interactive = event.pointerType === 'touch' ? this.moveWhenInside : true;\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerMove, interactive);\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch') this.emit('touchmove', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') this.emit('mousemove', interactionEvent);\n }\n\n if (events[0].pointerType === 'mouse') {\n this.setCursorMode(this.cursor);\n\n // TODO BUG for parents interactive object (border order issue)\n }\n };\n\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerMove = function processPointerMove(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n\n var isTouch = data.pointerType === 'touch';\n\n var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen';\n\n if (isMouse) {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch) this.dispatchEvent(displayObject, 'touchmove', interactionEvent);\n if (isMouse) this.dispatchEvent(displayObject, 'mousemove', interactionEvent);\n }\n };\n\n /**\n * Is called when the pointer is moved out of the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n\n\n InteractionManager.prototype.onPointerOut = function onPointerOut(originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch') return;\n\n var events = this.normalizeToPointerData(originalEvent);\n\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n var event = events[0];\n\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = event;\n\n this.processInteractive(interactionEvent, this.renderer._lastObjectRendered, this.processPointerOverOut, false);\n\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseout', interactionEvent);\n } else {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n };\n\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.extras.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n\n\n InteractionManager.prototype.processPointerOverOut = function processPointerOverOut(interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n\n var id = interactionEvent.data.identifier;\n\n var isMouse = data.pointerType === 'mouse' || data.pointerType === 'pen';\n\n var trackingData = displayObject.trackedPointers[id];\n\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData) {\n trackingData = displayObject.trackedPointers[id] = new _InteractionTrackingData2.default(id);\n }\n\n if (trackingData === undefined) return;\n\n if (hit && this.mouseOverRenderer) {\n if (!trackingData.over) {\n trackingData.over = true;\n this.dispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null) {\n this.cursor = displayObject.cursor;\n }\n } else if (trackingData.over) {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n }\n };\n\n /**\n * Is called when the pointer is moved into the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being moved into the renderer view\n */\n\n\n InteractionManager.prototype.onPointerOver = function onPointerOver(originalEvent) {\n var events = this.normalizeToPointerData(originalEvent);\n\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n var event = events[0];\n\n var interactionData = this.getInteractionDataForPointerId(event);\n\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n\n interactionEvent.data.originalEvent = event;\n\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = true;\n }\n\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseover', interactionEvent);\n }\n };\n\n /**\n * Get InteractionData for a given pointerId. Store that data as well\n *\n * @private\n * @param {PointerEvent} event - Normalized pointer event, output from normalizeToPointerData\n * @return {PIXI.interaction.InteractionData} - Interaction data for the given pointer identifier\n */\n\n\n InteractionManager.prototype.getInteractionDataForPointerId = function getInteractionDataForPointerId(event) {\n var pointerId = event.pointerId;\n\n var interactionData = void 0;\n\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') {\n interactionData = this.mouse;\n } else if (this.activeInteractionData[pointerId]) {\n interactionData = this.activeInteractionData[pointerId];\n } else {\n interactionData = this.interactionDataPool.pop() || new _InteractionData2.default();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData._copyEvent(event);\n\n return interactionData;\n };\n\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n *\n * @private\n * @param {number} pointerId - Identifier from a pointer event\n */\n\n\n InteractionManager.prototype.releaseInteractionDataForPointerId = function releaseInteractionDataForPointerId(pointerId) {\n var interactionData = this.activeInteractionData[pointerId];\n\n if (interactionData) {\n delete this.activeInteractionData[pointerId];\n interactionData._reset();\n this.interactionDataPool.push(interactionData);\n }\n };\n\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n *\n * @private\n * @param {PIXI.interaction.InteractionEvent} interactionEvent - The event to be configured\n * @param {PointerEvent} pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param {PIXI.interaction.InteractionData} interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @return {PIXI.interaction.InteractionEvent} the interaction event that was passed in\n */\n\n\n InteractionManager.prototype.configureInteractionEventForDOMEvent = function configureInteractionEventForDOMEvent(interactionEvent, pointerEvent, interactionData) {\n interactionEvent.data = interactionData;\n\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n\n // This is the way InteractionManager processed touch events before the refactoring, so I've kept\n // it here. But it doesn't make that much sense to me, since mapPositionToPoint already factors\n // in this.resolution, so this just divides by this.resolution twice for touch events...\n if (navigator.isCocoonJS && pointerEvent.pointerType === 'touch') {\n interactionData.global.x = interactionData.global.x / this.resolution;\n interactionData.global.y = interactionData.global.y / this.resolution;\n }\n\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch') {\n pointerEvent.globalX = interactionData.global.x;\n pointerEvent.globalY = interactionData.global.y;\n }\n\n interactionData.originalEvent = pointerEvent;\n interactionEvent._reset();\n\n return interactionEvent;\n };\n\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n *\n * @private\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n\n\n InteractionManager.prototype.normalizeToPointerData = function normalizeToPointerData(event) {\n var normalizedEvents = [];\n\n if (this.supportsTouchEvents && event instanceof TouchEvent) {\n for (var i = 0, li = event.changedTouches.length; i < li; i++) {\n var touch = event.changedTouches[i];\n\n if (typeof touch.button === 'undefined') touch.button = event.touches.length ? 1 : 0;\n if (typeof touch.buttons === 'undefined') touch.buttons = event.touches.length ? 1 : 0;\n if (typeof touch.isPrimary === 'undefined') {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined') touch.width = touch.radiusX || 1;\n if (typeof touch.height === 'undefined') touch.height = touch.radiusY || 1;\n if (typeof touch.tiltX === 'undefined') touch.tiltX = 0;\n if (typeof touch.tiltY === 'undefined') touch.tiltY = 0;\n if (typeof touch.pointerType === 'undefined') touch.pointerType = 'touch';\n if (typeof touch.pointerId === 'undefined') touch.pointerId = touch.identifier || 0;\n if (typeof touch.pressure === 'undefined') touch.pressure = touch.force || 0.5;\n touch.twist = 0;\n touch.tangentialPressure = 0;\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined') touch.layerX = touch.offsetX = touch.clientX;\n if (typeof touch.layerY === 'undefined') touch.layerY = touch.offsetY = touch.clientY;\n\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent))) {\n if (typeof event.isPrimary === 'undefined') event.isPrimary = true;\n if (typeof event.width === 'undefined') event.width = 1;\n if (typeof event.height === 'undefined') event.height = 1;\n if (typeof event.tiltX === 'undefined') event.tiltX = 0;\n if (typeof event.tiltY === 'undefined') event.tiltY = 0;\n if (typeof event.pointerType === 'undefined') event.pointerType = 'mouse';\n if (typeof event.pointerId === 'undefined') event.pointerId = MOUSE_POINTER_ID;\n if (typeof event.pressure === 'undefined') event.pressure = 0.5;\n event.twist = 0;\n event.tangentialPressure = 0;\n\n // mark the mouse event as normalized, just so that we know we did it\n event.isNormalized = true;\n\n normalizedEvents.push(event);\n } else {\n normalizedEvents.push(event);\n }\n\n return normalizedEvents;\n };\n\n /**\n * Destroys the interaction manager\n *\n */\n\n\n InteractionManager.prototype.destroy = function destroy() {\n this.removeEvents();\n\n this.removeAllListeners();\n\n this.renderer = null;\n\n this.mouse = null;\n\n this.eventData = null;\n\n this.interactionDOMElement = null;\n\n this.onPointerDown = null;\n this.processPointerDown = null;\n\n this.onPointerUp = null;\n this.processPointerUp = null;\n\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n\n this.onPointerMove = null;\n this.processPointerMove = null;\n\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n\n this.onPointerOver = null;\n\n this._tempPoint = null;\n };\n\n return InteractionManager;\n}(_eventemitter2.default);\n\nexports.default = InteractionManager;\n\n\ncore.WebGLRenderer.registerPlugin('interaction', InteractionManager);\ncore.CanvasRenderer.registerPlugin('interaction', InteractionManager);\n//# sourceMappingURL=InteractionManager.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/InteractionManager.js\n// module id = 581\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _InteractionData = require('./InteractionData');\n\nObject.defineProperty(exports, 'InteractionData', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionData).default;\n }\n});\n\nvar _InteractionManager = require('./InteractionManager');\n\nObject.defineProperty(exports, 'InteractionManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionManager).default;\n }\n});\n\nvar _interactiveTarget = require('./interactiveTarget');\n\nObject.defineProperty(exports, 'interactiveTarget', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_interactiveTarget).default;\n }\n});\n\nvar _InteractionTrackingData = require('./InteractionTrackingData');\n\nObject.defineProperty(exports, 'InteractionTrackingData', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionTrackingData).default;\n }\n});\n\nvar _InteractionEvent = require('./InteractionEvent');\n\nObject.defineProperty(exports, 'InteractionEvent', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InteractionEvent).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/interaction/index.js\n// module id = 582\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\nexports.shared = exports.Resource = exports.textureParser = exports.getResourcePath = exports.spritesheetParser = exports.parseBitmapFontData = exports.bitmapFontParser = exports.Loader = undefined;\n\nvar _bitmapFontParser = require('./bitmapFontParser');\n\nObject.defineProperty(exports, 'bitmapFontParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_bitmapFontParser).default;\n }\n});\nObject.defineProperty(exports, 'parseBitmapFontData', {\n enumerable: true,\n get: function get() {\n return _bitmapFontParser.parse;\n }\n});\n\nvar _spritesheetParser = require('./spritesheetParser');\n\nObject.defineProperty(exports, 'spritesheetParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_spritesheetParser).default;\n }\n});\nObject.defineProperty(exports, 'getResourcePath', {\n enumerable: true,\n get: function get() {\n return _spritesheetParser.getResourcePath;\n }\n});\n\nvar _textureParser = require('./textureParser');\n\nObject.defineProperty(exports, 'textureParser', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_textureParser).default;\n }\n});\n\nvar _resourceLoader = require('resource-loader');\n\nObject.defineProperty(exports, 'Resource', {\n enumerable: true,\n get: function get() {\n return _resourceLoader.Resource;\n }\n});\n\nvar _Application = require('../core/Application');\n\nvar _Application2 = _interopRequireDefault(_Application);\n\nvar _loader = require('./loader');\n\nvar _loader2 = _interopRequireDefault(_loader);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * This namespace contains APIs which extends the {@link https://github.com/englercj/resource-loader resource-loader} module\n * for loading assets, data, and other resources dynamically.\n * @example\n * const loader = new PIXI.loaders.Loader();\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.load((loader, resources) => {\n * // resources.bunny\n * // resources.spaceship\n * });\n * @namespace PIXI.loaders\n */\nexports.Loader = _loader2.default;\n\n\n/**\n * A premade instance of the loader that can be used to load resources.\n * @name shared\n * @memberof PIXI.loaders\n * @type {PIXI.loaders.Loader}\n */\nvar shared = new _loader2.default();\n\nshared.destroy = function () {\n // protect destroying shared loader\n};\n\nexports.shared = shared;\n\n// Mixin the loader construction\n\nvar AppPrototype = _Application2.default.prototype;\n\nAppPrototype._loader = null;\n\n/**\n * Loader instance to help with asset loading.\n * @name PIXI.Application#loader\n * @type {PIXI.loaders.Loader}\n */\nObject.defineProperty(AppPrototype, 'loader', {\n get: function get() {\n if (!this._loader) {\n var sharedLoader = this._options.sharedLoader;\n\n this._loader = sharedLoader ? shared : new _loader2.default();\n }\n\n return this._loader;\n }\n});\n\n// Override the destroy function\n// making sure to destroy the current Loader\nAppPrototype._parentDestroy = AppPrototype.destroy;\nAppPrototype.destroy = function destroy(removeView) {\n if (this._loader) {\n this._loader.destroy();\n this._loader = null;\n }\n this._parentDestroy(removeView);\n};\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/index.js\n// module id = 583\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _resourceLoader = require('resource-loader');\n\nvar _resourceLoader2 = _interopRequireDefault(_resourceLoader);\n\nvar _blob = require('resource-loader/lib/middlewares/parsing/blob');\n\nvar _eventemitter = require('eventemitter3');\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _textureParser = require('./textureParser');\n\nvar _textureParser2 = _interopRequireDefault(_textureParser);\n\nvar _spritesheetParser = require('./spritesheetParser');\n\nvar _spritesheetParser2 = _interopRequireDefault(_spritesheetParser);\n\nvar _bitmapFontParser = require('./bitmapFontParser');\n\nvar _bitmapFontParser2 = _interopRequireDefault(_bitmapFontParser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n *\n * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader\n *\n * ```js\n * const loader = PIXI.loader; // PixiJS exposes a premade instance for you to use.\n * //or\n * const loader = new PIXI.loaders.Loader(); // you can also create your own if you want\n *\n * const sprites = {};\n *\n * // Chainable `add` to enqueue a resource\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.\n * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).\n * loader.pre(cachingMiddleware);\n *\n * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.\n * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).\n * loader.use(parsingMiddleware);\n *\n * // The `load` method loads the queue of resources, and calls the passed in callback called once all\n * // resources have loaded.\n * loader.load((loader, resources) => {\n * // resources is an object where the key is the name of the resource loaded and the value is the resource object.\n * // They have a couple default properties:\n * // - `url`: The URL that the resource was loaded from\n * // - `error`: The error that happened when trying to load (if any)\n * // - `data`: The raw data that was loaded\n * // also may contain other properties based on the middleware that runs.\n * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);\n * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);\n * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);\n * });\n *\n * // throughout the process multiple signals can be dispatched.\n * loader.onProgress.add(() => {}); // called once per loaded/errored file\n * loader.onError.add(() => {}); // called once per errored file\n * loader.onLoad.add(() => {}); // called once per loaded file\n * loader.onComplete.add(() => {}); // called once when the queued resources all load.\n * ```\n *\n * @see https://github.com/englercj/resource-loader\n *\n * @class\n * @extends module:resource-loader.ResourceLoader\n * @memberof PIXI.loaders\n */\nvar Loader = function (_ResourceLoader) {\n _inherits(Loader, _ResourceLoader);\n\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n _classCallCheck(this, Loader);\n\n var _this = _possibleConstructorReturn(this, _ResourceLoader.call(this, baseUrl, concurrency));\n\n _eventemitter2.default.call(_this);\n\n for (var i = 0; i < Loader._pixiMiddleware.length; ++i) {\n _this.use(Loader._pixiMiddleware[i]());\n }\n\n // Compat layer, translate the new v2 signals into old v1 events.\n _this.onStart.add(function (l) {\n return _this.emit('start', l);\n });\n _this.onProgress.add(function (l, r) {\n return _this.emit('progress', l, r);\n });\n _this.onError.add(function (e, l, r) {\n return _this.emit('error', e, l, r);\n });\n _this.onLoad.add(function (l, r) {\n return _this.emit('load', l, r);\n });\n _this.onComplete.add(function (l, r) {\n return _this.emit('complete', l, r);\n });\n return _this;\n }\n\n /**\n * Adds a default middleware to the PixiJS loader.\n *\n * @static\n * @param {Function} fn - The middleware to add.\n */\n\n\n Loader.addPixiMiddleware = function addPixiMiddleware(fn) {\n Loader._pixiMiddleware.push(fn);\n };\n\n /**\n * Destroy the loader, removes references.\n */\n\n\n Loader.prototype.destroy = function destroy() {\n this.removeAllListeners();\n this.reset();\n };\n\n return Loader;\n}(_resourceLoader2.default);\n\n// Copy EE3 prototype (mixin)\n\n\nexports.default = Loader;\nfor (var k in _eventemitter2.default.prototype) {\n Loader.prototype[k] = _eventemitter2.default.prototype[k];\n}\n\nLoader._pixiMiddleware = [\n// parse any blob into more usable objects (e.g. Image)\n_blob.blobMiddlewareFactory,\n// parse any Image objects into textures\n_textureParser2.default,\n// parse any spritesheet data into multiple textures\n_spritesheetParser2.default,\n// parse bitmap font data into multiple textures\n_bitmapFontParser2.default];\n\n// Add custom extentions\nvar Resource = _resourceLoader2.default.Resource;\n\nResource.setExtensionXhrType('fnt', Resource.XHR_RESPONSE_TYPE.DOCUMENT);\n//# sourceMappingURL=loader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/loaders/loader.js\n// module id = 584\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _Plane2 = require('./Plane');\n\nvar _Plane3 = _interopRequireDefault(_Plane2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DEFAULT_BORDER_SIZE = 10;\n\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.fromImage('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n *
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n *\n * @class\n * @extends PIXI.mesh.Plane\n * @memberof PIXI.mesh\n *\n */\n\nvar NineSlicePlane = function (_Plane) {\n _inherits(NineSlicePlane, _Plane);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the NineSlicePlane.\n * @param {int} [leftWidth=10] size of the left vertical bar (A)\n * @param {int} [topHeight=10] size of the top horizontal bar (C)\n * @param {int} [rightWidth=10] size of the right vertical bar (B)\n * @param {int} [bottomHeight=10] size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n _classCallCheck(this, NineSlicePlane);\n\n var _this = _possibleConstructorReturn(this, _Plane.call(this, texture, 4, 4));\n\n _this._origWidth = texture.orig.width;\n _this._origHeight = texture.orig.height;\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this._width = _this._origWidth;\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this._height = _this._origHeight;\n\n /**\n * The width of the left column (a)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.leftWidth = typeof leftWidth !== 'undefined' ? leftWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The width of the right column (b)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.rightWidth = typeof rightWidth !== 'undefined' ? rightWidth : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the top row (c)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.topHeight = typeof topHeight !== 'undefined' ? topHeight : DEFAULT_BORDER_SIZE;\n\n /**\n * The height of the bottom row (d)\n *\n * @member {number}\n * @memberof PIXI.NineSlicePlane#\n * @override\n */\n _this.bottomHeight = typeof bottomHeight !== 'undefined' ? bottomHeight : DEFAULT_BORDER_SIZE;\n\n _this.refresh(true);\n return _this;\n }\n\n /**\n * Updates the horizontal vertices.\n *\n */\n\n\n NineSlicePlane.prototype.updateHorizontalVertices = function updateHorizontalVertices() {\n var vertices = this.vertices;\n\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - this._bottomHeight;\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n\n /**\n * Updates the vertical vertices.\n *\n */\n\n\n NineSlicePlane.prototype.updateVerticalVertices = function updateVerticalVertices() {\n var vertices = this.vertices;\n\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - this._rightWidth;\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer to render with.\n */\n\n\n NineSlicePlane.prototype._renderCanvas = function _renderCanvas(renderer) {\n var context = renderer.context;\n\n context.globalAlpha = this.worldAlpha;\n\n var transform = this.worldTransform;\n var res = renderer.resolution;\n\n if (renderer.roundPixels) {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res | 0, transform.ty * res | 0);\n } else {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res, transform.ty * res);\n }\n\n var base = this._texture.baseTexture;\n var textureSource = base.source;\n var w = base.width;\n var h = base.height;\n\n this.drawSegment(context, textureSource, w, h, 0, 1, 10, 11);\n this.drawSegment(context, textureSource, w, h, 2, 3, 12, 13);\n this.drawSegment(context, textureSource, w, h, 4, 5, 14, 15);\n this.drawSegment(context, textureSource, w, h, 8, 9, 18, 19);\n this.drawSegment(context, textureSource, w, h, 10, 11, 20, 21);\n this.drawSegment(context, textureSource, w, h, 12, 13, 22, 23);\n this.drawSegment(context, textureSource, w, h, 16, 17, 26, 27);\n this.drawSegment(context, textureSource, w, h, 18, 19, 28, 29);\n this.drawSegment(context, textureSource, w, h, 20, 21, 30, 31);\n };\n\n /**\n * Renders one segment of the plane.\n * to mimic the exact drawing behavior of stretching the image like WebGL does, we need to make sure\n * that the source area is at least 1 pixel in size, otherwise nothing gets drawn when a slice size of 0 is used.\n *\n * @private\n * @param {CanvasRenderingContext2D} context - The context to draw with.\n * @param {CanvasImageSource} textureSource - The source to draw.\n * @param {number} w - width of the texture\n * @param {number} h - height of the texture\n * @param {number} x1 - x index 1\n * @param {number} y1 - y index 1\n * @param {number} x2 - x index 2\n * @param {number} y2 - y index 2\n */\n\n\n NineSlicePlane.prototype.drawSegment = function drawSegment(context, textureSource, w, h, x1, y1, x2, y2) {\n // otherwise you get weird results when using slices of that are 0 wide or high.\n var uvs = this.uvs;\n var vertices = this.vertices;\n\n var sw = (uvs[x2] - uvs[x1]) * w;\n var sh = (uvs[y2] - uvs[y1]) * h;\n var dw = vertices[x2] - vertices[x1];\n var dh = vertices[y2] - vertices[y1];\n\n // make sure the source is at least 1 pixel wide and high, otherwise nothing will be drawn.\n if (sw < 1) {\n sw = 1;\n }\n\n if (sh < 1) {\n sh = 1;\n }\n\n // make sure destination is at least 1 pixel wide and high, otherwise you get\n // lines when rendering close to original size.\n if (dw < 1) {\n dw = 1;\n }\n\n if (dh < 1) {\n dh = 1;\n }\n\n context.drawImage(textureSource, uvs[x1] * w, uvs[y1] * h, sw, sh, vertices[x1], vertices[y1], dw, dh);\n };\n\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n\n\n /**\n * Refreshes NineSlicePlane coords. All of them.\n */\n NineSlicePlane.prototype._refresh = function _refresh() {\n _Plane.prototype._refresh.call(this);\n\n var uvs = this.uvs;\n var texture = this._texture;\n\n this._origWidth = texture.orig.width;\n this._origHeight = texture.orig.height;\n\n var _uvw = 1.0 / this._origWidth;\n var _uvh = 1.0 / this._origHeight;\n\n uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0;\n uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0;\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - _uvw * this._rightWidth;\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - _uvh * this._bottomHeight;\n\n this.updateHorizontalVertices();\n this.updateVerticalVertices();\n\n this.dirty++;\n\n this.multiplyUvs();\n };\n\n _createClass(NineSlicePlane, [{\n key: 'width',\n get: function get() {\n return this._width;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._width = value;\n this._refresh();\n }\n\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n\n }, {\n key: 'height',\n get: function get() {\n return this._height;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._height = value;\n this._refresh();\n }\n\n /**\n * The width of the left column\n *\n * @member {number}\n */\n\n }, {\n key: 'leftWidth',\n get: function get() {\n return this._leftWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._leftWidth = value;\n this._refresh();\n }\n\n /**\n * The width of the right column\n *\n * @member {number}\n */\n\n }, {\n key: 'rightWidth',\n get: function get() {\n return this._rightWidth;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._rightWidth = value;\n this._refresh();\n }\n\n /**\n * The height of the top row\n *\n * @member {number}\n */\n\n }, {\n key: 'topHeight',\n get: function get() {\n return this._topHeight;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._topHeight = value;\n this._refresh();\n }\n\n /**\n * The height of the bottom row\n *\n * @member {number}\n */\n\n }, {\n key: 'bottomHeight',\n get: function get() {\n return this._bottomHeight;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._bottomHeight = value;\n this._refresh();\n }\n }]);\n\n return NineSlicePlane;\n}(_Plane3.default);\n\nexports.default = NineSlicePlane;\n//# sourceMappingURL=NineSlicePlane.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/NineSlicePlane.js\n// module id = 585\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh2 = require('./Mesh');\n\nvar _Mesh3 = _interopRequireDefault(_Mesh2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The rope allows you to draw a texture across several points and them manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.Rope(PIXI.Texture.fromImage(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.mesh.Mesh\n * @memberof PIXI.mesh\n *\n */\nvar Rope = function (_Mesh) {\n _inherits(Rope, _Mesh);\n\n /**\n * @param {PIXI.Texture} texture - The texture to use on the rope.\n * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope.\n */\n function Rope(texture, points) {\n _classCallCheck(this, Rope);\n\n /**\n * An array of points that determine the rope\n *\n * @member {PIXI.Point[]}\n */\n var _this = _possibleConstructorReturn(this, _Mesh.call(this, texture));\n\n _this.points = points;\n\n /**\n * An array of vertices used to construct this rope.\n *\n * @member {Float32Array}\n */\n _this.vertices = new Float32Array(points.length * 4);\n\n /**\n * The WebGL Uvs of the rope.\n *\n * @member {Float32Array}\n */\n _this.uvs = new Float32Array(points.length * 4);\n\n /**\n * An array containing the color components\n *\n * @member {Float32Array}\n */\n _this.colors = new Float32Array(points.length * 2);\n\n /**\n * An array containing the indices of the vertices\n *\n * @member {Uint16Array}\n */\n _this.indices = new Uint16Array(points.length * 2);\n\n /**\n * refreshes vertices on every updateTransform\n * @member {boolean}\n * @default true\n */\n _this.autoUpdate = true;\n\n _this.refresh();\n return _this;\n }\n\n /**\n * Refreshes\n *\n */\n\n\n Rope.prototype._refresh = function _refresh() {\n var points = this.points;\n\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1 || !this._texture._uvs) {\n return;\n }\n\n // if the number of points has changed we will need to recreate the arraybuffers\n if (this.vertices.length / 4 !== points.length) {\n this.vertices = new Float32Array(points.length * 4);\n this.uvs = new Float32Array(points.length * 4);\n this.colors = new Float32Array(points.length * 2);\n this.indices = new Uint16Array(points.length * 2);\n }\n\n var uvs = this.uvs;\n\n var indices = this.indices;\n var colors = this.colors;\n\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n\n colors[0] = 1;\n colors[1] = 1;\n\n indices[0] = 0;\n indices[1] = 1;\n\n var total = points.length;\n\n for (var i = 1; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n var amount = i / (total - 1);\n\n uvs[index] = amount;\n uvs[index + 1] = 0;\n\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n\n index = i * 2;\n colors[index] = 1;\n colors[index + 1] = 1;\n\n index = i * 2;\n indices[index] = index;\n indices[index + 1] = index + 1;\n }\n\n // ensure that the changes are uploaded\n this.dirty++;\n this.indexDirty++;\n\n this.multiplyUvs();\n this.refreshVertices();\n };\n\n /**\n * refreshes vertices of Rope mesh\n */\n\n\n Rope.prototype.refreshVertices = function refreshVertices() {\n var points = this.points;\n\n if (points.length < 1) {\n return;\n }\n\n var lastPoint = points[0];\n var nextPoint = void 0;\n var perpX = 0;\n var perpY = 0;\n\n // this.count -= 0.2;\n\n var vertices = this.vertices;\n var total = points.length;\n\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n } else {\n nextPoint = point;\n }\n\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n\n var ratio = (1 - i / (total - 1)) * 10;\n\n if (ratio > 1) {\n ratio = 1;\n }\n\n var perpLength = Math.sqrt(perpX * perpX + perpY * perpY);\n var num = this._texture.height / 2; // (20 + Math.abs(Math.sin((i + this.count) * 0.3) * 50) )* ratio;\n\n perpX /= perpLength;\n perpY /= perpLength;\n\n perpX *= num;\n perpY *= num;\n\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n\n lastPoint = point;\n }\n };\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n\n\n Rope.prototype.updateTransform = function updateTransform() {\n if (this.autoUpdate) {\n this.refreshVertices();\n }\n this.containerUpdateTransform();\n };\n\n return Rope;\n}(_Mesh3.default);\n\nexports.default = Rope;\n//# sourceMappingURL=Rope.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/Rope.js\n// module id = 586\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _Mesh = require('../Mesh');\n\nvar _Mesh2 = _interopRequireDefault(_Mesh);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Renderer dedicated to meshes.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar MeshSpriteRenderer = function () {\n /**\n * @param {PIXI.CanvasRenderer} renderer - The renderer this downport works for\n */\n function MeshSpriteRenderer(renderer) {\n _classCallCheck(this, MeshSpriteRenderer);\n\n this.renderer = renderer;\n }\n\n /**\n * Renders the Mesh\n *\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype.render = function render(mesh) {\n var renderer = this.renderer;\n var context = renderer.context;\n\n var transform = mesh.worldTransform;\n var res = renderer.resolution;\n\n if (renderer.roundPixels) {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res | 0, transform.ty * res | 0);\n } else {\n context.setTransform(transform.a * res, transform.b * res, transform.c * res, transform.d * res, transform.tx * res, transform.ty * res);\n }\n\n renderer.setBlendMode(mesh.blendMode);\n\n if (mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH) {\n this._renderTriangleMesh(mesh);\n } else {\n this._renderTriangles(mesh);\n }\n };\n\n /**\n * Draws the object in Triangle Mesh mode\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype._renderTriangleMesh = function _renderTriangleMesh(mesh) {\n // draw triangles!!\n var length = mesh.vertices.length / 2;\n\n for (var i = 0; i < length - 2; i++) {\n // draw some triangles!\n var index = i * 2;\n\n this._renderDrawTriangle(mesh, index, index + 2, index + 4);\n }\n };\n\n /**\n * Draws the object in triangle mode using canvas\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n */\n\n\n MeshSpriteRenderer.prototype._renderTriangles = function _renderTriangles(mesh) {\n // draw triangles!!\n var indices = mesh.indices;\n var length = indices.length;\n\n for (var i = 0; i < length; i += 3) {\n // draw some triangles!\n var index0 = indices[i] * 2;\n var index1 = indices[i + 1] * 2;\n var index2 = indices[i + 2] * 2;\n\n this._renderDrawTriangle(mesh, index0, index1, index2);\n }\n };\n\n /**\n * Draws one of the triangles that from the Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - the current mesh\n * @param {number} index0 - the index of the first vertex\n * @param {number} index1 - the index of the second vertex\n * @param {number} index2 - the index of the third vertex\n */\n\n\n MeshSpriteRenderer.prototype._renderDrawTriangle = function _renderDrawTriangle(mesh, index0, index1, index2) {\n var context = this.renderer.context;\n var uvs = mesh.uvs;\n var vertices = mesh.vertices;\n var texture = mesh._texture;\n\n if (!texture.valid) {\n return;\n }\n\n var base = texture.baseTexture;\n var textureSource = base.source;\n var textureWidth = base.width;\n var textureHeight = base.height;\n\n var u0 = void 0;\n var u1 = void 0;\n var u2 = void 0;\n var v0 = void 0;\n var v1 = void 0;\n var v2 = void 0;\n\n if (mesh.uploadUvTransform) {\n var ut = mesh._uvTransform.mapCoord;\n\n u0 = (uvs[index0] * ut.a + uvs[index0 + 1] * ut.c + ut.tx) * base.width;\n u1 = (uvs[index1] * ut.a + uvs[index1 + 1] * ut.c + ut.tx) * base.width;\n u2 = (uvs[index2] * ut.a + uvs[index2 + 1] * ut.c + ut.tx) * base.width;\n v0 = (uvs[index0] * ut.b + uvs[index0 + 1] * ut.d + ut.ty) * base.height;\n v1 = (uvs[index1] * ut.b + uvs[index1 + 1] * ut.d + ut.ty) * base.height;\n v2 = (uvs[index2] * ut.b + uvs[index2 + 1] * ut.d + ut.ty) * base.height;\n } else {\n u0 = uvs[index0] * base.width;\n u1 = uvs[index1] * base.width;\n u2 = uvs[index2] * base.width;\n v0 = uvs[index0 + 1] * base.height;\n v1 = uvs[index1 + 1] * base.height;\n v2 = uvs[index2 + 1] * base.height;\n }\n\n var x0 = vertices[index0];\n var x1 = vertices[index1];\n var x2 = vertices[index2];\n var y0 = vertices[index0 + 1];\n var y1 = vertices[index1 + 1];\n var y2 = vertices[index2 + 1];\n\n if (mesh.canvasPadding > 0) {\n var paddingX = mesh.canvasPadding / mesh.worldTransform.a;\n var paddingY = mesh.canvasPadding / mesh.worldTransform.d;\n var centerX = (x0 + x1 + x2) / 3;\n var centerY = (y0 + y1 + y2) / 3;\n\n var normX = x0 - centerX;\n var normY = y0 - centerY;\n\n var dist = Math.sqrt(normX * normX + normY * normY);\n\n x0 = centerX + normX / dist * (dist + paddingX);\n y0 = centerY + normY / dist * (dist + paddingY);\n\n //\n\n normX = x1 - centerX;\n normY = y1 - centerY;\n\n dist = Math.sqrt(normX * normX + normY * normY);\n x1 = centerX + normX / dist * (dist + paddingX);\n y1 = centerY + normY / dist * (dist + paddingY);\n\n normX = x2 - centerX;\n normY = y2 - centerY;\n\n dist = Math.sqrt(normX * normX + normY * normY);\n x2 = centerX + normX / dist * (dist + paddingX);\n y2 = centerY + normY / dist * (dist + paddingY);\n }\n\n context.save();\n context.beginPath();\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n\n context.closePath();\n\n context.clip();\n\n // Compute matrix transform\n var delta = u0 * v1 + v0 * u2 + u1 * v2 - v1 * u2 - v0 * u1 - u0 * v2;\n var deltaA = x0 * v1 + v0 * x2 + x1 * v2 - v1 * x2 - v0 * x1 - x0 * v2;\n var deltaB = u0 * x1 + x0 * u2 + u1 * x2 - x1 * u2 - x0 * u1 - u0 * x2;\n var deltaC = u0 * v1 * x2 + v0 * x1 * u2 + x0 * u1 * v2 - x0 * v1 * u2 - v0 * u1 * x2 - u0 * x1 * v2;\n var deltaD = y0 * v1 + v0 * y2 + y1 * v2 - v1 * y2 - v0 * y1 - y0 * v2;\n var deltaE = u0 * y1 + y0 * u2 + u1 * y2 - y1 * u2 - y0 * u1 - u0 * y2;\n var deltaF = u0 * v1 * y2 + v0 * y1 * u2 + y0 * u1 * v2 - y0 * v1 * u2 - v0 * u1 * y2 - u0 * y1 * v2;\n\n context.transform(deltaA / delta, deltaD / delta, deltaB / delta, deltaE / delta, deltaC / delta, deltaF / delta);\n\n context.drawImage(textureSource, 0, 0, textureWidth * base.resolution, textureHeight * base.resolution, 0, 0, textureWidth, textureHeight);\n\n context.restore();\n this.renderer.invalidateBlendMode();\n };\n\n /**\n * Renders a flat Mesh\n *\n * @private\n * @param {PIXI.mesh.Mesh} mesh - The Mesh to render\n */\n\n\n MeshSpriteRenderer.prototype.renderMeshFlat = function renderMeshFlat(mesh) {\n var context = this.renderer.context;\n var vertices = mesh.vertices;\n var length = vertices.length / 2;\n\n // this.count++;\n\n context.beginPath();\n\n for (var i = 1; i < length - 2; ++i) {\n // draw some triangles!\n var index = i * 2;\n\n var x0 = vertices[index];\n var y0 = vertices[index + 1];\n\n var x1 = vertices[index + 2];\n var y1 = vertices[index + 3];\n\n var x2 = vertices[index + 4];\n var y2 = vertices[index + 5];\n\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n }\n\n context.fillStyle = '#FF0000';\n context.fill();\n context.closePath();\n };\n\n /**\n * destroy the the renderer.\n *\n */\n\n\n MeshSpriteRenderer.prototype.destroy = function destroy() {\n this.renderer = null;\n };\n\n return MeshSpriteRenderer;\n}();\n\nexports.default = MeshSpriteRenderer;\n\n\ncore.CanvasRenderer.registerPlugin('mesh', MeshSpriteRenderer);\n//# sourceMappingURL=CanvasMeshRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/canvas/CanvasMeshRenderer.js\n// module id = 587\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Mesh = require('./Mesh');\n\nObject.defineProperty(exports, 'Mesh', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Mesh).default;\n }\n});\n\nvar _MeshRenderer = require('./webgl/MeshRenderer');\n\nObject.defineProperty(exports, 'MeshRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_MeshRenderer).default;\n }\n});\n\nvar _CanvasMeshRenderer = require('./canvas/CanvasMeshRenderer');\n\nObject.defineProperty(exports, 'CanvasMeshRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasMeshRenderer).default;\n }\n});\n\nvar _Plane = require('./Plane');\n\nObject.defineProperty(exports, 'Plane', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Plane).default;\n }\n});\n\nvar _NineSlicePlane = require('./NineSlicePlane');\n\nObject.defineProperty(exports, 'NineSlicePlane', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NineSlicePlane).default;\n }\n});\n\nvar _Rope = require('./Rope');\n\nObject.defineProperty(exports, 'Rope', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Rope).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/index.js\n// module id = 588\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _Mesh = require('../Mesh');\n\nvar _Mesh2 = _interopRequireDefault(_Mesh);\n\nvar _path = require('path');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar matrixIdentity = core.Matrix.IDENTITY;\n\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\n\nvar MeshRenderer = function (_core$ObjectRenderer) {\n _inherits(MeshRenderer, _core$ObjectRenderer);\n\n /**\n * constructor for renderer\n *\n * @param {WebGLRenderer} renderer The renderer this tiling awesomeness works for.\n */\n function MeshRenderer(renderer) {\n _classCallCheck(this, MeshRenderer);\n\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n return _this;\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n MeshRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n', 'varying vec2 vTextureCoord;\\nuniform vec4 uColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\\n}\\n');\n };\n\n /**\n * renders mesh\n *\n * @param {PIXI.mesh.Mesh} mesh mesh instance\n */\n\n\n MeshRenderer.prototype.render = function render(mesh) {\n var renderer = this.renderer;\n var gl = renderer.gl;\n var texture = mesh._texture;\n\n if (!texture.valid) {\n return;\n }\n\n var glData = mesh._glDatas[renderer.CONTEXT_UID];\n\n if (!glData) {\n renderer.bindVao(null);\n\n glData = {\n shader: this.shader,\n vertexBuffer: _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, mesh.vertices, gl.STREAM_DRAW),\n uvBuffer: _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, mesh.uvs, gl.STREAM_DRAW),\n indexBuffer: _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, mesh.indices, gl.STATIC_DRAW),\n // build the vao object that will render..\n vao: null,\n dirty: mesh.dirty,\n indexDirty: mesh.indexDirty\n };\n\n // build the vao object that will render..\n glData.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(glData.indexBuffer).addAttribute(glData.vertexBuffer, glData.shader.attributes.aVertexPosition, gl.FLOAT, false, 2 * 4, 0).addAttribute(glData.uvBuffer, glData.shader.attributes.aTextureCoord, gl.FLOAT, false, 2 * 4, 0);\n\n mesh._glDatas[renderer.CONTEXT_UID] = glData;\n }\n\n renderer.bindVao(glData.vao);\n\n if (mesh.dirty !== glData.dirty) {\n glData.dirty = mesh.dirty;\n glData.uvBuffer.upload(mesh.uvs);\n }\n\n if (mesh.indexDirty !== glData.indexDirty) {\n glData.indexDirty = mesh.indexDirty;\n glData.indexBuffer.upload(mesh.indices);\n }\n\n glData.vertexBuffer.upload(mesh.vertices);\n\n renderer.bindShader(glData.shader);\n\n glData.shader.uniforms.uSampler = renderer.bindTexture(texture);\n\n renderer.state.setBlendMode(core.utils.correctBlendMode(mesh.blendMode, texture.baseTexture.premultipliedAlpha));\n\n if (glData.shader.uniforms.uTransform) {\n if (mesh.uploadUvTransform) {\n glData.shader.uniforms.uTransform = mesh._uvTransform.mapCoord.toArray(true);\n } else {\n glData.shader.uniforms.uTransform = matrixIdentity.toArray(true);\n }\n }\n glData.shader.uniforms.translationMatrix = mesh.worldTransform.toArray(true);\n\n glData.shader.uniforms.uColor = core.utils.premultiplyRgba(mesh.tintRgb, mesh.worldAlpha, glData.shader.uniforms.uColor, texture.baseTexture.premultipliedAlpha);\n\n var drawMode = mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH ? gl.TRIANGLE_STRIP : gl.TRIANGLES;\n\n glData.vao.draw(drawMode, mesh.indices.length, 0);\n };\n\n return MeshRenderer;\n}(core.ObjectRenderer);\n\nexports.default = MeshRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('mesh', MeshRenderer);\n//# sourceMappingURL=MeshRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/mesh/webgl/MeshRenderer.js\n// module id = 589\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _core = require('../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _utils = require('../core/utils');\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles. The tradeoff of the ParticleContainer is that advanced\n * functionality will not work. ParticleContainer implements only the basic object transform (position, scale, rotation).\n * Any other functionality like tinting, masking, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use :\n *\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = new PIXI.Sprite.fromImage(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be rendered at the speed of light.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI.particles\n */\nvar ParticleContainer = function (_core$Container) {\n _inherits(ParticleContainer, _core$Container);\n\n /**\n * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container.\n * Affects size of allocated buffers.\n * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied.\n * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead.\n * @param {boolean} [autoResize=true] If true, container allocates more batches in case\n * there are more than `maxSize` particles.\n */\n function ParticleContainer() {\n var maxSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1500;\n var properties = arguments[1];\n var batchSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 16384;\n var autoResize = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n _classCallCheck(this, ParticleContainer);\n\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var _this = _possibleConstructorReturn(this, _core$Container.call(this));\n\n var maxBatchSize = 16384;\n\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n\n if (batchSize > maxSize) {\n batchSize = maxSize;\n }\n\n /**\n * Set properties to be dynamic (true) / static (false)\n *\n * @member {boolean[]}\n * @private\n */\n _this._properties = [false, true, false, false, false];\n\n /**\n * @member {number}\n * @private\n */\n _this._maxSize = maxSize;\n\n /**\n * @member {number}\n * @private\n */\n _this._batchSize = batchSize;\n\n /**\n * @member {object}\n * @private\n */\n _this._glBuffers = {};\n\n /**\n * @member {number}\n * @private\n */\n _this._bufferToUpdate = 0;\n\n /**\n * @member {boolean}\n *\n */\n _this.interactiveChildren = false;\n\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`\n * to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = core.BLEND_MODES.NORMAL;\n\n /**\n * If true, container allocates more batches in case there are more than `maxSize` particles.\n * @member {boolean}\n * @default false\n */\n _this.autoResize = autoResize;\n\n /**\n * Used for canvas renderering. If true then the elements will be positioned at the\n * nearest pixel. This provides a nice speed boost.\n *\n * @member {boolean}\n * @default true;\n */\n _this.roundPixels = true;\n\n /**\n * The texture used to render the children.\n *\n * @readonly\n * @member {BaseTexture}\n */\n _this.baseTexture = null;\n\n _this.setProperties(properties);\n\n /**\n * The tint applied to the container.\n * This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = 0;\n _this.tintRgb = new Float32Array(4);\n _this.tint = 0xFFFFFF;\n return _this;\n }\n\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n *\n * @param {object} properties - The properties to be uploaded\n */\n\n\n ParticleContainer.prototype.setProperties = function setProperties(properties) {\n if (properties) {\n this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'alpha' in properties || 'tint' in properties ? !!properties.alpha || !!properties.tint : this._properties[4];\n }\n };\n\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n\n\n ParticleContainer.prototype.updateTransform = function updateTransform() {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n // PIXI.Container.prototype.updateTransform.call( this );\n };\n\n /**\n * The tint applied to the container. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n ** IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\n * @member {number}\n * @default 0xFFFFFF\n */\n\n\n /**\n * Renders the container using the WebGL renderer\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - The webgl renderer\n */\n ParticleContainer.prototype.renderWebGL = function renderWebGL(renderer) {\n var _this2 = this;\n\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.hasLoaded) {\n this.baseTexture.once('update', function () {\n return _this2.onChildrenChange(0);\n });\n }\n }\n\n renderer.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n\n /**\n * Set the flag that static data should be updated to true\n *\n * @private\n * @param {number} smallestChildIndex - The smallest child index\n */\n\n\n ParticleContainer.prototype.onChildrenChange = function onChildrenChange(smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n\n if (bufferIndex < this._bufferToUpdate) {\n this._bufferToUpdate = bufferIndex;\n }\n };\n\n /**\n * Renders the object using the Canvas renderer\n *\n * @private\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\n\n\n ParticleContainer.prototype.renderCanvas = function renderCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n\n var context = renderer.context;\n var transform = this.worldTransform;\n var isRotated = true;\n\n var positionX = 0;\n var positionY = 0;\n\n var finalWidth = 0;\n var finalHeight = 0;\n\n renderer.setBlendMode(this.blendMode);\n\n context.globalAlpha = this.worldAlpha;\n\n this.displayObjectUpdateTransform();\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i];\n\n if (!child.visible) {\n continue;\n }\n\n var frame = child._texture.frame;\n\n context.globalAlpha = this.worldAlpha * child.alpha;\n\n if (child.rotation % (Math.PI * 2) === 0) {\n // this is the fastest way to optimise! - if rotation is 0 then we can avoid any kind of setTransform call\n if (isRotated) {\n context.setTransform(transform.a, transform.b, transform.c, transform.d, transform.tx * renderer.resolution, transform.ty * renderer.resolution);\n\n isRotated = false;\n }\n\n positionX = child.anchor.x * (-frame.width * child.scale.x) + child.position.x + 0.5;\n positionY = child.anchor.y * (-frame.height * child.scale.y) + child.position.y + 0.5;\n\n finalWidth = frame.width * child.scale.x;\n finalHeight = frame.height * child.scale.y;\n } else {\n if (!isRotated) {\n isRotated = true;\n }\n\n child.displayObjectUpdateTransform();\n\n var childTransform = child.worldTransform;\n\n if (renderer.roundPixels) {\n context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx * renderer.resolution | 0, childTransform.ty * renderer.resolution | 0);\n } else {\n context.setTransform(childTransform.a, childTransform.b, childTransform.c, childTransform.d, childTransform.tx * renderer.resolution, childTransform.ty * renderer.resolution);\n }\n\n positionX = child.anchor.x * -frame.width + 0.5;\n positionY = child.anchor.y * -frame.height + 0.5;\n\n finalWidth = frame.width;\n finalHeight = frame.height;\n }\n\n var resolution = child._texture.baseTexture.resolution;\n\n context.drawImage(child._texture.baseTexture.source, frame.x * resolution, frame.y * resolution, frame.width * resolution, frame.height * resolution, positionX * renderer.resolution, positionY * renderer.resolution, finalWidth * renderer.resolution, finalHeight * renderer.resolution);\n }\n };\n\n /**\n * Destroys the container\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n\n\n ParticleContainer.prototype.destroy = function destroy(options) {\n _core$Container.prototype.destroy.call(this, options);\n\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n }\n\n this._properties = null;\n this._buffers = null;\n };\n\n _createClass(ParticleContainer, [{\n key: 'tint',\n get: function get() {\n return this._tint;\n },\n set: function set(value) // eslint-disable-line require-jsdoc\n {\n this._tint = value;\n (0, _utils.hex2rgb)(value, this.tintRgb);\n }\n }]);\n\n return ParticleContainer;\n}(core.Container);\n\nexports.default = ParticleContainer;\n//# sourceMappingURL=ParticleContainer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/ParticleContainer.js\n// module id = 590\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _ParticleContainer = require('./ParticleContainer');\n\nObject.defineProperty(exports, 'ParticleContainer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ParticleContainer).default;\n }\n});\n\nvar _ParticleRenderer = require('./webgl/ParticleRenderer');\n\nObject.defineProperty(exports, 'ParticleRenderer', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ParticleRenderer).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/index.js\n// module id = 591\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _pixiGlCore = require('pixi-gl-core');\n\nvar _pixiGlCore2 = _interopRequireDefault(_pixiGlCore);\n\nvar _createIndicesForQuads = require('../../core/utils/createIndicesForQuads');\n\nvar _createIndicesForQuads2 = _interopRequireDefault(_createIndicesForQuads);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = function () {\n /**\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(gl, properties, dynamicPropertyFlags, size) {\n _classCallCheck(this, ParticleBuffer);\n\n /**\n * The current WebGL drawing context.\n *\n * @member {WebGLRenderingContext}\n */\n this.gl = gl;\n\n /**\n * The number of particles the buffer can hold\n *\n * @member {number}\n */\n this.size = size;\n\n /**\n * A list of the properties that are dynamic.\n *\n * @member {object[]}\n */\n this.dynamicProperties = [];\n\n /**\n * A list of the properties that are static.\n *\n * @member {object[]}\n */\n this.staticProperties = [];\n\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attribute: property.attribute,\n size: property.size,\n uploadFunction: property.uploadFunction,\n unsignedByte: property.unsignedByte,\n offset: property.offset\n };\n\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n } else {\n this.staticProperties.push(property);\n }\n }\n\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n\n this.initBuffers();\n }\n\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n\n\n ParticleBuffer.prototype.initBuffers = function initBuffers() {\n var gl = this.gl;\n var dynamicOffset = 0;\n\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n */\n this.indices = (0, _createIndicesForQuads2.default)(this.size);\n this.indexBuffer = _pixiGlCore2.default.GLBuffer.createIndexBuffer(gl, this.indices, gl.STATIC_DRAW);\n\n this.dynamicStride = 0;\n\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, dynBuffer, gl.STREAM_DRAW);\n\n // static //\n var staticOffset = 0;\n\n this.staticStride = 0;\n\n for (var _i = 0; _i < this.staticProperties.length; ++_i) {\n var _property = this.staticProperties[_i];\n\n _property.offset = staticOffset;\n staticOffset += _property.size;\n this.staticStride += _property.size;\n }\n\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = _pixiGlCore2.default.GLBuffer.createVertexBuffer(gl, statBuffer, gl.STATIC_DRAW);\n\n this.vao = new _pixiGlCore2.default.VertexArrayObject(gl).addIndex(this.indexBuffer);\n\n for (var _i2 = 0; _i2 < this.dynamicProperties.length; ++_i2) {\n var _property2 = this.dynamicProperties[_i2];\n\n if (_property2.unsignedByte) {\n this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.UNSIGNED_BYTE, true, this.dynamicStride * 4, _property2.offset * 4);\n } else {\n this.vao.addAttribute(this.dynamicBuffer, _property2.attribute, gl.FLOAT, false, this.dynamicStride * 4, _property2.offset * 4);\n }\n }\n\n for (var _i3 = 0; _i3 < this.staticProperties.length; ++_i3) {\n var _property3 = this.staticProperties[_i3];\n\n if (_property3.unsignedByte) {\n this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.UNSIGNED_BYTE, true, this.staticStride * 4, _property3.offset * 4);\n } else {\n this.vao.addAttribute(this.staticBuffer, _property3.attribute, gl.FLOAT, false, this.staticStride * 4, _property3.offset * 4);\n }\n }\n };\n\n /**\n * Uploads the dynamic properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n\n\n ParticleBuffer.prototype.uploadDynamic = function uploadDynamic(children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n\n property.uploadFunction(children, startIndex, amount, property.unsignedByte ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset);\n }\n\n this.dynamicBuffer.upload();\n };\n\n /**\n * Uploads the static properties.\n *\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n\n\n ParticleBuffer.prototype.uploadStatic = function uploadStatic(children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n\n property.uploadFunction(children, startIndex, amount, property.unsignedByte ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset);\n }\n\n this.staticBuffer.upload();\n };\n\n /**\n * Destroys the ParticleBuffer.\n *\n */\n\n\n ParticleBuffer.prototype.destroy = function destroy() {\n this.dynamicProperties = null;\n this.dynamicData = null;\n this.dynamicBuffer.destroy();\n\n this.staticProperties = null;\n this.staticData = null;\n this.staticBuffer.destroy();\n };\n\n return ParticleBuffer;\n}();\n\nexports.default = ParticleBuffer;\n//# sourceMappingURL=ParticleBuffer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/webgl/ParticleBuffer.js\n// module id = 592\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _ParticleShader = require('./ParticleShader');\n\nvar _ParticleShader2 = _interopRequireDefault(_ParticleShader);\n\nvar _ParticleBuffer = require('./ParticleBuffer');\n\nvar _ParticleBuffer2 = _interopRequireDefault(_ParticleBuffer);\n\nvar _utils = require('../../core/utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n\n/**\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleRenderer = function (_core$ObjectRenderer) {\n _inherits(ParticleRenderer, _core$ObjectRenderer);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n _classCallCheck(this, ParticleRenderer);\n\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n\n /**\n * The default shader that is used if a sprite doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n var _this = _possibleConstructorReturn(this, _core$ObjectRenderer.call(this, renderer));\n\n _this.shader = null;\n\n _this.indexBuffer = null;\n\n _this.properties = null;\n\n _this.tempMatrix = new core.Matrix();\n\n _this.CONTEXT_UID = 0;\n return _this;\n }\n\n /**\n * When there is a WebGL context change\n *\n * @private\n */\n\n\n ParticleRenderer.prototype.onContextChange = function onContextChange() {\n var gl = this.renderer.gl;\n\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n\n // setup default shader\n this.shader = new _ParticleShader2.default(gl);\n\n this.properties = [\n // verticesData\n {\n attribute: this.shader.attributes.aVertexPosition,\n size: 2,\n uploadFunction: this.uploadVertices,\n offset: 0\n },\n // positionData\n {\n attribute: this.shader.attributes.aPositionCoord,\n size: 2,\n uploadFunction: this.uploadPosition,\n offset: 0\n },\n // rotationData\n {\n attribute: this.shader.attributes.aRotation,\n size: 1,\n uploadFunction: this.uploadRotation,\n offset: 0\n },\n // uvsData\n {\n attribute: this.shader.attributes.aTextureCoord,\n size: 2,\n uploadFunction: this.uploadUvs,\n offset: 0\n },\n // tintData\n {\n attribute: this.shader.attributes.aColor,\n size: 1,\n unsignedByte: true,\n uploadFunction: this.uploadTint,\n offset: 0\n }];\n };\n\n /**\n * Starts a new particle batch.\n *\n */\n\n\n ParticleRenderer.prototype.start = function start() {\n this.renderer.bindShader(this.shader);\n };\n\n /**\n * Renders the particle container object.\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n */\n\n\n ParticleRenderer.prototype.render = function render(container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n\n if (totalChildren === 0) {\n return;\n } else if (totalChildren > maxSize) {\n totalChildren = maxSize;\n }\n\n var buffers = container._glBuffers[renderer.CONTEXT_UID];\n\n if (!buffers) {\n buffers = container._glBuffers[renderer.CONTEXT_UID] = this.generateBuffers(container);\n }\n\n var baseTexture = children[0]._texture.baseTexture;\n\n // if the uvs have not updated then no point rendering just yet!\n this.renderer.setBlendMode(core.utils.correctBlendMode(container.blendMode, baseTexture.premultipliedAlpha));\n\n var gl = renderer.gl;\n\n var m = container.worldTransform.copy(this.tempMatrix);\n\n m.prepend(renderer._activeRenderTarget.projectionMatrix);\n\n this.shader.uniforms.projectionMatrix = m.toArray(true);\n\n this.shader.uniforms.uColor = core.utils.premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultipliedAlpha);\n\n // make sure the texture is bound..\n this.shader.uniforms.uSampler = renderer.bindTexture(baseTexture);\n\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = totalChildren - i;\n\n if (amount > batchSize) {\n amount = batchSize;\n }\n\n if (j >= buffers.length) {\n if (!container.autoResize) {\n break;\n }\n buffers.push(this._generateOneMoreBuffer(container));\n }\n\n var buffer = buffers[j];\n\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n\n // we only upload the static content when we have to!\n if (container._bufferToUpdate === j) {\n buffer.uploadStatic(children, i, amount);\n container._bufferToUpdate = j + 1;\n }\n\n // bind the buffer\n renderer.bindVao(buffer.vao);\n buffer.vao.draw(gl.TRIANGLES, amount * 6);\n }\n };\n\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer[]} The buffers\n */\n\n\n ParticleRenderer.prototype.generateBuffers = function generateBuffers(container) {\n var gl = this.renderer.gl;\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new _ParticleBuffer2.default(gl, this.properties, dynamicPropertyFlags, batchSize));\n }\n\n return buffers;\n };\n\n /**\n * Creates one more particle buffer, because container has autoResize feature\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer} generated buffer\n * @private\n */\n\n\n ParticleRenderer.prototype._generateOneMoreBuffer = function _generateOneMoreBuffer(container) {\n var gl = this.renderer.gl;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n\n return new _ParticleBuffer2.default(gl, this.properties, dynamicPropertyFlags, batchSize);\n };\n\n /**\n * Uploads the verticies.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their vertices uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadVertices = function uploadVertices(children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - sprite.anchor.x * orig.width;\n w0 = w1 + trim.width;\n\n h1 = trim.y - sprite.anchor.y * orig.height;\n h0 = h1 + trim.height;\n } else {\n w0 = orig.width * (1 - sprite.anchor.x);\n w1 = orig.width * -sprite.anchor.x;\n\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n\n array[offset + stride * 2] = w0 * sx;\n array[offset + stride * 2 + 1] = h0 * sy;\n\n array[offset + stride * 3] = w1 * sx;\n array[offset + stride * 3 + 1] = h0 * sy;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their positions uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadPosition = function uploadPosition(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n\n array[offset + stride * 2] = spritePosition.x;\n array[offset + stride * 2 + 1] = spritePosition.y;\n\n array[offset + stride * 3] = spritePosition.x;\n array[offset + stride * 3 + 1] = spritePosition.y;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadRotation = function uploadRotation(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + stride * 2] = spriteRotation;\n array[offset + stride * 3] = spriteRotation;\n\n offset += stride * 4;\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadUvs = function uploadUvs(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n\n array[offset + stride * 2] = textureUvs.x2;\n array[offset + stride * 2 + 1] = textureUvs.y2;\n\n array[offset + stride * 3] = textureUvs.x3;\n array[offset + stride * 3 + 1] = textureUvs.y3;\n\n offset += stride * 4;\n } else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n\n array[offset + stride * 2] = 0;\n array[offset + stride * 2 + 1] = 0;\n\n array[offset + stride * 3] = 0;\n array[offset + stride * 3 + 1] = 0;\n\n offset += stride * 4;\n }\n }\n };\n\n /**\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n\n\n ParticleRenderer.prototype.uploadTint = function uploadTint(children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var premultiplied = sprite._texture.baseTexture.premultipliedAlpha;\n var alpha = sprite.alpha;\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && premultiplied ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n\n array[offset] = argb;\n array[offset + stride] = argb;\n array[offset + stride * 2] = argb;\n array[offset + stride * 3] = argb;\n\n offset += stride * 4;\n }\n };\n\n /**\n * Destroys the ParticleRenderer.\n *\n */\n\n\n ParticleRenderer.prototype.destroy = function destroy() {\n if (this.renderer.gl) {\n this.renderer.gl.deleteBuffer(this.indexBuffer);\n }\n\n _core$ObjectRenderer.prototype.destroy.call(this);\n\n this.shader.destroy();\n\n this.indices = null;\n this.tempMatrix = null;\n };\n\n return ParticleRenderer;\n}(core.ObjectRenderer);\n\nexports.default = ParticleRenderer;\n\n\ncore.WebGLRenderer.registerPlugin('particle', ParticleRenderer);\n//# sourceMappingURL=ParticleRenderer.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/webgl/ParticleRenderer.js\n// module id = 593\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _Shader2 = require('../../core/Shader');\n\nvar _Shader3 = _interopRequireDefault(_Shader2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * @class\n * @extends PIXI.Shader\n * @memberof PIXI\n */\nvar ParticleShader = function (_Shader) {\n _inherits(ParticleShader, _Shader);\n\n /**\n * @param {PIXI.Shader} gl - The webgl shader manager this shader works for.\n */\n function ParticleShader(gl) {\n _classCallCheck(this, ParticleShader);\n\n return _possibleConstructorReturn(this, _Shader.call(this, gl,\n // vertex shader\n ['attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'attribute vec4 aColor;', 'attribute vec2 aPositionCoord;', 'attribute vec2 aScale;', 'attribute float aRotation;', 'uniform mat3 projectionMatrix;', 'uniform vec4 uColor;', 'varying vec2 vTextureCoord;', 'varying vec4 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 * uColor;', '}'].join('\\n'),\n // hello\n ['varying vec2 vTextureCoord;', 'varying vec4 vColor;', 'uniform sampler2D uSampler;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor;', ' if (color.a == 0.0) discard;', ' gl_FragColor = color;', '}'].join('\\n')));\n }\n\n return ParticleShader;\n}(_Shader3.default);\n\nexports.default = ParticleShader;\n//# sourceMappingURL=ParticleShader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/particles/webgl/ParticleShader.js\n// module id = 594\n// module chunks = 0","\"use strict\";\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\n\nif (!Math.sign) {\n Math.sign = function mathSign(x) {\n x = Number(x);\n\n if (x === 0 || isNaN(x)) {\n return x;\n }\n\n return x > 0 ? 1 : -1;\n };\n}\n//# sourceMappingURL=Math.sign.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/Math.sign.js\n// module id = 595\n// module chunks = 0","'use strict';\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nif (!Object.assign) {\n Object.assign = _objectAssign2.default;\n} // References:\n// https://github.com/sindresorhus/object-assign\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n//# sourceMappingURL=Object.assign.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/Object.assign.js\n// module id = 596\n// module chunks = 0","'use strict';\n\nrequire('./Object.assign');\n\nrequire('./requestAnimationFrame');\n\nrequire('./Math.sign');\n\nif (!window.ArrayBuffer) {\n window.ArrayBuffer = Array;\n}\n\nif (!window.Float32Array) {\n window.Float32Array = Array;\n}\n\nif (!window.Uint32Array) {\n window.Uint32Array = Array;\n}\n\nif (!window.Uint16Array) {\n window.Uint16Array = Array;\n}\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/index.js\n// module id = 597\n// module chunks = 0","'use strict';\n\n// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `self`, and finally `window`\n\nvar ONE_FRAME_TIME = 16;\n\n// Date.now\nif (!(Date.now && Date.prototype.getTime)) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n\n// performance.now\nif (!(global.performance && global.performance.now)) {\n var startTime = Date.now();\n\n if (!global.performance) {\n global.performance = {};\n }\n\n global.performance.now = function () {\n return Date.now() - startTime;\n };\n}\n\n// requestAnimationFrame\nvar lastTime = Date.now();\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\n\nfor (var x = 0; x < vendors.length && !global.requestAnimationFrame; ++x) {\n var p = vendors[x];\n\n global.requestAnimationFrame = global[p + 'RequestAnimationFrame'];\n global.cancelAnimationFrame = global[p + 'CancelAnimationFrame'] || global[p + 'CancelRequestAnimationFrame'];\n}\n\nif (!global.requestAnimationFrame) {\n global.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + 'is not a function');\n }\n\n var currentTime = Date.now();\n var delay = ONE_FRAME_TIME + lastTime - currentTime;\n\n if (delay < 0) {\n delay = 0;\n }\n\n lastTime = currentTime;\n\n return setTimeout(function () {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\n\nif (!global.cancelAnimationFrame) {\n global.cancelAnimationFrame = function (id) {\n return clearTimeout(id);\n };\n}\n//# sourceMappingURL=requestAnimationFrame.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/polyfill/requestAnimationFrame.js\n// module id = 598\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BasePrepare2 = require('../BasePrepare');\n\nvar _BasePrepare3 = _interopRequireDefault(_BasePrepare2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CANVAS_START_SIZE = 16;\n\n/**\n * The prepare manager provides functionality to upload content to the GPU\n * This cannot be done directly for Canvas like in WebGL, but the effect can be achieved by drawing\n * textures to an offline canvas.\n * This draw call will force the texture to be moved onto the GPU.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare\n *\n * @class\n * @extends PIXI.prepare.BasePrepare\n * @memberof PIXI.prepare\n */\n\nvar CanvasPrepare = function (_BasePrepare) {\n _inherits(CanvasPrepare, _BasePrepare);\n\n /**\n * @param {PIXI.CanvasRenderer} renderer - A reference to the current renderer\n */\n function CanvasPrepare(renderer) {\n _classCallCheck(this, CanvasPrepare);\n\n var _this = _possibleConstructorReturn(this, _BasePrepare.call(this, renderer));\n\n _this.uploadHookHelper = _this;\n\n /**\n * An offline canvas to render textures to\n * @type {HTMLCanvasElement}\n * @private\n */\n _this.canvas = document.createElement('canvas');\n _this.canvas.width = CANVAS_START_SIZE;\n _this.canvas.height = CANVAS_START_SIZE;\n\n /**\n * The context to the canvas\n * @type {CanvasRenderingContext2D}\n * @private\n */\n _this.ctx = _this.canvas.getContext('2d');\n\n // Add textures to upload\n _this.registerUploadHook(uploadBaseTextures);\n return _this;\n }\n\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n\n\n CanvasPrepare.prototype.destroy = function destroy() {\n _BasePrepare.prototype.destroy.call(this);\n this.ctx = null;\n this.canvas = null;\n };\n\n return CanvasPrepare;\n}(_BasePrepare3.default);\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {*} prepare - Instance of CanvasPrepare\n * @param {*} item - Item to check\n * @return {boolean} If item was uploaded.\n */\n\n\nexports.default = CanvasPrepare;\nfunction uploadBaseTextures(prepare, item) {\n if (item instanceof core.BaseTexture) {\n var image = item.source;\n\n // Sometimes images (like atlas images) report a size of zero, causing errors on windows phone.\n // So if the width or height is equal to zero then use the canvas size\n // Otherwise use whatever is smaller, the image dimensions or the canvas dimensions.\n var imageWidth = image.width === 0 ? prepare.canvas.width : Math.min(prepare.canvas.width, image.width);\n var imageHeight = image.height === 0 ? prepare.canvas.height : Math.min(prepare.canvas.height, image.height);\n\n // Only a small subsections is required to be drawn to have the whole texture uploaded to the GPU\n // A smaller draw can be faster.\n prepare.ctx.drawImage(image, 0, 0, imageWidth, imageHeight, 0, 0, prepare.canvas.width, prepare.canvas.height);\n\n return true;\n }\n\n return false;\n}\n\ncore.CanvasRenderer.registerPlugin('prepare', CanvasPrepare);\n//# sourceMappingURL=CanvasPrepare.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/canvas/CanvasPrepare.js\n// module id = 599\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _WebGLPrepare = require('./webgl/WebGLPrepare');\n\nObject.defineProperty(exports, 'webgl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_WebGLPrepare).default;\n }\n});\n\nvar _CanvasPrepare = require('./canvas/CanvasPrepare');\n\nObject.defineProperty(exports, 'canvas', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CanvasPrepare).default;\n }\n});\n\nvar _BasePrepare = require('./BasePrepare');\n\nObject.defineProperty(exports, 'BasePrepare', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_BasePrepare).default;\n }\n});\n\nvar _CountLimiter = require('./limiters/CountLimiter');\n\nObject.defineProperty(exports, 'CountLimiter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_CountLimiter).default;\n }\n});\n\nvar _TimeLimiter = require('./limiters/TimeLimiter');\n\nObject.defineProperty(exports, 'TimeLimiter', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TimeLimiter).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n//# sourceMappingURL=index.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/index.js\n// module id = 600\n// module chunks = 0","\"use strict\";\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar TimeLimiter = function () {\n /**\n * @param {number} maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame.\n */\n function TimeLimiter(maxMilliseconds) {\n _classCallCheck(this, TimeLimiter);\n\n /**\n * The maximum milliseconds that can be spent preparing items each frame.\n * @private\n */\n this.maxMilliseconds = maxMilliseconds;\n /**\n * The start time of the current frame.\n * @type {number}\n * @private\n */\n this.frameStart = 0;\n }\n\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n\n\n TimeLimiter.prototype.beginFrame = function beginFrame() {\n this.frameStart = Date.now();\n };\n\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n\n\n TimeLimiter.prototype.allowedToUpload = function allowedToUpload() {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n\n return TimeLimiter;\n}();\n\nexports.default = TimeLimiter;\n//# sourceMappingURL=TimeLimiter.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/limiters/TimeLimiter.js\n// module id = 601\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _core = require('../../core');\n\nvar core = _interopRequireWildcard(_core);\n\nvar _BasePrepare2 = require('../BasePrepare');\n\nvar _BasePrepare3 = _interopRequireDefault(_BasePrepare2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.prepare\n *\n * @class\n * @extends PIXI.prepare.BasePrepare\n * @memberof PIXI.prepare\n */\nvar WebGLPrepare = function (_BasePrepare) {\n _inherits(WebGLPrepare, _BasePrepare);\n\n /**\n * @param {PIXI.WebGLRenderer} renderer - A reference to the current renderer\n */\n function WebGLPrepare(renderer) {\n _classCallCheck(this, WebGLPrepare);\n\n var _this = _possibleConstructorReturn(this, _BasePrepare.call(this, renderer));\n\n _this.uploadHookHelper = _this.renderer;\n\n // Add textures and graphics to upload\n _this.registerFindHook(findGraphics);\n _this.registerUploadHook(uploadBaseTextures);\n _this.registerUploadHook(uploadGraphics);\n return _this;\n }\n\n return WebGLPrepare;\n}(_BasePrepare3.default);\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\n\n\nexports.default = WebGLPrepare;\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof core.BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.textureManager.updateTexture(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n *\n * @private\n * @param {PIXI.WebGLRenderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (item instanceof core.Graphics) {\n // if the item is not dirty and already has webgl data, then it got prepared or rendered\n // before now and we shouldn't waste time updating it again\n if (item.dirty || item.clearDirty || !item._webGL[renderer.plugins.graphics.CONTEXT_UID]) {\n renderer.plugins.graphics.updateGraphics(item);\n }\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Built-in hook to find graphics.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof core.Graphics) {\n queue.push(item);\n\n return true;\n }\n\n return false;\n}\n\ncore.WebGLRenderer.registerPlugin('prepare', WebGLPrepare);\n//# sourceMappingURL=WebGLPrepare.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pixi.js/lib/prepare/webgl/WebGLPrepare.js\n// module id = 602\n// module chunks = 0","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/punycode/punycode.js\n// module id = 603\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/decode.js\n// module id = 604\n// module chunks = 0","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/encode.js\n// module id = 605\n// module chunks = 0","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/index.js\n// module id = 606\n// module chunks = 0","'use strict'\n\n/**\n * Remove a range of items from an array\n *\n * @function removeItems\n * @param {Array<*>} arr The target array\n * @param {number} startIdx The index to begin removing from (inclusive)\n * @param {number} removeCount How many items to remove\n */\nmodule.exports = function removeItems(arr, startIdx, removeCount)\n{\n var i, length = arr.length\n\n if (startIdx >= length || removeCount === 0) {\n return\n }\n\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount)\n\n var len = length - removeCount\n\n for (i = startIdx; i < len; ++i) {\n arr[i] = arr[i + removeCount]\n }\n\n arr.length = len\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/remove-array-items/index.js\n// module id = 607\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _miniSignals = require('mini-signals');\n\nvar _miniSignals2 = _interopRequireDefault(_miniSignals);\n\nvar _parseUri = require('parse-uri');\n\nvar _parseUri2 = _interopRequireDefault(_parseUri);\n\nvar _async = require('./async');\n\nvar async = _interopRequireWildcard(_async);\n\nvar _Resource = require('./Resource');\n\nvar _Resource2 = _interopRequireDefault(_Resource);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// some constants\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n */\n\nvar Loader = function () {\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader() {\n var _this = this;\n\n var baseUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var concurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;\n\n _classCallCheck(this, Loader);\n\n /**\n * The base url for all resources loaded by this loader.\n *\n * @member {string}\n */\n this.baseUrl = baseUrl;\n\n /**\n * The progress percent of the loader going through the queue.\n *\n * @member {number}\n */\n this.progress = 0;\n\n /**\n * Loading state of the loader, true if it is currently loading resources.\n *\n * @member {boolean}\n */\n this.loading = false;\n\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n *\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n */\n this.defaultQueryString = '';\n\n /**\n * The middleware to run before loading each resource.\n *\n * @member {function[]}\n */\n this._beforeMiddleware = [];\n\n /**\n * The middleware to run after loading each resource.\n *\n * @member {function[]}\n */\n this._afterMiddleware = [];\n\n /**\n * The tracks the resources we are currently completing parsing for.\n *\n * @member {Resource[]}\n */\n this._resourcesParsing = [];\n\n /**\n * The `_loadResource` function bound with this object context.\n *\n * @private\n * @member {function}\n * @param {Resource} r - The resource to load\n * @param {Function} d - The dequeue function\n * @return {undefined}\n */\n this._boundLoadResource = function (r, d) {\n return _this._loadResource(r, d);\n };\n\n /**\n * The resources waiting to be loaded.\n *\n * @private\n * @member {Resource[]}\n */\n this._queue = async.queue(this._boundLoadResource, concurrency);\n\n this._queue.pause();\n\n /**\n * All the resources for this loader keyed by name.\n *\n * @member {object}\n */\n this.resources = {};\n\n /**\n * Dispatched once per loaded or errored resource.\n *\n * The callback looks like {@link Loader.OnProgressSignal}.\n *\n * @member {Signal}\n */\n this.onProgress = new _miniSignals2.default();\n\n /**\n * Dispatched once per errored resource.\n *\n * The callback looks like {@link Loader.OnErrorSignal}.\n *\n * @member {Signal}\n */\n this.onError = new _miniSignals2.default();\n\n /**\n * Dispatched once per loaded resource.\n *\n * The callback looks like {@link Loader.OnLoadSignal}.\n *\n * @member {Signal}\n */\n this.onLoad = new _miniSignals2.default();\n\n /**\n * Dispatched when the loader begins to process the queue.\n *\n * The callback looks like {@link Loader.OnStartSignal}.\n *\n * @member {Signal}\n */\n this.onStart = new _miniSignals2.default();\n\n /**\n * Dispatched when the queued resources all load.\n *\n * The callback looks like {@link Loader.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n this.onComplete = new _miniSignals2.default();\n\n /**\n * When the progress changes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnProgressSignal\n * @param {Loader} loader - The loader the progress is advancing on.\n * @param {Resource} resource - The resource that has completed or failed to cause the progress to advance.\n */\n\n /**\n * When an error occurrs the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnErrorSignal\n * @param {Loader} loader - The loader the error happened in.\n * @param {Resource} resource - The resource that caused the error.\n */\n\n /**\n * When a load completes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnLoadSignal\n * @param {Loader} loader - The loader that laoded the resource.\n * @param {Resource} resource - The resource that has completed loading.\n */\n\n /**\n * When the loader starts loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnStartSignal\n * @param {Loader} loader - The loader that has started loading resources.\n */\n\n /**\n * When the loader completes loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnCompleteSignal\n * @param {Loader} loader - The loader that has finished loading resources.\n */\n }\n\n /**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n * // normal param syntax\n * .add('key', 'http://...', function () {})\n * .add('http://...', function () {})\n * .add('http://...')\n *\n * // object syntax\n * .add({\n * name: 'key2',\n * url: 'http://...'\n * }, function () {})\n * .add({\n * url: 'http://...'\n * }, function () {})\n * .add({\n * name: 'key3',\n * url: 'http://...'\n * onComplete: function () {}\n * })\n * .add({\n * url: 'https://...',\n * onComplete: function () {},\n * crossOrigin: true\n * })\n *\n * // you can also pass an array of objects or urls or both\n * .add([\n * { name: 'key4', url: 'http://...', onComplete: function () {} },\n * { url: 'http://...', onComplete: function () {} },\n * 'http://...'\n * ])\n *\n * // and you can use both params and options\n * .add('key', 'http://...', { crossOrigin: true }, function () {})\n * .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @param {string} [name] - The name of the resource to load, if not passed the url is used.\n * @param {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @param {object} [options] - The options for the load.\n * @param {boolean} [options.crossOrigin] - Is this request cross-origin? Default is to determine automatically.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How should\n * the data being loaded be interpreted when using XHR?\n * @param {object} [options.metadata] - Extra configuration for middleware and the Resource object.\n * @param {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [options.metadata.loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @param {boolean} [options.metadata.skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @param {function} [cb] - Function to call when this specific resource completes loading.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.add = function add(name, url, options, cb) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n\n return this;\n }\n\n // if an object is passed instead of params\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n cb = url || name.callback || name.onComplete;\n options = name;\n url = name.url;\n name = name.name || name.key || name.url;\n }\n\n // case where no name is passed shift all args over by one.\n if (typeof url !== 'string') {\n cb = options;\n options = url;\n url = name;\n }\n\n // now that we shifted make sure we have a proper url.\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n }\n\n // options are optional so people might pass a function and no options\n if (typeof options === 'function') {\n cb = options;\n options = null;\n }\n\n // if loading already you can only add resources that have a parent.\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n }\n\n // check if resource already exists.\n if (this.resources[name]) {\n throw new Error('Resource named \"' + name + '\" already exists.');\n }\n\n // add base url if this isn't an absolute url\n url = this._prepareUrl(url);\n\n // create the store the resource\n this.resources[name] = new _Resource2.default(name, url, options);\n\n if (typeof cb === 'function') {\n this.resources[name].onAfterMiddleware.once(cb);\n }\n\n // if actively loading, make sure to adjust progress chunks for that parent and its children\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n\n for (var _i = 0; _i < parent.children.length; ++_i) {\n if (!parent.children[_i].isComplete) {\n incompleteChildren.push(parent.children[_i]);\n }\n }\n\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n\n for (var _i2 = 0; _i2 < incompleteChildren.length; ++_i2) {\n incompleteChildren[_i2].progressChunk = eachChunk;\n }\n\n this.resources[name].progressChunk = eachChunk;\n }\n\n // add the resource to the queue\n this._queue.push(this.resources[name]);\n\n return this;\n };\n\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @method before\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.pre = function pre(fn) {\n this._beforeMiddleware.push(fn);\n\n return this;\n };\n\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @alias use\n * @method after\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.use = function use(fn) {\n this._afterMiddleware.push(fn);\n\n return this;\n };\n\n /**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.reset = function reset() {\n this.progress = 0;\n this.loading = false;\n\n this._queue.kill();\n this._queue.pause();\n\n // abort all resource loads\n for (var k in this.resources) {\n var res = this.resources[k];\n\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n\n if (res.isLoading) {\n res.abort();\n }\n }\n\n this.resources = {};\n\n return this;\n };\n\n /**\n * Starts loading the queued resources.\n *\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {Loader} Returns itself.\n */\n\n\n Loader.prototype.load = function load(cb) {\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n }\n\n // if the queue has already started we are done here\n if (this.loading) {\n return this;\n }\n\n // distribute progress chunks\n var chunk = 100 / this._queue._tasks.length;\n\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n }\n\n // update loading state\n this.loading = true;\n\n // notify of start\n this.onStart.dispatch(this);\n\n // start loading\n this._queue.resume();\n\n return this;\n };\n\n /**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\n\n\n Loader.prototype._prepareUrl = function _prepareUrl(url) {\n var parsedUrl = (0, _parseUri2.default)(url, { strictMode: true });\n var result = void 0;\n\n // absolute url, just use it as is.\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n }\n // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') {\n result = this.baseUrl + '/' + url;\n } else {\n result = this.baseUrl + url;\n }\n\n // if we need to add a default querystring, there is a bit more work\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n\n result = result.substr(0, result.length - hash.length);\n\n if (result.indexOf('?') !== -1) {\n result += '&' + this.defaultQueryString;\n } else {\n result += '?' + this.defaultQueryString;\n }\n\n result += hash;\n }\n\n return result;\n };\n\n /**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\n\n\n Loader.prototype._loadResource = function _loadResource(resource, dequeue) {\n var _this2 = this;\n\n resource._dequeue = dequeue;\n\n // run before middleware\n async.eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this2, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this2._onLoad(resource);\n } else {\n resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2);\n resource.load();\n }\n }, true);\n };\n\n /**\n * Called once each resource has loaded.\n *\n * @private\n */\n\n\n Loader.prototype._onComplete = function _onComplete() {\n this.loading = false;\n\n this.onComplete.dispatch(this, this.resources);\n };\n\n /**\n * Called each time a resources is loaded.\n *\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\n\n\n Loader.prototype._onLoad = function _onLoad(resource) {\n var _this3 = this;\n\n resource._onLoadBinding = null;\n\n // remove this resource from the async queue, and add it to our list of resources that are being parsed\n this._resourcesParsing.push(resource);\n resource._dequeue();\n\n // run all the after middleware for this resource\n async.eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this3, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n\n _this3.progress += resource.progressChunk;\n _this3.onProgress.dispatch(_this3, resource);\n\n if (resource.error) {\n _this3.onError.dispatch(resource.error, _this3, resource);\n } else {\n _this3.onLoad.dispatch(_this3, resource);\n }\n\n _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1);\n\n // do completion check\n if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) {\n _this3.progress = MAX_PROGRESS;\n _this3._onComplete();\n }\n }, true);\n };\n\n return Loader;\n}();\n\nexports.default = Loader;\n//# sourceMappingURL=Loader.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/Loader.js\n// module id = 608\n// module chunks = 0","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.blobMiddlewareFactory = blobMiddlewareFactory;\n\nvar _Resource = require('../../Resource');\n\nvar _Resource2 = _interopRequireDefault(_Resource);\n\nvar _b = require('../../b64');\n\nvar _b2 = _interopRequireDefault(_b);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Url = window.URL || window.webkitURL;\n\n// a middleware for transforming XHR loaded Blobs into more useful objects\nfunction blobMiddlewareFactory() {\n return function blobMiddleware(resource, next) {\n if (!resource.data) {\n next();\n\n return;\n }\n\n // if this was an XHR load of a blob\n if (resource.xhr && resource.xhrType === _Resource2.default.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type');\n\n // this is an image, convert the binary string into a data url\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = 'data:' + type + ';base64,' + _b2.default.encodeBinary(resource.xhr.responseText);\n\n resource.type = _Resource2.default.TYPE.IMAGE;\n\n // wait until the image loads and then callback\n resource.data.onload = function () {\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load\n return;\n }\n }\n // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var _ret = function () {\n var src = Url.createObjectURL(resource.data);\n\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n\n resource.type = _Resource2.default.TYPE.IMAGE;\n\n // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n resource.data.onload = function () {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load.\n return {\n v: void 0\n };\n }();\n\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === \"object\") return _ret.v;\n }\n }\n\n next();\n };\n}\n//# sourceMappingURL=blob.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/resource-loader/lib/middlewares/parsing/blob.js\n// module id = 609\n// module chunks = 0","(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a