diff --git a/bin/pixi-flump.js b/bin/pixi-flump.js index 1b3c6e0..8c536ca 100644 --- a/bin/pixi-flump.js +++ b/bin/pixi-flump.js @@ -1,7 +1,7 @@ /** * @license * pixi-flump.js - v1.0.0 - * Compiled 2016-05-04T20:34:37.513Z + * Compiled 2016-05-06T13:24:38.373Z * * pixi-flump.js is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license.php @@ -105,9 +105,8 @@ var FlumpLibrary = (function () { FlumpLibrary.prototype.createSymbol = function (name, paused) { if (paused === void 0) { paused = false; } for (var i = 0; i < this.textureGroups.length; i++) { - var textures = this.textureGroups[i].sprites; - if (name in textures) { - return textures[name]; + if (this.textureGroups[i].hasSprite(name)) { + return this.textureGroups[i].createSprite(name); } } for (var i = 0; i < this.movieData.length; i++) { @@ -147,7 +146,7 @@ var FlumpLibrary = (function () { }()); exports.FlumpLibrary = FlumpLibrary; -},{"./core/FlumpMovie":2,"./core/TextureGroup":5,"./data/MovieData":10,"./util/HttpRequest":13,"./util/Promise":14,"./util/PromiseUtil":15,"./util/QueueItem":17}],2:[function(require,module,exports){ +},{"./core/FlumpMovie":2,"./core/TextureGroup":4,"./data/MovieData":9,"./util/HttpRequest":12,"./util/Promise":13,"./util/PromiseUtil":14,"./util/QueueItem":16}],2:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -351,29 +350,13 @@ var FlumpMovie = (function (_super) { }(PIXI.Container)); exports.FlumpMovie = FlumpMovie; -},{"../core/MovieLayer":4,"../util/AnimationQueue":12,"../util/QueueItem":17}],3:[function(require,module,exports){ -"use strict"; -var FlumpMtx = (function () { - function FlumpMtx(a, b, c, d, tx, ty) { - this.a = a; - this.b = b; - this.c = c; - this.d = d; - this.tx = tx; - this.ty = ty; - } - return FlumpMtx; -}()); -exports.FlumpMtx = FlumpMtx; - -},{}],4:[function(require,module,exports){ +},{"../core/MovieLayer":3,"../util/AnimationQueue":11,"../util/QueueItem":16}],3:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var FlumpMtx_1 = require("./FlumpMtx"); var FlumpMovie_1 = require("./FlumpMovie"); var LabelData_1 = require("../data/LabelData"); var KeyframeData_1 = require("../data/KeyframeData"); @@ -385,7 +368,6 @@ var MovieLayer = (function (_super) { this._frame = 0; this._symbols = {}; this.enabled = true; - this._storedMtx = new FlumpMtx_1.FlumpMtx(1, 0, 0, 1, 0, 0); var keyframeData = layerData.keyframeData; this._index = index; this._movie = movie; @@ -501,9 +483,23 @@ var MovieLayer = (function (_super) { alpha = alpha + (nextKeyframe.alpha - alpha) * interped; } } - symbol.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, pivotX, pivotY); - symbol.visible = keyframe.visible; - symbol.alpha = alpha; + if (skewX != 0) { + sinX = Math.sin(skewX); + cosX = Math.cos(skewX); + } + if (skewY != 0) { + sinY = Math.sin(skewY); + cosY = Math.cos(skewY); + } + this._symbol.position.set(x, y); + this._symbol.scale.set(scaleX, scaleY); + if (!(this._symbol instanceof PIXI.Sprite)) { + this._symbol['pivot'].x = pivotX; + this._symbol['pivot'].y = pivotY; + } + this._symbol['skew'].set(skewX, skewY); + this.alpha = alpha; + this.visible = keyframe.visible; this._frame = frame; }; MovieLayer.prototype.reset = function () { @@ -521,17 +517,18 @@ var MovieLayer = (function (_super) { }(PIXI.Container)); exports.MovieLayer = MovieLayer; -},{"../data/KeyframeData":7,"../data/LabelData":8,"./FlumpMovie":2,"./FlumpMtx":3}],5:[function(require,module,exports){ +},{"../data/KeyframeData":6,"../data/LabelData":7,"./FlumpMovie":2}],4:[function(require,module,exports){ "use strict"; var TextureGroupAtlas_1 = require("./TextureGroupAtlas"); var Promise_1 = require("../util/Promise"); var TextureGroup = (function () { - function TextureGroup(sprites) { - this.sprites = {}; - for (var i = 0; i < sprites.length; i++) { - var sprite = sprites[i]; - this.sprites[sprite.name] = sprite; - } + function TextureGroup(names, textures, ancors) { + this._names = []; + this._textures = []; + this._ancors = []; + this._names = names; + this._textures = textures; + this._ancors = ancors; } TextureGroup.load = function (library, json) { var atlases = json.atlases; @@ -541,31 +538,58 @@ var TextureGroup = (function () { loaders.push(TextureGroupAtlas_1.TextureGroupAtlas.load(library, atlas)); } return Promise_1.Promise.all(loaders).then(function (atlases) { - var result = []; + var names = []; + var textures = []; + var ancors = []; for (var i = 0; i < atlases.length; i++) { var atlas = atlases[i]; - result = result.concat(atlas.getSprites()); + names = names.concat(atlas.getNames()); + textures = textures.concat(atlas.getTextures()); + ancors = ancors.concat(atlas.getAnchors()); + atlas.destruct(); } - return new TextureGroup(result); + return new TextureGroup(names, textures, ancors); }).catch(function (err) { console.warn('could not load textureGroup', err); throw new Error('could not load textureGroup'); }); }; + TextureGroup.prototype.hasSprite = function (name) { + return this._names.indexOf(name) > -1; + }; + TextureGroup.prototype.createSprite = function (name) { + var index = this._names.indexOf(name); + var sprite = new PIXI.Sprite(this._textures[index]); + sprite.anchor.set(this._ancors[index].x, this._ancors[index].y); + sprite.name = name; + return sprite; + }; return TextureGroup; }()); exports.TextureGroup = TextureGroup; -},{"../util/Promise":14,"./TextureGroupAtlas":6}],6:[function(require,module,exports){ +},{"../util/Promise":13,"./TextureGroupAtlas":5}],5:[function(require,module,exports){ "use strict"; var Promise_1 = require("../util/Promise"); var Texture = PIXI.Texture; var BaseTexture = PIXI.BaseTexture; var Rectangle = PIXI.Rectangle; +var Point = PIXI.Point; var TextureGroupAtlas = (function () { function TextureGroupAtlas(renderTexture, json) { - this._renderTexture = new BaseTexture(renderTexture); + this._names = []; + this._textures = []; + this._anchors = []; + this._baseTexture = new BaseTexture(renderTexture); this._atlas = json; + var atlasTextures = this._atlas.textures; + var baseTexture = this._baseTexture; + for (var i = 0; i < atlasTextures.length; i++) { + var atlasTexture = atlasTextures[i]; + this._names.push(atlasTexture.symbol); + this._textures.push(new Texture(baseTexture, new Rectangle(atlasTexture.rect[0], atlasTexture.rect[1], atlasTexture.rect[2], atlasTexture.rect[3]))); + this._anchors.push(new Point(atlasTexture.origin[0] / atlasTexture.rect[2], atlasTexture.origin[1] / atlasTexture.rect[3])); + } } TextureGroupAtlas.load = function (library, json) { var file = json.file; @@ -581,27 +605,29 @@ var TextureGroupAtlas = (function () { img.src = url; }).then(function (data) { return new TextureGroupAtlas(data, json); }); }; - TextureGroupAtlas.prototype.getSprites = function () { - var result = []; - var textures = this._atlas.textures; - var baseTexture = this._renderTexture; - for (var i = 0; i < textures.length; i++) { - var texture = textures[i]; - var sprite = new PIXI.Sprite(new Texture(baseTexture, new Rectangle(texture.rect[0], texture.rect[1], texture.rect[2], texture.rect[3]))); - sprite.name = texture.symbol; - result.push(sprite); - } - return result; + TextureGroupAtlas.prototype.getNames = function () { + return this._names; + }; + TextureGroupAtlas.prototype.getTextures = function () { + return this._textures; + }; + TextureGroupAtlas.prototype.getAnchors = function () { + return this._anchors; + }; + TextureGroupAtlas.prototype.destruct = function () { + this._names = null; + this._textures = null; + this._anchors = null; }; return TextureGroupAtlas; }()); exports.TextureGroupAtlas = TextureGroupAtlas; -},{"../util/Promise":14}],7:[function(require,module,exports){ +},{"../util/Promise":13}],6:[function(require,module,exports){ "use strict"; var KeyframeData = (function () { function KeyframeData(json) { - if (json.length != void 0) { + if (json instanceof Array) { this.fromArray(json); } else { @@ -657,11 +683,22 @@ var KeyframeData = (function () { this[name] = value; } }; + KeyframeData.prototype.copyNotDefined = function (keyframe) { + var order = this.getValueOrder(); + var data = keyframe.toArray(); + for (var i = 0; i < data.length; i++) { + var name = order[i]; + var value = data[i]; + if (this[name] == void 0 && value != void 0) { + this[name] = value; + } + } + }; return KeyframeData; }()); exports.KeyframeData = KeyframeData; -},{}],8:[function(require,module,exports){ +},{}],7:[function(require,module,exports){ "use strict"; var LabelData = (function () { function LabelData(label, index, duration) { @@ -673,7 +710,7 @@ var LabelData = (function () { }()); exports.LabelData = LabelData; -},{}],9:[function(require,module,exports){ +},{}],8:[function(require,module,exports){ "use strict"; var KeyframeData_1 = require("./KeyframeData"); var LayerData = (function () { @@ -711,7 +748,7 @@ var LayerData = (function () { }()); exports.LayerData = LayerData; -},{"./KeyframeData":7}],10:[function(require,module,exports){ +},{"./KeyframeData":6}],9:[function(require,module,exports){ "use strict"; var LayerData_1 = require("./LayerData"); var MovieData = (function () { @@ -729,12 +766,12 @@ var MovieData = (function () { }()); exports.MovieData = MovieData; -},{"./LayerData":9}],11:[function(require,module,exports){ +},{"./LayerData":8}],10:[function(require,module,exports){ "use strict"; var FlumpLibrary_1 = require("./FlumpLibrary"); module.exports = FlumpLibrary_1.FlumpLibrary; -},{"./FlumpLibrary":1}],12:[function(require,module,exports){ +},{"./FlumpLibrary":1}],11:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -791,7 +828,7 @@ var AnimationQueue = (function (_super) { }(Queue_1.Queue)); exports.AnimationQueue = AnimationQueue; -},{"./Queue":16}],13:[function(require,module,exports){ +},{"./Queue":15}],12:[function(require,module,exports){ "use strict"; var Promise_1 = require("../util/Promise"); var HttpRequest = (function () { @@ -843,7 +880,7 @@ var HttpRequest = (function () { }()); exports.HttpRequest = HttpRequest; -},{"../util/Promise":14}],14:[function(require,module,exports){ +},{"../util/Promise":13}],13:[function(require,module,exports){ "use strict"; var asap = (typeof setImmediate === 'function' && setImmediate) || function (fn) { @@ -1025,7 +1062,7 @@ var Promise = (function () { }()); exports.Promise = Promise; -},{}],15:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ "use strict"; var Promise_1 = require("./Promise"); var PromiseUtil = (function () { @@ -1073,7 +1110,7 @@ var PromiseUtil = (function () { }()); exports.PromiseUtil = PromiseUtil; -},{"./Promise":14}],16:[function(require,module,exports){ +},{"./Promise":13}],15:[function(require,module,exports){ "use strict"; var Queue = (function () { function Queue() { @@ -1129,7 +1166,7 @@ var Queue = (function () { }()); exports.Queue = Queue; -},{}],17:[function(require,module,exports){ +},{}],16:[function(require,module,exports){ "use strict"; var QueueItem = (function () { function QueueItem(label, from, to, times, delay) { @@ -1164,8 +1201,8 @@ var QueueItem = (function () { }()); exports.QueueItem = QueueItem; -},{}]},{},[11])(11) +},{}]},{},[10])(10) }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvRmx1bXBMaWJyYXJ5LmpzIiwic3JjL2NvcmUvRmx1bXBNb3ZpZS5qcyIsInNyYy9jb3JlL0ZsdW1wTXR4LmpzIiwic3JjL2NvcmUvTW92aWVMYXllci5qcyIsInNyYy9jb3JlL1RleHR1cmVHcm91cC5qcyIsInNyYy9jb3JlL1RleHR1cmVHcm91cEF0bGFzLmpzIiwic3JjL2RhdGEvS2V5ZnJhbWVEYXRhLmpzIiwic3JjL2RhdGEvTGFiZWxEYXRhLmpzIiwic3JjL2RhdGEvTGF5ZXJEYXRhLmpzIiwic3JjL2RhdGEvTW92aWVEYXRhLmpzIiwic3JjL2luZGV4Iiwic3JjL3V0aWwvQW5pbWF0aW9uUXVldWUuanMiLCJzcmMvdXRpbC9IdHRwUmVxdWVzdC5qcyIsInNyYy91dGlsL1Byb21pc2UuanMiLCJzcmMvdXRpbC9Qcm9taXNlVXRpbC5qcyIsInNyYy91dGlsL1F1ZXVlLmpzIiwic3JjL3V0aWwvUXVldWVJdGVtLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FDQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQT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XHJcbiAgICAgICAgdGhpcy5mcHMgPSAwO1xyXG4gICAgICAgIHRoaXMuaXNPcHRpbWlzZWQgPSBmYWxzZTtcclxuICAgICAgICB0aGlzLl9oYXNMb2FkZWQgPSBmYWxzZTtcclxuICAgICAgICB0aGlzLl9pc0xvYWRpbmcgPSBmYWxzZTtcclxuICAgICAgICB2YXIgYSA9IDA7XHJcbiAgICAgICAgaWYgKGJhc2VQYXRoKSB7XHJcbiAgICAgICAgICAgIHRoaXMudXJsID0gYmFzZVBhdGg7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgRmx1bXBMaWJyYXJ5LmxvYWQgPSBmdW5jdGlvbiAodXJsLCBsaWJyYXJ5LCBvblByb2Nlc3MpIHtcclxuICAgICAgICB2YXIgYmFzZURpciA9IHVybDtcclxuICAgICAgICBpZiAodXJsLmluZGV4T2YoJy5qc29uJykgPiAtMSkge1xyXG4gICAgICAgICAgICBiYXNlRGlyID0gdXJsLnN1YnN0cigwLCB1cmwubGFzdEluZGV4T2YoJy8nKSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAoYmFzZURpci5zdWJzdHIoLTEpID09ICcvJykge1xyXG4gICAgICAgICAgICAgICAgYmFzZURpciA9IGJhc2VEaXIuc3Vic3RyKDAsIGJhc2VEaXIubGVuZ3RoIC0gMSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdXJsICs9ICh1cmwuc3Vic3RyKHVybC5sZW5ndGggLSAxKSAhPSAnLycgPyAnLycgOiAnJykgKyAnbGlicmFyeS5qc29uJztcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGxpYnJhcnkgPT0gdm9pZCAwKSB7XHJcbiAgICAgICAgICAgIGxpYnJhcnkgPSBuZXcgRmx1bXBMaWJyYXJ5KGJhc2VEaXIpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgbGlicmFyeS51cm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XG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBmcmFtZSA9IGZyYW1lT3JMYWJlbDtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHF1ZXVlID0gbmV3IFF1ZXVlSXRlbV8xLlF1ZXVlSXRlbShudWxsLCBmcmFtZSwgMSwgMSwgMCk7XHJcbiAgICAgICAgdGhpcy5fcXVldWUuYWRkKHF1ZXVlKTtcclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICBGbHVtcE1vdmllLnByb3RvdHlwZS5vblRpY2sgPSBmdW5jdGlvbiAoZGVsdGEsIGFjY3VtdWxhdGVkKSB7XHJcbiAgICAgICAgdmFyIG1vdmllTGF5ZXJzID0gdGhpcy5fbW92aWVMYXllcnM7XHJcbiAgICAgICAgZGVsdGEgKj0gdGhpcy5zcGVlZDtcclxuICAgICAgICBpZiAodGhpcy5wYXVzZWQgPT0gZmFsc2UpIHtcclxuICAgICAgICAgICAgdGhpcy5fcXVldWUub25UaWNrKGRlbHRhKTtcclxuICAgICAgICAgICAgdmFyIGZyYW1lID0gdGhpcy5mcmFtZTtcclxuICAgICAgICAgICAgdmFyIG5ld0ZyYW1lID0gdGhpcy5fcXVldWUuZ2V0RnJhbWUoKTtcclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBtb3ZpZUxheWVycy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgdmFyIGxheWVyID0gbW92aWVMYXllcnNbaV07XHJcbiAgICAgICAgICAgICAgICBsYXllci5vblRpY2soZGVsdGEsIGFjY3VtdWxhdGVkKTtcclxuICAgICAgICAgICAgICAgIGxheWVyLnNldEZyYW1lKG5ld0ZyYW1lKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLmZyYW1lID0gbmV3RnJhbWU7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLmdldFN5bWJvbCA9IGZ1bmN0aW9uIChuYW1lKSB7XHJcbiAgICAgICAgdmFyIGxheWVycyA9IHRoaXMuX21vdmllTGF5ZXJzO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGF5ZXJzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHZhciBsYXllciA9IGxheWVyc1tpXTtcclxuICAgICAgICAgICAgdmFyIHN5bWJvbCA9IGxheWVyLmdldFN5bWJvbChuYW1lKTtcclxuICAgICAgICAgICAgaWYgKHN5bWJvbCAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLnJlcGxhY2VTeW1ib2wgPSBmdW5jdGlvbiAobmFtZSwgc3ltYm9sKSB7XHJcbiAgICAgICAgdmFyIGxheWVycyA9IHRoaXMuX21vdmllTGF5ZXJzO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGF5ZXJzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHZhciBsYXllciA9IGxheWVyc1tpXTtcclxuICAgICAgICAgICAgaWYgKGxheWVyLnJlcGxhY2VTeW1ib2wobmFtZSwgc3ltYm9sKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLmhhbmRsZUZyYW1lQ2FsbGJhY2sgPSBmdW5jdGlvbiAoZnJvbUZyYW1lLCB0b0ZyYW1lLCBkZWx0YSkge1xyXG4gICAgICAgIGlmICh0b0ZyYW1lID4gZnJvbUZyYW1lKSB7XHJcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gZnJvbUZyYW1lOyBpbmRleCA8IHRvRnJhbWU7IGluZGV4KyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdLmNhbGwodGhpcywgZGVsdGEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRvRnJhbWUgPCBmcm9tRnJhbWUpIHtcclxuICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggPSBmcm9tRnJhbWU7IGluZGV4IDwgdGhpcy5mcmFtZXM7IGluZGV4KyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdLmNhbGwodGhpcywgZGVsdGEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMDsgaW5kZXggPCB0b0ZyYW1lOyBpbmRleCsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5fZnJhbWVDYWxsYmFja1tpbmRleF0pIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XS5jYWxsKHRoaXMsIGRlbHRhKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICBGbHVtcE1vdmllLnByb3RvdHlwZS5yZXNldCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgbGF5ZXJzID0gdGhpcy5fbW92aWVMY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gICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9IHN5bWJvbC5nZXRTeW1ib2wobmFtZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGEgIT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF0YTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICB9O1xyXG4gICAgTW92aWVMYXllci5wcm90b3R5cGUucmVwbGFjZVN5bWJvbCA9IGZ1bmN0aW9uIChuYW1lLCBpdGVtKSB7XHJcbiAgICAgICAgdmFyIHN5bWJvbHMgPSB0aGlzLl9zeW1ib2xzO1xyXG4gICAgICAgIGZvciAodmFyIHZhbCBpbiBzeW1ib2xzKSB7XHJcbiAgICAgICAgICAgIHZhciBzeW1ib2wgPSBzeW1ib2xzW3ZhbF07XHJcbiAgICAgICAgICAgIGlmIChzeW1ib2wubmFtZSA9PSBuYW1lKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl9zeW1ib2xzW3ZhbF0gPSBpdGVtO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoc3ltYm9sIGluc3RhbmNlb2YgRmx1bXBNb3ZpZV8xLkZsdW1wTW92aWUgJiYgc3ltYm9sLnJlcGxhY2VTeW1ib2wobmFtZSwgaXRlbSkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH07XHJcbiAgICBNb3ZpZUxheWVyLnByb3RvdHlwZS5vblRpY2sgPSBmdW5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ICAgIG5leHRLZXlmcmFtZSA9IHRoaXMuX2xheWVyRGF0YS5nZXRLZXlmcmFtZUFmdGVyKGtleWZyYW1lKTtcclxuICAgICAgICAgICAgaWYgKG5leHRLZXlmcmFtZSBpbnN0YW5jZW9mIEtleWZyYW1lRGF0YV8xLktleWZyYW1lRGF0YSkge1xyXG4gICAgICAgICAgICAgICAgaW50ZXJwZWQgPSAoZnJhbWUgLSBrZXlmcmFtZS5pbmRleCkgLyBrZXlmcmFtZS5kdXJhdGlvbjtcclxuICAgICAgICAgICAgICAgIGVhc2UgPSBrZXlmcmFtZS5lYXNlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGVhc2UgIT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ID0gMC4wO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChlYXNlIDwgMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW52ID0gMSAtIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gMSAtIGludiAqIGludjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzZSA9IDAgLSBlYXNlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdCA9IGludGVycGVkICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGludGVycGVkID0gZWFzZSAqIHQgKyAoMSAtIGVhc2UpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB4ID0geCArIChuZXh0S2V5ZnJhbWUueCAtIHgpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICB5ID0geSArIChuZXh0S2V5ZnJhbWUueSAtIHkpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICBzY2FsZVggPSBzY2FsZVggKy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MuZnJvbUFycmF5KGpzb24pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdmFyIGpzb25PYmplY3QgPSBqc29uO1xyXG4gICAgICAgICAgICB0aGlzLmluZGV4ID0ganNvbk9iamVjdC5pbmRleDtcclxuICAgICAgICAgICAgdGhpcy5kdXJhdGlvbiA9IGpzb25PYmplY3QuZHVyYXRpb247XHJcbiAgICAgICAgICAgIHRoaXMucmVmID0gJ3JlZicgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QucmVmIDogbnVsbDtcclxuICAgICAgICAgICAgdGhpcy5sYWJlbCA9ICdsYWJlbCcgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QubGFiZWwgOiBudWxsO1xyXG4gICAgICAgICAgICB0aGlzLnggPSAnbG9jJyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5sb2NbMF0gOiAwLjA7XHJcbiAgICAgICAgICAgIHRoaXMueSA9ICdsb2MnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LmxvY1sxXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy5zY2FsZVggPSAnc2NhbGUnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnNjYWxlWzBdIDogMS4wO1xyXG4gICAgICAgICAgICB0aGlzLnNjYWxlWSA9ICdzY2FsZScgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3Quc2NhbGVbMV0gOiAxLjA7XHJcbiAgICAgICAgICAgIHRoaXMuc2tld1ggPSAnc2tldycgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3Quc2tld1swXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy5za2V3WSA9ICdza2V3JyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5za2V3WzFdIDogMC4wO1xyXG4gICAgICAgICAgICB0aGlzLnBpdm90WCA9ICdwaXZvdCcgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QucGl2b3RbMF0gOiAwLjA7XHJcbiAgICAgICAgICAgIHRoaXMucGl2b3RZID0gJ3Bpdm90JyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5waXZvdFsxXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy52aXNpYmxlID0gJ3Zpc2libGUnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnZpc2libGUgOiB0cnVlO1xyXG4gICAgICAgICAgICB0aGlzLmFscGhhID0gJ2FscGhhJyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5hbHBoYSA6IDEuMDtcclxuICAgICAgICAgICAgdGhpcy50d2VlbmVkID0gJ3R3ZWVuZWQnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnR3ZWVuZWQgOiB0cnVlO1xyXG4gICAgICAgICAgICB0aGlzLmVhc2UgPSAnZWFzZScgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QuZWFzZSA6IDAuMDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBLZXlmcmFtZURhdGEucHJvdG90eXBlLmdldFZhbHVlT3JkZXIgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgJ2luZGV4JyxcclxuICAgICAgICAgICAgJ2R1cmF0aW9uJyxcclxuICAgICAgICAgICAgJ3JlZicsXHJcbiAgICAgICAgICAgICdsYWJlbCcsXHJcbiAgICAgICAgICAgICd4JywgJ3knLFxyXG4gICAgICAgICAgICAnc2NhbGVYJywgJ3NjYWxlWScsXHJcbiAgICAgICAgICAgICdza2V3WCcsICdza2V3WScsXHJcbiAgICAgICAgICAgICdwaXZvdFgnLCAncGl2b3RZJyxcclxuICAgICAgICAgICAgJ3Zpc2libGUnLFxyXG4gICAgICAgICAgICAnYWxwaGEnLFxyXG4gICAgICAgICAgICAndHdlZW5lZCcsXHJcbiAgICAgICAgICAgICdlYXNlJ1xyXG4gICAgICAgIF07XHJcbiAgICB9O1xyXG4gICAgS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1xyXG4gICAgfTtcclxuICAgIHJldHVybiBBbmltYXRpb25RdWV1ZTtcclxufShRdWV1ZV8xLlF1ZXVlKSk7XHJcbmV4cG9ydHMuQW5pbWF0aW9uUXVldWUgPSBBbmltYXRpb25RdWV1ZTtcclxuIiwiXCJ1c2Ugc3RyaWN0XCI7XHJcbnZhciBQcm9taXNlXzEgPSByZXF1aXJlKFwiLi4vdXRpbC9Qcm9taXNlXCIpO1xyXG52YXIgSHR0cFJlcXVlc3QgPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gSHR0cFJlcXVlc3QoKSB7XHJcbiAgICB9XHJcbiAgICBIdHRwUmVxdWVzdC5yZXF1ZXN0ID0gZnVuY3Rpb24gKG1ldGhvZCwgdXJsLCBhcmdzKSB7XHJcbiAgICAgICAgdmFyIHByb21pc2UgPSBuZXcgUHJvbWlzZV8xLlByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICB2YXIgY2xpZW50ID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XHJcbiAgICAgICAgICAgIHZhciB1cmkgPSB1cmw7XHJcbiAgICAgICAgICAgIGlmIChhcmdzICYmIChtZXRob2QgPT09ICdQT1NUJyB8fCBtZXRob2QgPT09ICdQVVQnKSkge1xyXG4gICAgICAgICAgICAgICAgdXJpICs9ICc/JztcclxuICAgICAgICAgICAgICAgIHZhciBhcmdjb3VudCA9IDA7XHJcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gYXJncykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChhcmdzLmhhc093blByb3BlcnR5KGtleSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ2NvdW50KyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVyaSArPSAnJic7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgdXJpICs9IGVuY29kZVVSSUNvbXBvbmVudChrZXkpICsgJz0nICsgZW5jb2RlVVJJQ29tcG9uZW50KGFyZ3Nba2V5XSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNsaWVudC5vcGVuKG1ldGhvZCwgdXJpKTtcclxuICAgICAgICAgICAgY2xpZW50LnNlbmQoKTtcclxuICAgICAgICAgICAgY2xpZW50Lm9ubG9hZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnN0YXR1cyA9PT0gMjAwIHx8IHRoaXMuc3RhdHVzID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnJlc3BvbnNlIHx8IHRoaXMucmVzcG9uc2VUZXh0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLnN0YXR1c1RleHQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBjbGllbnQub25lcnJvciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLnN0YXR1c1RleHQpO1xyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHJldHVybiBwcm9taXNlO1xyXG4gICAgfTtcclxuICAgIEh0dHBSZXF1ZXN0LmdldFN0cmluZyA9IGZ1bmN0aW9uICh1cmwsIHF1ZXJ5KSB7XHJcbiAgICAgICAgaWYgKHF1ZXJ5ID09PSB2b2lkIDApIHsgcXVlcnkgPSB7fTsgfVxyXG4gICAgICAgIHJldHVybiBIdHRwUmVxdWVzdC5yZXF1ZXN0KCdHRVQnLCB1cmwsIHF1ZXJ5KTtcclxuICAgIH07XHJcbiAgICBIdH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vbHZlIDogZGVmZXJyZWQucmVqZWN0KShtZS5fdmFsdWUpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciByZXQ7XHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgcmV0ID0gY2IobWUuX3ZhbHVlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2F0Y2ggKGUpIHtcclxuICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KGUpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmVycmVkLnJlc29sdmUocmV0KTtcclxuICAgIH0pO1xyXG59XHJcbmZ1bmN0aW9uIHJlc29sdmUobmV3VmFsdWUpIHtcclxuICAgIHRyeSB7XHJcbiAgICAgICAgaWYgKG5ld1ZhbHVlID09PSB0aGlzKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdBIHByb21pc2UgY2Fubm90IGJlIHJlc29sdmVkIHdpdGggaXRzZWxmLicpO1xyXG4gICAgICAgIGlmIChuZXdWYWx1ZSAmJiAodHlwZW9mIG5ld1ZhbHVlID09PSAnb2JqZWN0JyB8fCB0eXBlb2YgbmV3VmFsdWUgPT09ICdmdW5jdGlvbicpKSB7XHJcbiAgICAgICAgICAgIHZhciB0aGVuID0gbmV3VmFsdWUudGhlbjtcclxuICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGVuID09PSAnZnVuY3Rpb24nKSB7XHJcbiAgICAgICAgICAgICAgICBkb1Jlc29sdmUodGhlbi5iaW5kKG5ld1ZhbHVlKSwgcmVzb2x2ZS5iaW5kKHRoaXMpLCByZWplY3QuYmluZCh0aGlzKSk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpc1snX3N0YXRlJ10gPSB0cnVlO1xyXG4gICAgICAgIHRoaXNbJ192YWx1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AgICBmbihmdW5jdGlvbiAodmFsdWUpIHtcclxuICAgICAgICAgICAgaWYgKGRvbmUpXHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xyXG4gICAgICAgICAgICBvbkZ1bGZpbGxlZCh2YWx1ZSk7XHJcbiAgICAgICAgfSwgZnVuY3Rpb24gKHJlYXNvbikge1xyXG4gICAgICAgICAgICBpZiAoZG9uZSlcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgZG9uZSA9IHRydWU7XHJcbiAgICAgICAgICAgIG9uUmVqZWN0ZWQocmVhc29uKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGNhdGNoIChleCkge1xyXG4gICAgICAgIGlmIChkb25lKVxyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgZG9uZSA9IHRydWU7XHJcbiAgICAgICAgb25SZWplY3RlZChleCk7XHJcbiAgICB9XHJcbn1cclxudmFyIFByb21pc2UgPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gUHJvbWlzZShpbml0KSB7XHJcbiAgICAgICAgdGhpcy5fc3RhdGUgPSBudWxsO1xyXG4gICAgICAgIHRoaXMuX3ZhbHVlID0gbnVsbDtcclxuICAgICAgICB0aGlzLl9kZWZlcnJlZHMgPSBbXTtcclxuICAgICAgICBpZiAodHlwZW9mIHRoaXMgIT09ICdvYmplY3QnKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdQcm9taXNlcyBtdXN0IGJlIGNvbnN0cnVjdGVkIHZpYSBuZXcnKTtcclxuICAgICAgICBpZiAodHlwZW9mIGluaXQgIT09ICdmdW5jdGlvbicpXHJcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ25vdCBhIGZ1bmN0aW9uJyk7XHJcbiAgICAgICAgZG9SZXNvbHZlKGluaXQsIHJlc29sdmUuYmluZCh0aGlzKSwgcmVqZWN0LmJpbmQodGhpcykpO1xyXG4gICAgfVxyXG4gICAgUHJvbWlzZS5hbGwgPSBmdW5jdGlvbiAocHJvbWlzZUxpc3QpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICBpZiAocHJvbWlzZUxpc3QubGVuZ3RoID09PSAwKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoW10pO1xyXG4gICAgICAgICAgICB2YXIgcmVtYWluaW5nID0gcHJvbWlzZUxpc3QubGVuZ3RoO1xyXG4gICAgICAgICAgICBmdW5jdGlvbiByZXMoaSwgdmFsKSB7XHJcbiAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWwgJiYgKHR5cGVvZiB2YWwgPT09ICdvYmplY3QnIHx8IHR5cGVvZiB2YWwgPT09ICdmdW5jdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aGVuID0gdmFsLnRoZW47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhlbiA9PT0gJ2Z1bmN0aW9uJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlbi5jYWxsKHZhbCwgZnVuY3Rpb24gKHZhbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcyhpLCB2YWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcmVqZWN0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBwcm9taXNlTGlzdFtpXSA9IHZhbDtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoLS1yZW1haW5pbmcgPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShwcm9taXNlTGlzdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2F0Y2ggKGV4KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGV4KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHByb21pc2VMaXN0Lmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICByZXMoaSwgcHJvbWlzZUxpc3RbaV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5yZXNvbHZlID0gZnVuY3Rpb24gKHZhbHVlKSB7XHJcbiAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcgJiYgdmFsdWUuY29uc3RydWN0b3IgPT09IFByb21pc2UpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUpIHtcclxuICAgICAgICAgICAgcmVzb2x2ZSh2YWx1ZSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5yZWplY3QgPSBmdW5jdGlvbiAodmFsdWUpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICByZWplY3QodmFsdWUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfTtcclxuICAgIFByb21pc2UucmFjZSA9IGZ1bmN0aW9uICh2YWx1ZXMpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sd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JcbiAgICAgICAgdmFyIHByb2dyZXNzTGlzdCA9IFtdO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY291bnQ7IGkrKykge1xyXG4gICAgICAgICAgICBwcm9ncmVzc0xpc3QucHVzaCgwKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHBydlByb2dyZXNzID0gZnVuY3Rpb24gKGluZGV4LCBwcm9ncmVzcykge1xyXG4gICAgICAgICAgICBwcm9ncmVzc0xpc3RbaW5kZXhdID0gcHJvZ3Jlc3M7XHJcbiAgICAgICAgICAgIHZhciB0b3RhbCA9IDA7XHJcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBwcm9ncmVzc0xpc3QubGVuZ3RoO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB0b3RhbCArPSBwcm9ncmVzc0xpc3RbaV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb25Qcm9ncmVzcyh0b3RhbCAvIGNvdW50KTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHZhciBwcm9taXNlTGlzdCA9IG5ldyBBcnJheShjb3VudCk7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHByb21pc2VMaXN0W2ldID0gbGlzdFtpXS5sb2FkKHBydlByb2dyZXNzLmJpbmQodGhpcywgaSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gUHJvbWlzZVV0aWwud2FpdChwcm9taXNlTGlzdCk7XHJcbiAgICB9O1xyXG4gICAgcmV0dXJuIFByb21pc2VVdGlsO1xyXG59KCkpO1xyXG5leHBvcnRzLlByb21pc2VVdGlsID0gUHJvbWlzZVV0aWw7XHJcbiIsIlwidXNlIHN0cmljdFwiO1xyXG52YXIgUXVldWUgPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZ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HJcbiAgICAgICAgICAgIHRoaXMuX2xpc3RMZW5ndGggPSAwO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5jdXJyZW50KSB7XHJcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC50aW1lcyA9IDE7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzO1xyXG4gICAgfTtcclxuICAgIFF1ZXVlLnByb3RvdHlwZS5raWxsID0gZnVuY3Rpb24gKGFsbCkge1xyXG4gICAgICAgIGlmIChhbGwgPT09IHZvaWQgMCkgeyBhbGwgPSBmYWxzZTsgfVxyXG4gICAgICAgIGlmIChhbGwpIHtcclxuICAgICAgICAgICAgdGhpcy5fbGlzdC5sZW5ndGggPSAwO1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0TGVuZ3RoID0gMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuY3VycmVudCkge1xyXG4gICAgICAgICAgICB2YXIgY3VycmVudCA9IHRoaXMuY3VycmVudDtcclxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gbnVsbDtcclxuICAgICAgICAgICAgY3VycmVudC5maW5pc2goKTtcclxuICAgICAgICAgICAgY3VycmVudC5kZXN0cnVjdCgpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICByZXR1cm4gUXVldWU7XHJcbn0oKSk7XHJcbmV4cG9ydHMuUXVldWUgPSBRdWV1ZTtcclxuIiwiXCJ1c2Ugc3RyaWN0XCI7XHJcbnZhciBRdWV1ZUl0ZW0gPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gUXVldWVJdGVtKGxhYmVsLCBmcm9tLCB0bywgdGltZXMsIGRlbGF5KSB7XHJcbiAgICAgICAgaWYgKHRpbWVzID09PSB2b2lkIDApIHsgdGltZXMgPSAxOyB9XHJcbiAgICAgICAgaWYgKGRlbGF5ID09PSB2b2lkIDApIHsgZGV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lzLm1vdmllRGF0YSA9IFtdO1xyXG4gICAgICAgIHRoaXMudGV4dHVyZUdyb3VwcyA9IFtdO1xyXG4gICAgICAgIHRoaXMuZnBzID0gMDtcclxuICAgICAgICB0aGlzLmlzT3B0aW1pc2VkID0gZmFsc2U7XHJcbiAgICAgICAgdGhpcy5faGFzTG9hZGVkID0gZmFsc2U7XHJcbiAgICAgICAgdGhpcy5faXNMb2FkaW5nID0gZmFsc2U7XHJcbiAgICAgICAgdmFyIGEgPSAwO1xyXG4gICAgICAgIGlmIChiYXNlUGF0aCkge1xyXG4gICAgICAgICAgICB0aGlzLnVybCA9IGJhc2VQYXRoO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIEZsdW1wTGlicmFyeS5sb2FkID0gZnVuY3Rpb24gKHVybCwgbGlicmFyeSwgb25Qcm9jZXNzKSB7XHJcbiAgICAgICAgdmFyIGJhc2VEaXIgPSB1cmw7XHJcbiAgICAgICAgaWYgKHVybC5pbmRleE9mKCcuanNvbicpID4gLTEpIHtcclxuICAgICAgICAgICAgYmFzZURpciA9IHVybC5zdWJzdHIoMCwgdXJsLmxhc3RJbmRleE9mKCcvJykpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgaWYgKGJhc2VEaXIuc3Vic3RyKC0xKSA9PSAnLycpIHtcclxuICAgICAgICAgICAgICAgIGJhc2VEaXIgPSBiYXNlRGlyLnN1YnN0cigwLCBiYXNlRGlyLmxlbmd0aCAtIDEpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHVybCArPSAodXJsLnN1YnN0cih1cmwubGVuZ3RoIC0gMSkgIT0gJy8nID8gJy8nIDogJycpICsgJ2xpYnJhcnkuanNvbic7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChsaWJyYXJ5ID09IHZvaWQgMCkge1xyXG4gICAgICAgICAgICBsaWJyYXJ5ID0gbmV3IEZsdW1wTGlicmFyeShiYXNlRGlyKTtc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zLCB0ZXh0dXJlR3JvdXApO1xyXG4gICAgICAgICAgICB0ZXh0dXJlR3JvdXBMb2FkZXJzLnB1c2gocHJvbWlzZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBQcm9taXNlVXRpbF8xLlByb21pc2VVdGlsLndhaXQodGV4dHVyZUdyb3VwTG9hZGVycywgb25Qcm9jZXNzKVxyXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbiAodGV4dHVyZUdyb3Vwcykge1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRleHR1cmVHcm91cHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIHZhciB0ZXh0dXJlR3JvdXAgPSB0ZXh0dXJlR3JvdXBzW2ldO1xyXG4gICAgICAgICAgICAgICAgX3RoaXMudGV4dHVyZUdyb3Vwcy5wdXNoKHRleHR1cmVHcm91cCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgX3RoaXMuX2hhc0xvYWRlZCA9IHRydWU7XHJcbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcclxuICAgICAgICB9KTtcclxuICAgIH07XHJcbiAgICBGbHVtcExpYnJhcnkucHJvdG90eXBlLmdldE1vdmllRGF0YSA9IGZ1bmN0aW9uIChuYW1lKSB7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLm1vdmllRGF0YS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbW92aWVEYXRhID0gdGhpcy5tb3ZpZURhdGFbaV07XHJcbiAgICAgICAgICAgIGlmIChtb3ZpZURhdGEuaWQgPT0gbmFtZSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vdmllRGF0YTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ21vdmllIG5vdCBmb3VuZCcpO1xyXG4gICAgfTtcclxuICAgIEZsdW1w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IHtcclxuICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggPSBmcm9tRnJhbWU7IGluZGV4IDwgdG9GcmFtZTsgaW5kZXgrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZnJhbWVDYWxsYmFja1tpbmRleF0uY2FsbCh0aGlzLCBkZWx0YSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAodG9GcmFtZSA8IGZyb21GcmFtZSkge1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpbmRleCA9IGZyb21GcmFtZTsgaW5kZXggPCB0aGlzLmZyYW1lczsgaW5kZXgrKykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZnJhbWVDYWxsYmFja1tpbmRleF0uY2FsbCh0aGlzLCBkZWx0YSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggPSAwOyBpbmRleCA8IHRvRnJhbWU7IGluZGV4KyspIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLl9mcmFtZUNhbGxiYWNrW2luZGV4XSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2ZyYW1lQ2FsbGJhY2tbaW5kZXhdLmNhbGwodGhpcywgZGVsdGEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzO1xyXG4gICAgfTtcclxuICAgIEZsdW1wTW92aWUucHJvdG90eXBlLnJlc2V0ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgI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3JlYXRlU3ltYm9sKGtleWZyYW1lLnJlZiwgZmFsc2UpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuc2V0RnJhbWUoMCk7XHJcbiAgICB9XHJcbiAgICBNb3ZpZUxheWVyLnByb3RvdHlwZS5nZXRTeW1ib2wgPSBmdW5jdGlvbiAobmFtZSkge1xyXG4gICAgICAgIHZhciBzeW1ib2xzID0gdGhpcy5fc3ltYm9scztcclxuICAgICAgICBmb3IgKHZhciB2YWwgaW4gc3ltYm9scykge1xyXG4gICAgICAgICAgICB2YXIgc3ltYm9sID0gc3ltYm9sc1t2YWxdO1xyXG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluc3RhbmNlb2YgRmx1bXBNb3ZpZV8xLkZsdW1wTW92aWUpIHtcclxuICAgICAgICAgICAgICAgIGlmIChzeW1ib2wubmFtZSA9PSBuYW1lKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gc3ltYm9sLmdldFN5bWJvbChuYW1lKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YSAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXRhO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH07XHJcbiAgICBNb3ZpZUxheWVyLnByb3RvdHlwZS5yZXBsYWNlU3ltYm9sID0gZnVuY3Rpb24gKG5hbWUsIGl0ZW0pIHtcclxuICAgICAgICB2YXIgc3ltYm9scyA9IHRoaXMuX3N5bWJvbHM7XHJcbiAgICAgICAgZm9yICh2YXIgdmFsIGluIHN5bWJ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XJwZWQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAxIC0gaW52ICogaW52O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlYXNlID0gMCAtIGVhc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gaW50ZXJwZWQgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJwZWQgPSBlYXNlICogdCArICgxIC0gZWFzZSkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHggPSB4ICsgKG5leHRLZXlmcmFtZS54IC0geCkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIHkgPSB5ICsgKG5leHRLZXlmcmFtZS55IC0geSkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIHNjYWxlWCA9IHNjYWxlWCArIChuZXh0S2V5ZnJhbWUuc2NhbGVYIC0gc2NhbGVYKSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgc2NhbGVZID0gc2NhbGVZICsgKG5leHRLZXlmcmFtZS5zY2FsZVkgLSBzY2FsZVkpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgICAgICBza2V3WCA9IHNrZXdYICsgKG5leHRLZXlmcmFtZS5za2V3WCAtIHNrZXdYKSAqIGludGVycGVkO1xyXG4gICAgICAgICAgICAgICAgc2tld1kgPSBza2V3WSArIChuZXh0S2V5ZnJhbWUuc2tld1kgLSBza2V3WSkgKiBpbnRlcnBlZDtcclxuICAgICAgICAgICAgICAgIGFscGhhID0gYWxwaGEgKyAobmV4dEtleWZyYW1lLmFscGhhIC0gYWxwaGEpICogaW50ZXJwZWQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNrZXdYICE9IDApIHtcclxuICAgICAgICAgICAgc2luWCA9IE1hdGguc2luKHNrZXdYKTtcclxuICAgICAgICAgICAgY29zWCA9IE1hdGguY29zKHNrZXdYKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNrZXdZICE9IDApIHtcclxuICAgICAgICAgICAgc2luWSA9IE1hdGguc2luKHNrZXdZKTtcclxuICAgICAgICAgICAgY29zWSA9IE1hdGguY29zKHNrZXdZKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5fc3ltYm9sLnBvc2l0aW9uLnNldCh4LCB5KTtcclxuICAgICAgICB0aGlzLl9zeW1ib2wuc2NhbGUuc2V0KHNjYWxlWCwgc2NhbGVZKTtcclxuICAgICAgICBpZiAoISh0aGlzLl9zeW1ib2wgaW5zdGFuY2VvZiBQSVhJLlNwcml0ZSkpIHtcclxuICAgICAgICAgICAgdGhpcy5fc3ltYm9sWydwaXZvdCddLnggPSBwaXZvdFg7XHJcbiAgICAgICAgICAgIHRoaXMuX3N5bWJvbFsncGl2b3QnXS55ID0gcGl2b3RZO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLl9zeW1ib2xbJ3NrZXcnXS5zZXQoc2tld1gsIHNrZXdZKTtcclxuICAgICAgICB0aGlzLmFscGhhID0gYWxwaGE7XHJcbiAgICAgICAgdGhpcy52aXNpYmxlID0ga2V5ZnJhbWUudmlzaWJsZTtcclxuICAgICAgICB0aGlzLl9mcmFtZSA9IGZyYW1lO1xyXG4gICAgfTtcclxuICAgIE1vdmllTGF5ZXIucHJvdG90eXBlLnJlc2V0ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmICh0aGlzLl9zeW1ib2wgaW5zdGFuY2VvZiBGbHVtcE1vdmllXzEuRmx1bXBNb3ZpZSkge1xyXG4gICAgICAgICAgICB0aGlzLl9zeW1ib2wucmVzZXQoKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiB0aGlzLl9ze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gICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXRsYXNlcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgYXRsYXMgPSBhdGxhc2VzW2ldO1xyXG4gICAgICAgICAgICBsb2FkZXJzLnB1c2goVGV4dHVyZUdyb3VwQXRsYXNfMS5UZXh0dXJlR3JvdXBBdGxhcy5sb2FkKGxpYnJhcnksIGF0bGFzKSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBQcm9taXNlXzEuUHJvbWlzZS5hbGwobG9hZGVycykudGhlbihmdW5jdGlvbiAoYXRsYXNlcykge1xyXG4gICAgICAgICAgICB2YXIgbmFtZXMgPSBbXTtcclxuICAgICAgICAgICAgdmFyIHRleHR1cmVzID0gW107XHJcbiAgICAgICAgICAgIHZhciBhbmNvcnMgPSBbXTtcclxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhdGxhc2VzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB2YXIgYXRsYXMgPSBhdGxhc2VzW2ldO1xyXG4gICAgICAgICAgICAgICAgbmFtZXMgPSBuYW1lcy5jb25jYXQoYXRsYXMuZ2V0TmFtZXMoKSk7XHJcbiAgICAgICAgICAgICAgICB0ZXh0dXJlcyA9IHRleHR1cmVzLmNvbmNhdChhdGxhcy5nZXRUZXh0dXJlcygpKTtcclxuICAgICAgICAgICAgICAgIGFuY29ycyA9IGFuY29ycy5jb25jYXQoYXRsYXMuZ2V0QW5jaG9ycygpKTtcclxuICAgICAgICAgICAgICAgIGF0bGFzLmRlc3RydWN0KCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIG5ldyBUZXh0dXJlR3JvdXAobmFtZXMsIHRleHR1cmVzLCBhbmNvcnMpO1xyXG4gICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uIChlcnIpIHtcclxuICAgICAgICAgICAgY29uc29sZS53YXJuKCdjb3VsZCBub3Qgb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ZS5vcmlnaW5bMV0gLyBhdGxhc1RleHR1cmUucmVjdFszXSkpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIFRleHR1cmVHcm91cEF0bGFzLmxvYWQgPSBmdW5jdGlvbiAobGlicmFyeSwganNvbikge1xyXG4gICAgICAgIHZhciBmaWxlID0ganNvbi5maWxlO1xyXG4gICAgICAgIHZhciB1cmwgPSBsaWJyYXJ5LnVybCArICcvJyArIGZpbGU7XHJcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlXzEuUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XHJcbiAgICAgICAgICAgIHZhciBpbWcgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbWcnKTtcclxuICAgICAgICAgICAgaW1nLm9ubG9hZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHJlc29sdmUoaW1nKTtcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgaW1nLm9uZXJyb3IgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICByZWplY3QoKTtcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgaW1nLnNyYyA9IHVybDtcclxuICAgICAgICB9KS50aGVuKGZ1bmN0aW9uIChkYXRhKSB7IHJldHVybiBuZXcgVGV4dHVyZUdyb3VwQXRsYXMoZGF0YSwganNvbik7IH0pO1xyXG4gICAgfTtcclxuICAgIFRleHR1cmVHcm91cEF0bGFzLnByb3RvdHlwZS5nZXROYW1lcyA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5fbmFtZXM7XHJcbiAgICB9O1xyXG4gICAgVGV4dHVyZUdyb3VwQXRsYXMucHJvdG90eXBlLmdldFRleHR1cmVzID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl90ZXh0dXJlcztcclxuICAgIH07XHJcbiAgICBUZXh0dXJlR3JvdX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AgICAgICAgICB0aGlzLnggPSAnbG9jJyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5sb2NbMF0gOiAwLjA7XHJcbiAgICAgICAgICAgIHRoaXMueSA9ICdsb2MnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LmxvY1sxXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy5zY2FsZVggPSAnc2NhbGUnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnNjYWxlWzBdIDogMS4wO1xyXG4gICAgICAgICAgICB0aGlzLnNjYWxlWSA9ICdzY2FsZScgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3Quc2NhbGVbMV0gOiAxLjA7XHJcbiAgICAgICAgICAgIHRoaXMuc2tld1ggPSAnc2tldycgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3Quc2tld1swXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy5za2V3WSA9ICdza2V3JyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5za2V3WzFdIDogMC4wO1xyXG4gICAgICAgICAgICB0aGlzLnBpdm90WCA9ICdwaXZvdCcgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QucGl2b3RbMF0gOiAwLjA7XHJcbiAgICAgICAgICAgIHRoaXMucGl2b3RZID0gJ3Bpdm90JyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5waXZvdFsxXSA6IDAuMDtcclxuICAgICAgICAgICAgdGhpcy52aXNpYmxlID0gJ3Zpc2libGUnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnZpc2libGUgOiB0cnVlO1xyXG4gICAgICAgICAgICB0aGlzLmFscGhhID0gJ2FscGhhJyBpbiBqc29uT2JqZWN0ID8ganNvbk9iamVjdC5hbHBoYSA6IDEuMDtcclxuICAgICAgICAgICAgdGhpcy50d2VlbmVkID0gJ3R3ZWVuZWQnIGluIGpzb25PYmplY3QgPyBqc29uT2JqZWN0LnR3ZWVuZWQgOiB0cnVlO1xyXG4gICAgICAgICAgICB0aGlzLmVhc2UgPSAnZWFzZScgaW4ganNvbk9iamVjdCA/IGpzb25PYmplY3QuZWFzZSA6IDAuMDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBLZXlmcmFtZURhdGEucHJvdG90eXBlLmdldFZhbHVlT3JkZXIgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgJ2luZGV4JyxcclxuICAgICAgICAgICAgJ2R1cmF0aW9uJyxcclxuICAgICAgICAgICAgJ3JlZicsXHJcbiAgICAgICAgICAgICdsYWJlbCcsXHJcbiAgICAgICAgICAgICd4JywgJ3knLFxyXG4gICAgICAgICAgICAnc2NhbGVYJywgJ3NjYWxlWScsXHJcbiAgICAgICAgICAgICdza2V3WCcsICdza2V3WScsXHJcbiAgICAgICAgICAgICdwaXZvdFgnLCAncGl2b3RZJyxcclxuICAgICAgICAgICAgJ3Zpc2libGUnLFxyXG4gICAgICAgICAgICAnYWxwaGEnLFxyXG4gICAgICAgICAgICAndHdlZW5lZCcsXHJcbiAgICAgICAgICAgICdlYXNlJ1xyXG4gICAgICAgIF07XHJcbiAgICB9O1xyXG4gICAgS2V5ZnJhbWVEYXRhLnByb3RvdHlwZS50b0FycmF5ID0gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIHZhciBvcmRlciA9IHRoaXMuZ2V0VmFsdWVPcmRlcigpO1xyXG4gICAgICAgIHZhciBkYXRhID0gbmV3IEFycmF5KG9yZGVyLmxlbmd0aCk7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvcmRlci5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB2YXIgbmFtZSA9IG9yZGVyW2ldO1xyXG4gICAgICAgICAgICBkYXRhW2ldID0gdGhpc1tuYW1lXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGRhdGE7XHJcbiAgICB9O1xyXG4gICAgS2V5ZnJ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biA9IGN1cnJlbnQuZHVyYXRpb247XHJcbiAgICAgICAgICAgIHZhciB0aW1lcyA9IGN1cnJlbnQudGltZXM7XHJcbiAgICAgICAgICAgIHZhciBmcmFtZSA9IChkdXJhdGlvbiAqIHRpbWUgLyAoZHVyYXRpb24gKiB0aGlzLl9mcG1zKSk7XHJcbiAgICAgICAgICAgIGlmICh0aW1lcyA+IC0xICYmIHRpbWVzIC0gKGZyYW1lIC8gZHVyYXRpb24pIDwgMCkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5uZXh0KCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmZyYW1lID0gZnJvbSArIChmcmFtZSAlIGR1cmF0aW9uKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBBbmltYXRpb25RdWV1ZS5wcm90b3R5cGUuaGFzU3RvcHBlZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gIXRoaXMuY3VycmVudCAmJiAhdGhpcy5oYXNOZXh0KCk7XHJcbiAgICB9O1xyXG4gICAgQW5pbWF0aW9uUXVldWUucHJvdG90eXBlLm5leHQgPSBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgdmFyIG5leHQgPSBfc3VwZXIucHJvdG90eXBlLm5leHQuY2FsbCh0aGlzKTtcclxuICAgICAgICBpZiAobmV4dCkge1xyXG4gICAgICAgICAgICB0aGlzLnJlc2V0KCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBuZXh0O1xyXG4gICAgfTtcclxuICAgIEFuaW1hdGlvblF1ZXVlLnByb3RvdHlwZS5nZXRGcmFtZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICByZXR1cm4gdGhpcy5mcmFtZTtcclxuICAgIH07XHJcbiAgICBBbmltYXRpb25RdWV1ZS5wcm90b3R5cGUucmVzZXQgPSBmdW5jdGlvbi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uICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVyaSArPSAnJic7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgdXJpICs9IGVuY29kZVVSSUNvbXBvbmVudChrZXkpICsgJz0nICsgZW5jb2RlVVJJQ29tcG9uZW50KGFyZ3Nba2V5XSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNsaWVudC5vcGVuKG1ldGhvZCwgdXJpKTtcclxuICAgICAgICAgICAgY2xpZW50LnNlbmQoKTtcclxuICAgICAgICAgICAgY2xpZW50Lm9ubG9hZCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnN0YXR1cyA9PT0gMjAwIHx8IHRoaXMuc3RhdHVzID09PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnJlc3BvbnNlIHx8IHRoaXMucmVzcG9uc2VUZXh0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLnN0YXR1c1RleHQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBjbGllbnQub25lcnJvciA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLnN0YXR1c1RleHQpO1xyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIHJldHVybiBwcm9taXNlO1xyXG4gICAgfTtcclxuICAgIEh0dHBSZXF1ZXN0LmdldFN0cmluZyA9IGZ1bmN0aW9uICh1cmwsIHF1ZXJ5KSB7XHJcbiAgICAgICAgaWYgKHF1ZXJ5ID09PSB2b2lkIDApIHsgcXVlcnkgP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Lm9uUmVqZWN0ZWQ7XHJcbiAgICAgICAgaWYgKGNiID09PSBudWxsKSB7XHJcbiAgICAgICAgICAgIChtZVsnX3N0YXRlJ10gPyBkZWZlcnJlZC5yZXNvbHZlIDogZGVmZXJyZWQucmVqZWN0KShtZS5fdmFsdWUpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHZhciByZXQ7XHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgcmV0ID0gY2IobWUuX3ZhbHVlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2F0Y2ggKGUpIHtcclxuICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KGUpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmVycmVkLnJlc29sdmUocmV0KTtcclxuICAgIH0pO1xyXG59XHJcbmZ1bmN0aW9uIHJlc29sdmUobmV3VmFsdWUpIHtcclxuICAgIHRyeSB7XHJcbiAgICAgICAgaWYgKG5ld1ZhbHVlID09PSB0aGlzKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdBIHByb21pc2UgY2Fubm90IGJlIHJlc29sdmVkIHdpdGggaXRzZWxmLicpO1xyXG4gICAgICAgIGlmIChuZXdWYWx1ZSAmJiAodHlwZW9mIG5ld1ZhbHVlID09PSAnb2JqZWN0JyB8fCB0eXBlb2YgbmV3VmFsdWUgPT09ICdmdW5jdGlvbicpKSB7XHJcbiAgICAgICAgICAgIHZhciB0aGVuID0gbmV3VmFsdWUudGhlbjtcclxuICAgICAgICAgICAgaWYgKHR5cGVvZiB0aGVuID09PSAnZnVuY3Rpb24nKSB7XHJcbiAgICAgICAgICAgICAgICBkb1Jlc29sdmUodGhlbi5iaW5kKG5ld1ZhbHVlKSwgcmVzb2x2ZS5iaW5kKHRoaXMpLCByZWplY3QuYmluZCh0aGlzKSk7XHJcbiAgICAgICAgICAgICAgICByZXR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b1Jlc29sdmUoZm4sIG9uRnVsZmlsbGVkLCBvblJlamVjdGVkKSB7XHJcbiAgICB2YXIgZG9uZSA9IGZhbHNlO1xyXG4gICAgdHJ5IHtcclxuICAgICAgICBmbihmdW5jdGlvbiAodmFsdWUpIHtcclxuICAgICAgICAgICAgaWYgKGRvbmUpXHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIGRvbmUgPSB0cnVlO1xyXG4gICAgICAgICAgICBvbkZ1bGZpbGxlZCh2YWx1ZSk7XHJcbiAgICAgICAgfSwgZnVuY3Rpb24gKHJlYXNvbikge1xyXG4gICAgICAgICAgICBpZiAoZG9uZSlcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgZG9uZSA9IHRydWU7XHJcbiAgICAgICAgICAgIG9uUmVqZWN0ZWQocmVhc29uKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGNhdGNoIChleCkge1xyXG4gICAgICAgIGlmIChkb25lKVxyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgZG9uZSA9IHRydWU7XHJcbiAgICAgICAgb25SZWplY3RlZChleCk7XHJcbiAgICB9XHJcbn1cclxudmFyIFByb21pc2UgPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gUHJvbWlzZShpbml0KSB7XHJcbiAgICAgICAgdGhpcy5fc3RhdGUgPSBudWxsO1xyXG4gICAgICAgIHRoaXMuX3ZhbHVlID0gbnVsbDtcclxuICAgICAgICB0aGlzLl9kZWZlcnJlZHMgPSBbXTtcclxuICAgICAgICBpZiAodHlwZW9mIHRoaXMgIT09ICdvYmplY3QnKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdQcm9taXNlcyBtdXN0IGJlIGNvbnN0cnVjdGVkIHZpYSBuZXcnKTtcclxuICAgICAgICBpZiAodHlwZW9mIGluaXQgIT09ICdmdW5jdGlvbicpXHJcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ25vdCBhIGZ1bmN0aW9uJyk7XHJcbiAgICAgICAgZG9SZXNvbHZlKGluaXQsIHJlc29sdmUuYmluZCh0aGlzKSwgcmVqZWN0LmJpbmQodGhpcykpO1xyXG4gICAgfVxyXG4gICAgUHJvbWlzZS5hbGwgPSBmdW5jdGlvbiAocHJvbWlzZUxpc3QpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICBpZiAocHJvbWlzZUxpc3QubGVuZ3RoID09PSAwKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoW10pO1xyXG4gICAgICAgICAgICB2YXIgcmVtYWluaW5nID0gcHJvbWlzZUxpc3QubGVuZ3RoO1xyXG4gICAgICAgICAgICBmdW5jdGlvbiByZXMoaSwgdmFsKSB7XHJcbiAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWwgJiYgKHR5cGVvZiB2YWwgPT09ICdvYmplY3QnIHx8IHR5cGVvZiB2YWwgPT09ICdmdW5jdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aGVuID0gdmFsLnRoZW47XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdGhlbiA9PT0gJ2Z1bmN0aW9uJykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlbi5jYWxsKHZhbCwgZnVuY3Rpb24gKHZhbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcyhpLCB2YWwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcmVqZWN0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBwcm9taXNlTGlzdFtpXSA9IHZhbDtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoLS1yZW1haW5pbmcgPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShwcm9taXNlTGlzdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2F0Y2ggKGV4KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGV4KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHByb21pc2VMaXN0Lmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICByZXMoaSwgcHJvbWlzZUxpc3RbaV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5yZXNvbHZlID0gZnVuY3Rpb24gKHZhbHVlKSB7XHJcbiAgICAgICAgaWYgKHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcgJiYgdmFsdWUuY29uc3RydWN0b3IgPT09IFByb21pc2UpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUpIHtcclxuICAgICAgICAgICAgcmVzb2x2ZSh2YWx1ZSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgUHJvbWlzZS5yZWplY3QgPSBmdW5jdGlvbiAodmFsdWUpIHtcclxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xyXG4gICAgICAgICAgICByZWplY3QodmFsdWUpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgf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2lkIDApIHsgb25Qcm9ncmVzcyA9IGZ1bmN0aW9uIChwcm9ncmVzcykgeyB9OyB9XHJcbiAgICAgICAgdmFyIGNvdW50ID0gbGlzdC5sZW5ndGg7XHJcbiAgICAgICAgdmFyIHByb2dyZXNzTGlzdCA9IFtdO1xyXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY291bnQ7IGkrKykge1xyXG4gICAgICAgICAgICBwcm9ncmVzc0xpc3QucHVzaCgwKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgdmFyIHBydlByb2dyZXNzID0gZnVuY3Rpb24gKGluZGV4LCBwcm9ncmVzcykge1xyXG4gICAgICAgICAgICBwcm9ncmVzc0xpc3RbaW5kZXhdID0gcHJvZ3Jlc3M7XHJcbiAgICAgICAgICAgIHZhciB0b3RhbCA9IDA7XHJcbiAgICAgICAgICAgIHZhciBsZW5ndGggPSBwcm9ncmVzc0xpc3QubGVuZ3RoO1xyXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB0b3RhbCArPSBwcm9ncmVzc0xpc3RbaV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb25Qcm9ncmVzcyh0b3RhbCAvIGNvdW50KTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIHZhciBwcm9taXNlTGlzdCA9IG5ldyBBcnJheShjb3VudCk7XHJcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHByb21pc2VMaXN0W2ldID0gbGlzdFtpXS5sb2FkKHBydlByb2dyZXNzLmJpbmQodGhpcywgaSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gUHJvbWlzZVV0aWwud2FpdChwcm9taXNlTGlzdCk7XHJcbiAgICB9O1xyXG4gICAgcmV0dXJuIFByb21pc2VVdGlsO1xyXG59KCkpO1xyXG5leHBvcnRz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0gdm9pZCAwKSB7IGFsbCA9IGZhbHNlOyB9XHJcbiAgICAgICAgaWYgKGFsbCkge1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0Lmxlbmd0aCA9IDA7XHJcbiAgICAgICAgICAgIHRoaXMuX2xpc3RMZW5ndGggPSAwO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodGhpcy5jdXJyZW50KSB7XHJcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC50aW1lcyA9IDE7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzO1xyXG4gICAgfTtcclxuICAgIFF1ZXVlLnByb3RvdHlwZS5raWxsID0gZnVuY3Rpb24gKGFsbCkge1xyXG4gICAgICAgIGlmIChhbGwgPT09IHZvaWQgMCkgeyBhbGwgPSBmYWxzZTsgfVxyXG4gICAgICAgIGlmIChhbGwpIHtcclxuICAgICAgICAgICAgdGhpcy5fbGlzdC5sZW5ndGggPSAwO1xyXG4gICAgICAgICAgICB0aGlzLl9saXN0TGVuZ3RoID0gMDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHRoaXMuY3VycmVudCkge1xyXG4gICAgICAgICAgICB2YXIgY3VycmVudCA9IHRoaXMuY3VycmVudDtcclxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gbnVsbDtcclxuICAgICAgICAgICAgY3VycmVudC5maW5pc2goKTtcclxuICAgICAgICAgICAgY3VycmVudC5kZXN0cnVjdCgpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGhpcztcclxuICAgIH07XHJcbiAgICByZXR1cm4gUXVldWU7XHJcbn0oKSk7XHJcbmV4cG9ydHMuUXVldWUgPSBRdWV1ZTtcclxuIiwiXCJ1c2Ugc3RyaWN0XCI7XHJcbnZhciBRdWV1ZUl0ZW0gPSAoZnVuY3Rpb24gKCkge1xyXG4gICAgZnVuY3Rpb24gUXVldWVJdGVtKGxhYmVsLCBmcm9tLCB0bywgdGltZXMsIGRlbGF5K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xyXG4gICAgICAgIHRoaXMuX2NvbXBsZXRlID0gbnVsbDtcclxuICAgIH07XHJcbiAgICByZXR1cm4gUXVldWVJdGVtO1xyXG59KCkpO1xyXG5leHBvcnRzLlF1ZXVlSXRlbSA9IFF1ZXVlSXRlbTtcclxuIl19 //# sourceMappingURL=pixi-flump.js.map diff --git a/bin/pixi-flump.js.map b/bin/pixi-flump.js.map index fc68a76..6071eab 100644 --- a/bin/pixi-flump.js.map +++ b/bin/pixi-flump.js.map @@ -1 +1 @@ -{"version":3,"sources":["pixi-flump.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GATA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pixi-flump.js","sourceRoot":"./","sourcesContent":[]} \ No newline at end of file +{"version":3,"sources":["pixi-flump.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GATA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pixi-flump.js","sourceRoot":"./","sourcesContent":[]} \ No newline at end of file diff --git a/bin/pixi-flump.min.js b/bin/pixi-flump.min.js index 7694cdf..c3812af 100644 --- a/bin/pixi-flump.min.js +++ b/bin/pixi-flump.min.js @@ -1,2 +1,2 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.PIXI||(e.PIXI={})).FlumpLibrary=t()}}(function(){return function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return n(r?r:t)},h,h.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s-1?o=e.substr(0,e.lastIndexOf("/")):("/"==o.substr(-1)&&(o=o.substr(0,o.length-1)),e+=("/"!=e.substr(e.length-1)?"/":"")+"library.json"),void 0==r?r=new t(o):r.url=o,n.HttpRequest.getJSON(e).then(function(t){return r.processData(t,i)})},t.prototype.hasLoaded=function(){return this._hasLoaded},t.prototype.isLoading=function(){return this._isLoading},t.prototype.load=function(e){if(this.hasLoaded())return e(1),i.Promise.resolve(this);if(!this.url)throw new Error("url is not set and there for can not be loaded");return t.load(this.url,this,e)["catch"](function(){throw new Error("could not load library")})},t.prototype.processData=function(t,e){var r=this;this.md5=t.md5,this.frameRate=t.frameRate,this.referenceList=t.referenceList||null,this.isOptimised=t.optimised||!1;for(var i=[],n=0;na;a++){var u=i[a];o[a]=new s.MovieLayer(a,this,e,u),this.addChild(o[a])}this._movieLayers=o,this.frames=this._movieData.frames,this._frameCallback=new Array(this.frames);for(var a=0;at)for(var i=t;e>i;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r);else if(t>e){for(var i=t;ii;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r)}return this},e.prototype.reset=function(){for(var t=this._movieLayers,e=0;ei){var d=1-n;y=1-d*d,i=0-i}else y=n*n;n=i*y+(1-i)*n}s+=(o.x-s)*n,u+=(o.y-u)*n,l+=(o.scaleX-l)*n,h+=(o.scaleY-h)*n,f+=(o.skewX-f)*n,c+=(o.skewY-c)*n,v+=(o.alpha-v)*n}t.setTransform(s,u,l,h,0,f,c,p,m),t.visible=e.visible,t.alpha=v,this._frame=r},e.prototype.reset=function(){this._symbol instanceof o.FlumpMovie&&this._symbol.reset();for(var t in this._symbols){var e=this._symbols[t];e instanceof o.FlumpMovie&&e.reset()}},e}(PIXI.Container);r.MovieLayer=u},{"../data/KeyframeData":7,"../data/LabelData":8,"./FlumpMovie":2,"./FlumpMtx":3}],5:[function(t,e,r){"use strict";var i=t("./TextureGroupAtlas"),n=t("../util/Promise"),o=function(){function t(t){this.sprites={};for(var e=0;et)return e[r-1];return e[e.length-1]},t.prototype.getKeyframeAfter=function(t){for(var e=0;e-1&&0>o-s/n?this.next():this.frame=i+s%n}},e.prototype.hasStopped=function(){return!this.current&&!this.hasNext()},e.prototype.next=function(){var e=t.prototype.next.call(this);return e&&this.reset(),e},e.prototype.getFrame=function(){return this.frame},e.prototype.reset=function(){this._freeze=!1,this._time=this._time%this._fpms},e}(n.Queue);r.AnimationQueue=o},{"./Queue":16}],13:[function(t,e,r){"use strict";var i=t("../util/Promise"),n=function(){function t(){}return t.request=function(t,e,r){var n=new i.Promise(function(i,n){var o=new XMLHttpRequest,s=e;if(r&&("POST"===t||"PUT"===t)){s+="?";var a=0;for(var u in r)r.hasOwnProperty(u)&&(a++&&(s+="&"),s+=encodeURIComponent(u)+"="+encodeURIComponent(r[u]))}o.open(t,s),o.send(),o.onload=function(){200===this.status||0===this.status?i(this.response||this.responseText):n(this.statusText)},o.onerror=function(){n(this.statusText)}});return n},t.getString=function(e,r){return void 0===r&&(r={}),t.request("GET",e,r)},t.getJSON=function(e,r){return void 0===r&&(r={}),t.getString(e,r).then(function(t){return JSON.parse(t)})},t}();r.HttpRequest=n},{"../util/Promise":14}],14:[function(t,e,r){"use strict";function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return void(e._state?t.resolve:t.reject)(e._value);var i;try{i=r(e._value)}catch(n){return void t.reject(n)}t.resolve(i)})}function n(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void u(e.bind(t),n.bind(this),o.bind(this))}this._state=!0,this._value=t,s.call(this)}catch(r){o.call(this,r)}}function o(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=i}function u(t,e,r){var i=!1;try{t(function(t){i||(i=!0,e(t))},function(t){i||(i=!0,r(t))})}catch(n){if(i)return;i=!0,r(n)}}var l="function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,i=function(){},n=function(){return r.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),n.prototype=new i,n});var h=(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},function(){function t(t){if(this._state=null,this._value=null,this._deferreds=[],"object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");u(t,n.bind(this),o.bind(this))}return t.all=function(e){return new t(function(t,r){function i(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(o,t)},r)}e[o]=s,0===--n&&t(e)}catch(u){r(u)}}if(0===e.length)return t([]);for(var n=e.length,o=0;oi;i++)e[i].then(t,r)})},t._setImmediateFn=function(t){l=t},t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(e,r){var n=this;return new t(function(t,o){i.call(n,new a(e,r,t,o))})},t}());r.Promise=h},{}],15:[function(t,e,r){"use strict";var i=t("./Promise"),n=function(){function t(){}return t.wait=function(t,e){return void 0===e&&(e=function(t){}),new i.Promise(function(r){for(var i=[],n=function(n){i.push(n),e(i.length/t.length),i.length==t.length&&r(i)},o=0;oo;o++)n.push(0);for(var s=function(t,e){n[t]=e;for(var o=0,s=n.length,a=0;s>a;a++)o+=n[a];r(o/i)},a=new Array(i),o=0;i>o;o++)a[o]=e[o].load(s.bind(this,o));return t.wait(a)},t}();r.PromiseUtil=n},{"./Promise":14}],16:[function(t,e,r){"use strict";var i=function(){function t(){this._list=[],this._listLength=0,this.current=null}return t.prototype.add=function(t){return this._list.push(t),this._listLength++,this},t.prototype.next=function(){return this.kill(),this._listLength>0?(this.current=this._list.shift(),this._listLength--):this.current=null,this.current},t.prototype.hasNext=function(){return this._listLength>0},t.prototype.end=function(t){return void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current&&(this.current.times=1),this},t.prototype.kill=function(t){if(void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current){var e=this.current;this.current=null,e.finish(),e.destruct()}return this},t}();r.Queue=i},{}],17:[function(t,e,r){"use strict";var i=function(){function t(t,e,r,i,n){if(void 0===i&&(i=1),void 0===n&&(n=0),this._complete=null,e>r)throw new Error('argument "from" cannot be bigger than argument "to"');this.label=t,this.from=e,this.to=r,this.duration=r-e,this.times=i,this.delay=n}return t.prototype.then=function(t){return this._complete=t,this},t.prototype.finish=function(){return this._complete&&this._complete.call(this),this},t.prototype.destruct=function(){this.label=null,this._complete=null},t}();r.QueueItem=i},{}]},{},[11])(11)}); +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.PIXI||(e.PIXI={})).FlumpLibrary=t()}}(function(){return function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return n(r?r:t)},h,h.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s-1?o=e.substr(0,e.lastIndexOf("/")):("/"==o.substr(-1)&&(o=o.substr(0,o.length-1)),e+=("/"!=e.substr(e.length-1)?"/":"")+"library.json"),void 0==r?r=new t(o):r.url=o,n.HttpRequest.getJSON(e).then(function(t){return r.processData(t,i)})},t.prototype.hasLoaded=function(){return this._hasLoaded},t.prototype.isLoading=function(){return this._isLoading},t.prototype.load=function(e){if(this.hasLoaded())return e(1),i.Promise.resolve(this);if(!this.url)throw new Error("url is not set and there for can not be loaded");return t.load(this.url,this,e)["catch"](function(){throw new Error("could not load library")})},t.prototype.processData=function(t,e){var r=this;this.md5=t.md5,this.frameRate=t.frameRate,this.referenceList=t.referenceList||null,this.isOptimised=t.optimised||!1;for(var i=[],n=0;na;a++){var u=i[a];o[a]=new s.MovieLayer(a,this,e,u),this.addChild(o[a])}this._movieLayers=o,this.frames=this._movieData.frames,this._frameCallback=new Array(this.frames);for(var a=0;at)for(var i=t;e>i;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r);else if(t>e){for(var i=t;ii;i++)this._frameCallback[i]&&this._frameCallback[i].call(this,r)}return this},e.prototype.reset=function(){for(var t=this._movieLayers,e=0;ei){var g=1-n;w=1-g*g,i=0-i}else w=n*n;n=i*w+(1-i)*n}f+=(o.x-f)*n,c+=(o.y-c)*n,p+=(o.scaleX-p)*n,m+=(o.scaleY-m)*n,y+=(o.skewX-y)*n,v+=(o.skewY-v)*n,b+=(o.alpha-b)*n}0!=y&&(a=Math.sin(y),u=Math.cos(y)),0!=v&&(l=Math.sin(v),h=Math.cos(v)),this._symbol.position.set(f,c),this._symbol.scale.set(p,m),this._symbol instanceof PIXI.Sprite||(this._symbol.pivot.x=d,this._symbol.pivot.y=_),this._symbol.skew.set(y,v),this.alpha=b,this.visible=e.visible,this._frame=r},e.prototype.reset=function(){this._symbol instanceof n.FlumpMovie&&this._symbol.reset();for(var t in this._symbols){var e=this._symbols[t];e instanceof n.FlumpMovie&&e.reset()}},e}(PIXI.Container);r.MovieLayer=a},{"../data/KeyframeData":6,"../data/LabelData":7,"./FlumpMovie":2}],4:[function(t,e,r){"use strict";var i=t("./TextureGroupAtlas"),n=t("../util/Promise"),o=function(){function t(t,e,r){this._names=[],this._textures=[],this._ancors=[],this._names=t,this._textures=e,this._ancors=r}return t.load=function(e,r){for(var o=r.atlases,s=[],a=0;a-1},t.prototype.createSprite=function(t){var e=this._names.indexOf(t),r=new PIXI.Sprite(this._textures[e]);return r.anchor.set(this._ancors[e].x,this._ancors[e].y),r.name=t,r},t}();r.TextureGroup=o},{"../util/Promise":13,"./TextureGroupAtlas":5}],5:[function(t,e,r){"use strict";var i=t("../util/Promise"),n=PIXI.Texture,o=PIXI.BaseTexture,s=PIXI.Rectangle,a=PIXI.Point,u=function(){function t(t,e){this._names=[],this._textures=[],this._anchors=[],this._baseTexture=new o(t),this._atlas=e;for(var r=this._atlas.textures,i=this._baseTexture,u=0;ut)return e[r-1];return e[e.length-1]},t.prototype.getKeyframeAfter=function(t){for(var e=0;e-1&&0>o-s/n?this.next():this.frame=i+s%n}},e.prototype.hasStopped=function(){return!this.current&&!this.hasNext()},e.prototype.next=function(){var e=t.prototype.next.call(this);return e&&this.reset(),e},e.prototype.getFrame=function(){return this.frame},e.prototype.reset=function(){this._freeze=!1,this._time=this._time%this._fpms},e}(n.Queue);r.AnimationQueue=o},{"./Queue":15}],12:[function(t,e,r){"use strict";var i=t("../util/Promise"),n=function(){function t(){}return t.request=function(t,e,r){var n=new i.Promise(function(i,n){var o=new XMLHttpRequest,s=e;if(r&&("POST"===t||"PUT"===t)){s+="?";var a=0;for(var u in r)r.hasOwnProperty(u)&&(a++&&(s+="&"),s+=encodeURIComponent(u)+"="+encodeURIComponent(r[u]))}o.open(t,s),o.send(),o.onload=function(){200===this.status||0===this.status?i(this.response||this.responseText):n(this.statusText)},o.onerror=function(){n(this.statusText)}});return n},t.getString=function(e,r){return void 0===r&&(r={}),t.request("GET",e,r)},t.getJSON=function(e,r){return void 0===r&&(r={}),t.getString(e,r).then(function(t){return JSON.parse(t)})},t}();r.HttpRequest=n},{"../util/Promise":13}],13:[function(t,e,r){"use strict";function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return void(e._state?t.resolve:t.reject)(e._value);var i;try{i=r(e._value)}catch(n){return void t.reject(n)}t.resolve(i)})}function n(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void u(e.bind(t),n.bind(this),o.bind(this))}this._state=!0,this._value=t,s.call(this)}catch(r){o.call(this,r)}}function o(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,r,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=r,this.reject=i}function u(t,e,r){var i=!1;try{t(function(t){i||(i=!0,e(t))},function(t){i||(i=!0,r(t))})}catch(n){if(i)return;i=!0,r(n)}}var l="function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)};Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,i=function(){},n=function(){return r.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),n.prototype=new i,n});var h=(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},function(){function t(t){if(this._state=null,this._value=null,this._deferreds=[],"object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");u(t,n.bind(this),o.bind(this))}return t.all=function(e){return new t(function(t,r){function i(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(o,t)},r)}e[o]=s,0===--n&&t(e)}catch(u){r(u)}}if(0===e.length)return t([]);for(var n=e.length,o=0;oi;i++)e[i].then(t,r)})},t._setImmediateFn=function(t){l=t},t.prototype["catch"]=function(t){return this.then(null,t)},t.prototype.then=function(e,r){var n=this;return new t(function(t,o){i.call(n,new a(e,r,t,o))})},t}());r.Promise=h},{}],14:[function(t,e,r){"use strict";var i=t("./Promise"),n=function(){function t(){}return t.wait=function(t,e){return void 0===e&&(e=function(t){}),new i.Promise(function(r){for(var i=[],n=function(n){i.push(n),e(i.length/t.length),i.length==t.length&&r(i)},o=0;oo;o++)n.push(0);for(var s=function(t,e){n[t]=e;for(var o=0,s=n.length,a=0;s>a;a++)o+=n[a];r(o/i)},a=new Array(i),o=0;i>o;o++)a[o]=e[o].load(s.bind(this,o));return t.wait(a)},t}();r.PromiseUtil=n},{"./Promise":13}],15:[function(t,e,r){"use strict";var i=function(){function t(){this._list=[],this._listLength=0,this.current=null}return t.prototype.add=function(t){return this._list.push(t),this._listLength++,this},t.prototype.next=function(){return this.kill(),this._listLength>0?(this.current=this._list.shift(),this._listLength--):this.current=null,this.current},t.prototype.hasNext=function(){return this._listLength>0},t.prototype.end=function(t){return void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current&&(this.current.times=1),this},t.prototype.kill=function(t){if(void 0===t&&(t=!1),t&&(this._list.length=0,this._listLength=0),this.current){var e=this.current;this.current=null,e.finish(),e.destruct()}return this},t}();r.Queue=i},{}],16:[function(t,e,r){"use strict";var i=function(){function t(t,e,r,i,n){if(void 0===i&&(i=1),void 0===n&&(n=0),this._complete=null,e>r)throw new Error('argument "from" cannot be bigger than argument "to"');this.label=t,this.from=e,this.to=r,this.duration=r-e,this.times=i,this.delay=n}return t.prototype.then=function(t){return this._complete=t,this},t.prototype.finish=function(){return this._complete&&this._complete.call(this),this},t.prototype.destruct=function(){this.label=null,this._complete=null},t}();r.QueueItem=i},{}]},{},[10])(10)}); //# sourceMappingURL=pixi-flump.min.js.map diff --git a/bin/pixi-flump.min.js.map b/bin/pixi-flump.min.js.map index 98d1540..94bbcef 100644 --- a/bin/pixi-flump.min.js.map +++ b/bin/pixi-flump.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["pixi-flump.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","PIXI","FlumpLibrary","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","Promise_1","HttpRequest_1","PromiseUtil_1","TextureGroup_1","FlumpMovie_1","MovieData_1","QueueItem_1","basePath","movieData","textureGroups","fps","isOptimised","_hasLoaded","_isLoading","url","load","library","onProcess","baseDir","indexOf","substr","lastIndexOf","HttpRequest","getJSON","then","json","processData","prototype","hasLoaded","isLoading","onProgress","Promise","resolve","_this","md5","frameRate","referenceList","optimised","textureGroupLoaders","movies","MovieData","push","textureGroup","promise","TextureGroup","PromiseUtil","wait","getMovieData","name","id","createSymbol","paused","textures","sprites","movie","FlumpMovie","getQueue","add","QueueItem","frames","console","warn","createMovie","getNameFromReferenceList","value","EVENT_LOAD","./core/FlumpMovie","./core/TextureGroup","./data/MovieData","./util/HttpRequest","./util/Promise","./util/PromiseUtil","./util/QueueItem","2","__extends","d","b","__","constructor","p","hasOwnProperty","Object","create","AnimationQueue_1","MovieLayer_1","_super","_labels","_queue","hasFrameCallbacks","frame","speed","_library","_movieData","layers","layerData","movieLayers","Array","MovieLayer","addChild","_movieLayers","_frameCallback","setLabel","data","AnimationQueue","play","times","label","complete","visible","queue","queueLabel","index","duration","resume","pause","end","all","stop","kill","next","setFrameCallback","frameNumber","callback","triggerOnce","delta","gotoAndStop","frameOrLabel","onTick","accumulated","newFrame","getFrame","layer","setFrame","getSymbol","symbol","replaceSymbol","handleFrameCallback","fromFrame","toFrame","reset","Container","../core/MovieLayer","../util/AnimationQueue","../util/QueueItem","3","FlumpMtx","c","tx","ty","4","FlumpMtx_1","LabelData_1","KeyframeData_1","_frame","_symbols","enabled","_storedMtx","keyframeData","_index","_movie","_layerData","keyframe","LabelData","ref","symbols","val","item","_symbol","getKeyframeForFrame","Math","floor","removeChildren","setKeyframeData","ease","interped","nextKeyframe","x","y","scaleX","scaleY","skewX","skewY","pivotX","pivotY","alpha","tweened","getKeyframeAfter","KeyframeData","inv","setTransform","../data/KeyframeData","../data/LabelData","./FlumpMovie","./FlumpMtx","5","TextureGroupAtlas_1","sprite","atlases","loaders","atlas","TextureGroupAtlas","result","concat","getSprites","err","../util/Promise","./TextureGroupAtlas","6","Texture","BaseTexture","Rectangle","renderTexture","_renderTexture","_atlas","file","reject","img","document","createElement","onload","onerror","src","baseTexture","texture","Sprite","rect","7","fromArray","jsonObject","loc","scale","skew","pivot","getValueOrder","toArray","order","8","9","LayerData","flipbook","keyframes","keyFrameData","datas","flumpKeyframeData","./KeyframeData","10","LayerData_1","max","./LayerData","11","FlumpLibrary_1","./FlumpLibrary","12","Queue_1","unit","_freeze","_hasStopped","_time","_fpms","time","current","from","hasStopped","hasNext","Queue","./Queue","13","request","method","args","client","XMLHttpRequest","uri","argcount","key","encodeURIComponent","open","send","status","response","responseText","statusText","getString","query","JSON","parse","14","handle","deferred","me","_state","_deferreds","asap","cb","onFulfilled","onRejected","_value","ret","newValue","TypeError","doResolve","bind","finale","len","Handler","fn","done","reason","ex","setImmediate","setTimeout","Function","oThis","aArgs","slice","arguments","fToBind","fNOP","fBound","apply","isArray","toString","init","promiseList","res","remaining","race","values","_setImmediateFn","15","list","progress","newList","waitForLoadable","count","progressList","prvProgress","total","./Promise","16","_list","_listLength","shift","finish","destruct","17","to","delay","_complete"],"mappings":"CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,MAAAJ,EAAAK,OAAAL,EAAAK,UAAAC,aAAAX,MAAA,WAAA,MAAA,SAAAY,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,G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,OACAvR,MAAAuR,QAAA,KACAA,EAAAmF,SACAnF,EAAAoF,WAEA,MAAA3W,OAEA2R,IAEAnS,GAAAmS,MAAAA,OAEAiF,IAAA,SAAAjW,EAAAlB,EAAAD,GACA,YACA,IAAAqF,GAAA,WACA,QAAAA,GAAAgD,EAAA2J,EAAAqF,EAAAjP,EAAAkP,GAIA,GAHA,SAAAlP,IAAAA,EAAA,GACA,SAAAkP,IAAAA,EAAA,GACA9W,KAAA+W,UAAA,KACAvF,EAAAqF,EACA,KAAA,IAAAhW,OAAA,sDAEAb,MAAA6H,MAAAA,EACA7H,KAAAwR,KAAAA,EACAxR,KAAA6W,GAAAA,EACA7W,KAAAmI,SAAA0O,EAAArF,EACAxR,KAAA4H,MAAAA,EACA5H,KAAA8W,MAAAA,EAgBA,MAdAjS,GAAA/B,UAAAH,KAAA,SAAAmF,GAEA,MADA9H,MAAA+W,UAAAjP,EACA9H,MAEA6E,EAAA/B,UAAA4T,OAAA,WAIA,MAHA1W,MAAA+W,WACA/W,KAAA+W,UAAA/V,KAAAhB,MAEAA,MAEA6E,EAAA/B,UAAA6T,SAAA,WACA3W,KAAA6H,MAAA,KACA7H,KAAA+W,UAAA,MAEAlS,IAEArF,GAAAqF,UAAAA,YAEA,KAAA","file":"pixi-flump.min.js","sourcesContent":[null],"sourceRoot":"./"} \ No newline at end of file +{"version":3,"sources":["pixi-flump.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","PIXI","FlumpLibrary","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","Promise_1","HttpRequest_1","PromiseUtil_1","TextureGroup_1","FlumpMovie_1","MovieData_1","QueueItem_1","basePath","movieData","textureGroups","fps","isOptimised","_hasLoaded","_isLoading","url","load","library","onProcess","baseDir","indexOf","substr","lastIndexOf","HttpRequest","getJSON","then","json","processData","prototype","hasLoaded","isLoading","onProgress","Promise","resolve","_this","md5","frameRate","referenceList","optimised","textureGroupLoaders","movies","MovieData","push","textureGroup","promise","TextureGroup","PromiseUtil","wait","getMovieData","name","id","createSymbol","paused","hasSprite","createSprite","movie","FlumpMovie","getQueue","add","QueueItem","frames","console","warn","createMovie","getNameFromReferenceList","value","EVENT_LOAD","./core/FlumpMovie","./core/TextureGroup","./data/MovieData","./util/HttpRequest","./util/Promise","./util/PromiseUtil","./util/QueueItem","2","__extends","d","b","__","constructor","p","hasOwnProperty","Object","create","AnimationQueue_1","MovieLayer_1","_super","_labels","_queue","hasFrameCallbacks","frame","speed","_library","_movieData","layers","layerData","movieLayers","Array","MovieLayer","addChild","_movieLayers","_frameCallback","setLabel","data","AnimationQueue","play","times","label","complete","visible","queue","queueLabel","index","duration","resume","pause","end","all","stop","kill","next","setFrameCallback","frameNumber","callback","triggerOnce","delta","gotoAndStop","frameOrLabel","onTick","accumulated","newFrame","getFrame","layer","setFrame","getSymbol","symbol","replaceSymbol","handleFrameCallback","fromFrame","toFrame","reset","Container","../core/MovieLayer","../util/AnimationQueue","../util/QueueItem","3","LabelData_1","KeyframeData_1","_frame","_symbols","enabled","keyframeData","_index","_movie","_layerData","keyframe","LabelData","ref","symbols","val","item","_symbol","getKeyframeForFrame","Math","floor","removeChildren","setKeyframeData","ease","interped","nextKeyframe","sinX","cosX","sinY","cosY","x","y","scaleX","scaleY","skewX","skewY","pivotX","pivotY","alpha","tweened","getKeyframeAfter","KeyframeData","inv","sin","cos","position","set","scale","Sprite","../data/KeyframeData","../data/LabelData","./FlumpMovie","4","TextureGroupAtlas_1","names","textures","ancors","_names","_textures","_ancors","atlases","loaders","atlas","TextureGroupAtlas","concat","getNames","getTextures","getAnchors","destruct","err","sprite","anchor","../util/Promise","./TextureGroupAtlas","5","Texture","BaseTexture","Rectangle","Point","renderTexture","_anchors","_baseTexture","_atlas","atlasTextures","baseTexture","atlasTexture","rect","origin","file","reject","img","document","createElement","onload","onerror","src","6","fromArray","jsonObject","loc","skew","pivot","getValueOrder","toArray","order","copyNotDefined","7","8","LayerData","flipbook","keyframes","keyFrameData","datas","flumpKeyframeData","./KeyframeData","9","LayerData_1","max","./LayerData","10","FlumpLibrary_1","./FlumpLibrary","11","Queue_1","unit","_freeze","_hasStopped","_time","_fpms","time","current","from","hasStopped","hasNext","Queue","./Queue","12","request","method","args","client","XMLHttpRequest","uri","argcount","key","encodeURIComponent","open","send","status","response","responseText","statusText","getString","query","JSON","parse","13","handle","deferred","me","_state","_deferreds","asap","cb","onFulfilled","onRejected","_value","ret","newValue","TypeError","doResolve","bind","finale","len","Handler","fn","done","reason","ex","setImmediate","setTimeout","Function","oThis","aArgs","slice","arguments","fToBind","fNOP","fBound","apply","isArray","toString","init","promiseList","res","remaining","race","values","_setImmediateFn","14","list","progress","newList","waitForLoadable","count","progressList","prvProgress","total","./Promise","15","_list","_listLength","shift","finish","16","to","delay","_complete"],"mappings":"CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,MAAAJ,EAAAK,OAAAL,EAAAK,UAAAC,aAAAX,MAAA,WAAA,MAAA,SAAAY,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAjB,GAAA,GAAAsB,OAAA,uBAAAL,EAAA,IAAA,MAAAjB,GAAAuB,KAAA,mBAAAvB,EAAA,GAAAwB,GAAAV,EAAAG,IAAAhB,WAAAY,GAAAI,GAAA,GAAAQ,KAAAD,EAAAvB,QAAA,SAAAW,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAA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EAAA/B,UAAAyU,OAAA,WAIA,MAHAvX,MAAA2X,WACA3X,KAAA2X,UAAA3W,KAAAhB,MAEAA,MAEA6E,EAAA/B,UAAAwL,SAAA,WACAtO,KAAA6H,MAAA,KACA7H,KAAA2X,UAAA,MAEA9S,IAEArF,GAAAqF,UAAAA,YAEA,KAAA","file":"pixi-flump.min.js","sourcesContent":[null],"sourceRoot":"./"} \ No newline at end of file diff --git a/example/simple.js b/example/simple.js index 25f4192..4dce4af 100644 --- a/example/simple.js +++ b/example/simple.js @@ -17,15 +17,18 @@ document.body.appendChild(renderer.view); // create the root of the scene graph var stage = new PIXI.Container(); -var fl = new PIXI.FlumpLibrary('../test/assets/flump/animations-100/character'); +var fl = new PIXI.FlumpLibrary('../test/assets/flump/animation-100/character'); fl.load().then(function(library){ - for(var i = 0; i < 1000; i++) + for(var i = 0; i < 200; i++) { - - var movie = fl.createMovie(names[Math.floor(Math.random()*names.length)]); + var name = names[Math.floor(Math.random()*names.length)]; + var movie = fl.createMovie(name); + // console.log(name); + + // var movie = fl.createMovie('cubeAnimation'); movie.position.set(Math.random() * width|0, Math.random() * height|0); movie.play(-1) stage.addChild(movie); @@ -42,6 +45,7 @@ fl.load().then(function(library){ } else { var delta = time - pTime; pTime = time; + for(var i = 0; i < stage.children.length; i++) { @@ -54,5 +58,5 @@ fl.load().then(function(library){ } -}).catch(err => console.log(err)); +}).catch(function(err){console.log(err)}); diff --git a/src/FlumpLibrary.js b/src/FlumpLibrary.js index 4f94788..f6f636e 100644 --- a/src/FlumpLibrary.js +++ b/src/FlumpLibrary.js @@ -95,9 +95,8 @@ var FlumpLibrary = (function () { FlumpLibrary.prototype.createSymbol = function (name, paused) { if (paused === void 0) { paused = false; } for (var i = 0; i < this.textureGroups.length; i++) { - var textures = this.textureGroups[i].sprites; - if (name in textures) { - return textures[name]; + if (this.textureGroups[i].hasSprite(name)) { + return this.textureGroups[i].createSprite(name); } } for (var i = 0; i < this.movieData.length; i++) { diff --git a/src/FlumpLibrary.ts b/src/FlumpLibrary.ts index 90afc43..dae29c9 100644 --- a/src/FlumpLibrary.ts +++ b/src/FlumpLibrary.ts @@ -153,11 +153,8 @@ export class FlumpLibrary implements ILoadable { for(var i = 0; i < this.textureGroups.length; i++) { - var textures = this.textureGroups[i].sprites; - - if(name in textures) - { - return textures[name]; + if(this.textureGroups[i].hasSprite(name)){ + return this.textureGroups[i].createSprite(name); } } diff --git a/src/core/MovieLayer.js b/src/core/MovieLayer.js index d16aca4..5d2ec81 100644 --- a/src/core/MovieLayer.js +++ b/src/core/MovieLayer.js @@ -4,7 +4,6 @@ var __extends = (this && this.__extends) || function (d, b) { function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; -var FlumpMtx_1 = require("./FlumpMtx"); var FlumpMovie_1 = require("./FlumpMovie"); var LabelData_1 = require("../data/LabelData"); var KeyframeData_1 = require("../data/KeyframeData"); @@ -16,7 +15,6 @@ var MovieLayer = (function (_super) { this._frame = 0; this._symbols = {}; this.enabled = true; - this._storedMtx = new FlumpMtx_1.FlumpMtx(1, 0, 0, 1, 0, 0); var keyframeData = layerData.keyframeData; this._index = index; this._movie = movie; @@ -132,9 +130,23 @@ var MovieLayer = (function (_super) { alpha = alpha + (nextKeyframe.alpha - alpha) * interped; } } - symbol.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, pivotX, pivotY); - symbol.visible = keyframe.visible; - symbol.alpha = alpha; + if (skewX != 0) { + sinX = Math.sin(skewX); + cosX = Math.cos(skewX); + } + if (skewY != 0) { + sinY = Math.sin(skewY); + cosY = Math.cos(skewY); + } + this._symbol.position.set(x, y); + this._symbol.scale.set(scaleX, scaleY); + if (!(this._symbol instanceof PIXI.Sprite)) { + this._symbol['pivot'].x = pivotX; + this._symbol['pivot'].y = pivotY; + } + this._symbol['skew'].set(skewX, skewY); + this.alpha = alpha; + this.visible = keyframe.visible; this._frame = frame; }; MovieLayer.prototype.reset = function () { diff --git a/src/core/MovieLayer.ts b/src/core/MovieLayer.ts index b3467ba..6361700 100644 --- a/src/core/MovieLayer.ts +++ b/src/core/MovieLayer.ts @@ -22,7 +22,7 @@ export class MovieLayer extends PIXI.Container // disable layer from code public enabled:boolean = true; - public _storedMtx = new FlumpMtx(1, 0, 0, 1, 0, 0); + // public _storedMtx = new FlumpMtx(1, 0, 0, 1, 0, 0); constructor(index:number, movie:FlumpMovie, library:FlumpLibrary, layerData:LayerData) { @@ -198,40 +198,63 @@ export class MovieLayer extends PIXI.Container } } - this.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, pivotX, pivotY) - this.visible = keyframe.visible; - this.alpha = alpha; + //this.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, pivotX, pivotY) - // if(skewX != 0) - // { - // sinX = Math.sin(skewX); - // cosX = Math.cos(skewX); - // } - // - // if(skewY != 0) - // { - // sinY = Math.sin(skewY); - // cosY = Math.cos(skewY); - // } + + if(skewX != 0) + { + sinX = Math.sin(skewX); + cosX = Math.cos(skewX); + } + + if(skewY != 0) + { + sinY = Math.sin(skewY); + cosY = Math.cos(skewY); + } // // symbol.localTransform // - // this._storedMtx.a = scaleX * cosY; - // this._storedMtx.b = scaleX * sinY; - // this._storedMtx.c = -scaleY * sinX; - // this._storedMtx.d = scaleY * cosX; + // this.worldTransform.a = scaleX * cosY; + // this.worldTransform.b = scaleX * sinY; + // this.worldTransform.c = -scaleY * sinX; + // this.worldTransform.d = scaleY * cosX; // - // this._storedMtx.tx = x - (pivotX * this._storedMtx.a + pivotY * this._storedMtx.c); - // this._storedMtx.ty = y - (pivotX * this._storedMtx.b + pivotY * this._storedMtx.d); + // this.worldTransform.tx = x - (pivotX * this.worldTransform.a + pivotY * this.worldTransform.c); + // this.worldTransform.ty = y - (pivotX * this.worldTransform.b + pivotY * this.worldTransform.d); + this._symbol.position.set(x, y); + this._symbol.scale.set(scaleX, scaleY); + if(!(this._symbol instanceof PIXI.Sprite)) + { + this._symbol['pivot'].x = pivotX; + this._symbol['pivot'].y = pivotY; + } + this._symbol['skew'].set(skewX, skewY); - // this.alpha = alpha; + // console.log(pivotX, pivotY); + + // console.log(this.worldTransform); + + // + // this.setTransform(this._storedMtx.tx, this._storedMtx.ty, this._storedMtx.a, this._storedMtx.d, 0, this._storedMtx.b, this._storedMtx.c, 0, 0) + // this.worldTransform.set( this._storedMtx.a, this._storedMtx, this._storedMtx, this._storedMtx.tx, this._storedMtx.ty); + // this.setTransform(x, y, scaleX, scaleY, 0, skewX, skewY, 0, 0); // this.visible = keyframe.visible; + // this.alpha = alpha; + + this.alpha = alpha; + this.visible = keyframe.visible; this._frame = frame; } - public reset() + // updateTransform():void + // { + // // super.updateTransform(); + // } + + public reset():void { if(this._symbol instanceof FlumpMovie) { diff --git a/src/core/TextureGroup.js b/src/core/TextureGroup.js index 04373ac..7c0585c 100644 --- a/src/core/TextureGroup.js +++ b/src/core/TextureGroup.js @@ -2,12 +2,13 @@ var TextureGroupAtlas_1 = require("./TextureGroupAtlas"); var Promise_1 = require("../util/Promise"); var TextureGroup = (function () { - function TextureGroup(sprites) { - this.sprites = {}; - for (var i = 0; i < sprites.length; i++) { - var sprite = sprites[i]; - this.sprites[sprite.name] = sprite; - } + function TextureGroup(names, textures, ancors) { + this._names = []; + this._textures = []; + this._ancors = []; + this._names = names; + this._textures = textures; + this._ancors = ancors; } TextureGroup.load = function (library, json) { var atlases = json.atlases; @@ -17,17 +18,32 @@ var TextureGroup = (function () { loaders.push(TextureGroupAtlas_1.TextureGroupAtlas.load(library, atlas)); } return Promise_1.Promise.all(loaders).then(function (atlases) { - var result = []; + var names = []; + var textures = []; + var ancors = []; for (var i = 0; i < atlases.length; i++) { var atlas = atlases[i]; - result = result.concat(atlas.getSprites()); + names = names.concat(atlas.getNames()); + textures = textures.concat(atlas.getTextures()); + ancors = ancors.concat(atlas.getAnchors()); + atlas.destruct(); } - return new TextureGroup(result); + return new TextureGroup(names, textures, ancors); }).catch(function (err) { console.warn('could not load textureGroup', err); throw new Error('could not load textureGroup'); }); }; + TextureGroup.prototype.hasSprite = function (name) { + return this._names.indexOf(name) > -1; + }; + TextureGroup.prototype.createSprite = function (name) { + var index = this._names.indexOf(name); + var sprite = new PIXI.Sprite(this._textures[index]); + sprite.anchor.set(this._ancors[index].x, this._ancors[index].y); + sprite.name = name; + return sprite; + }; return TextureGroup; }()); exports.TextureGroup = TextureGroup; diff --git a/src/core/TextureGroup.ts b/src/core/TextureGroup.ts index dcba53b..3c8e8a9 100644 --- a/src/core/TextureGroup.ts +++ b/src/core/TextureGroup.ts @@ -4,6 +4,7 @@ import {IAtlas, ITextureGroup} from "../interface/ILibrary"; import {FlumpLibrary} from "../FlumpLibrary"; import Texture = PIXI.Texture; import {Promise} from "../util/Promise"; +import Point = PIXI.Point; export class TextureGroup { @@ -20,17 +21,23 @@ export class TextureGroup return Promise.all(loaders).then((atlases:Array) => { - var result:Array = []; + var names:Array = []; + var textures:Array = []; + var ancors:Array = []; for(var i = 0; i < atlases.length; i++) { var atlas = atlases[i]; // @todo check on duplicate names - result = result.concat(atlas.getSprites()) + names = names.concat(atlas.getNames()) + textures = textures.concat(atlas.getTextures()) + ancors = ancors.concat(atlas.getAnchors()) + + atlas.destruct(); } - return new TextureGroup(result); + return new TextureGroup(names, textures, ancors); }).catch((err) => { console.warn('could not load textureGroup', err) throw new Error('could not load textureGroup'); @@ -39,17 +46,31 @@ export class TextureGroup // public textureGroupAtlases:Array; // public textures:IHashMap; - public sprites:IHashMap = {}; + protected _names:Array = []; + protected _textures:Array = []; + protected _ancors:Array = []; - constructor(sprites:Array) + constructor(names:Array, textures:Array, ancors:Array) { - for(var i = 0; i < sprites.length; i++) - { - var sprite = sprites[i]; - this.sprites[sprite.name] = sprite; - } + this._names = names; + this._textures = textures; + this._ancors = ancors; } + public hasSprite(name:string):boolean + { + return this._names.indexOf(name) > -1; + } + public createSprite(name:string):PIXI.Sprite + { + var index = this._names.indexOf(name); + + var sprite = new PIXI.Sprite(this._textures[index]); + sprite.anchor.set(this._ancors[index].x, this._ancors[index].y); + sprite.name = name; + + return sprite; + } } diff --git a/src/core/TextureGroupAtlas.js b/src/core/TextureGroupAtlas.js index 1040f05..d05a69e 100644 --- a/src/core/TextureGroupAtlas.js +++ b/src/core/TextureGroupAtlas.js @@ -3,10 +3,22 @@ var Promise_1 = require("../util/Promise"); var Texture = PIXI.Texture; var BaseTexture = PIXI.BaseTexture; var Rectangle = PIXI.Rectangle; +var Point = PIXI.Point; var TextureGroupAtlas = (function () { function TextureGroupAtlas(renderTexture, json) { - this._renderTexture = new BaseTexture(renderTexture); + this._names = []; + this._textures = []; + this._anchors = []; + this._baseTexture = new BaseTexture(renderTexture); this._atlas = json; + var atlasTextures = this._atlas.textures; + var baseTexture = this._baseTexture; + for (var i = 0; i < atlasTextures.length; i++) { + var atlasTexture = atlasTextures[i]; + this._names.push(atlasTexture.symbol); + this._textures.push(new Texture(baseTexture, new Rectangle(atlasTexture.rect[0], atlasTexture.rect[1], atlasTexture.rect[2], atlasTexture.rect[3]))); + this._anchors.push(new Point(atlasTexture.origin[0] / atlasTexture.rect[2], atlasTexture.origin[1] / atlasTexture.rect[3])); + } } TextureGroupAtlas.load = function (library, json) { var file = json.file; @@ -22,17 +34,19 @@ var TextureGroupAtlas = (function () { img.src = url; }).then(function (data) { return new TextureGroupAtlas(data, json); }); }; - TextureGroupAtlas.prototype.getSprites = function () { - var result = []; - var textures = this._atlas.textures; - var baseTexture = this._renderTexture; - for (var i = 0; i < textures.length; i++) { - var texture = textures[i]; - var sprite = new PIXI.Sprite(new Texture(baseTexture, new Rectangle(texture.rect[0], texture.rect[1], texture.rect[2], texture.rect[3]))); - sprite.name = texture.symbol; - result.push(sprite); - } - return result; + TextureGroupAtlas.prototype.getNames = function () { + return this._names; + }; + TextureGroupAtlas.prototype.getTextures = function () { + return this._textures; + }; + TextureGroupAtlas.prototype.getAnchors = function () { + return this._anchors; + }; + TextureGroupAtlas.prototype.destruct = function () { + this._names = null; + this._textures = null; + this._anchors = null; }; return TextureGroupAtlas; }()); diff --git a/src/core/TextureGroupAtlas.ts b/src/core/TextureGroupAtlas.ts index 9843b84..9ea1788 100644 --- a/src/core/TextureGroupAtlas.ts +++ b/src/core/TextureGroupAtlas.ts @@ -7,6 +7,8 @@ import Texture = PIXI.Texture; import BaseTexture = PIXI.BaseTexture; import Rectangle = PIXI.Rectangle; import Sprite = PIXI.Sprite; +import Point = PIXI.Point; +import {TextureGroup} from "./TextureGroup"; export class TextureGroupAtlas { @@ -29,30 +31,50 @@ export class TextureGroupAtlas }).then((data:HTMLImageElement) => new TextureGroupAtlas(data, json) ); } - protected _renderTexture:BaseTexture; + protected _baseTexture:BaseTexture; + protected _names:Array = []; + protected _textures:Array = []; + protected _anchors:Array = []; protected _atlas:IAtlas; constructor( renderTexture:HTMLImageElement, json:IAtlas) { - this._renderTexture = new BaseTexture(renderTexture); + this._baseTexture = new BaseTexture(renderTexture); this._atlas = json; - } - public getSprites():Array - { - var result:Array = []; - var textures = this._atlas.textures; - var baseTexture = this._renderTexture; + var atlasTextures = this._atlas.textures; + var baseTexture = this._baseTexture; - for(var i = 0; i < textures.length; i++) + for(var i = 0; i < atlasTextures.length; i++) { - var texture = textures[i]; - var sprite = new PIXI.Sprite(new Texture(baseTexture, new Rectangle(texture.rect[0], texture.rect[1], texture.rect[2], texture.rect[3]))); - sprite.name = texture.symbol; - result.push(sprite); + var atlasTexture = atlasTextures[i]; + + this._names.push(atlasTexture.symbol); + this._textures.push(new Texture(baseTexture, new Rectangle(atlasTexture.rect[0], atlasTexture.rect[1], atlasTexture.rect[2], atlasTexture.rect[3]))); + this._anchors.push(new Point(atlasTexture.origin[0]/atlasTexture.rect[2], atlasTexture.origin[1]/atlasTexture.rect[3])); } + } + + public getNames():Array + { + return this._names; + } - return result; + public getTextures():Array + { + return this._textures; + } + + public getAnchors():Array + { + return this._anchors; + } + + public destruct():void + { + this._names = null; + this._textures = null; + this._anchors = null; } } diff --git a/src/data/KeyframeData.js b/src/data/KeyframeData.js index 97e12a3..3744b91 100644 --- a/src/data/KeyframeData.js +++ b/src/data/KeyframeData.js @@ -1,7 +1,7 @@ "use strict"; var KeyframeData = (function () { function KeyframeData(json) { - if (json.length != void 0) { + if (json instanceof Array) { this.fromArray(json); } else { @@ -57,6 +57,17 @@ var KeyframeData = (function () { this[name] = value; } }; + KeyframeData.prototype.copyNotDefined = function (keyframe) { + var order = this.getValueOrder(); + var data = keyframe.toArray(); + for (var i = 0; i < data.length; i++) { + var name = order[i]; + var value = data[i]; + if (this[name] == void 0 && value != void 0) { + this[name] = value; + } + } + }; return KeyframeData; }()); exports.KeyframeData = KeyframeData; diff --git a/src/data/KeyframeData.ts b/src/data/KeyframeData.ts index a73e30c..34accf9 100644 --- a/src/data/KeyframeData.ts +++ b/src/data/KeyframeData.ts @@ -25,7 +25,7 @@ export class KeyframeData constructor(json:IKeyframe|Array) { - if(( > json).length != void 0) + if(json instanceof Array) { this.fromArray(> json); } @@ -41,7 +41,7 @@ export class KeyframeData this.scaleX = 'scale' in jsonObject ? jsonObject.scale[0] : 1.0; this.scaleY = 'scale' in jsonObject ? jsonObject.scale[1] : 1.0; this.skewX = 'skew' in jsonObject ? jsonObject.skew[0] : 0.0; - this.skewY = 'skew' in jsonObject ? jsonObject.skew[1] : 0.0; + this.skewY = 'skew' in jsonObject ? jsonObject.skew[1] : 0.0; this.pivotX = 'pivot' in jsonObject ? jsonObject.pivot[0] : 0.0; this.pivotY = 'pivot' in jsonObject ? jsonObject.pivot[1] : 0.0; this.visible = 'visible' in jsonObject ? jsonObject.visible : true; @@ -92,5 +92,20 @@ export class KeyframeData this[name] = value; } } + + public copyNotDefined(keyframe:KeyframeData):void + { + var order = this.getValueOrder(); + var data = keyframe.toArray(); + for(var i = 0; i < data.length; i++) + { + var name = order[i]; + var value = data[i]; + + if(this[name] == void 0 && value != void 0 ){ + this[name] = value; + } + } + } } diff --git a/test/assets/flump/animations-100/character/atlas0.png b/test/assets/flump/animation-100/character/atlas0.png similarity index 100% rename from test/assets/flump/animations-100/character/atlas0.png rename to test/assets/flump/animation-100/character/atlas0.png diff --git a/test/assets/flump/animations-100/character/atlas1.png b/test/assets/flump/animation-100/character/atlas1.png similarity index 100% rename from test/assets/flump/animations-100/character/atlas1.png rename to test/assets/flump/animation-100/character/atlas1.png diff --git a/test/assets/flump/animations-100/character/atlas2.png b/test/assets/flump/animation-100/character/atlas2.png similarity index 100% rename from test/assets/flump/animations-100/character/atlas2.png rename to test/assets/flump/animation-100/character/atlas2.png diff --git a/test/assets/flump/animations-100/character/atlas3.png b/test/assets/flump/animation-100/character/atlas3.png similarity index 100% rename from test/assets/flump/animations-100/character/atlas3.png rename to test/assets/flump/animation-100/character/atlas3.png diff --git a/test/assets/flump/animations-100/character/atlas4.png b/test/assets/flump/animation-100/character/atlas4.png similarity index 100% rename from test/assets/flump/animations-100/character/atlas4.png rename to test/assets/flump/animation-100/character/atlas4.png diff --git a/test/assets/flump/animations-100/character/library.json b/test/assets/flump/animation-100/character/library.json similarity index 100% rename from test/assets/flump/animations-100/character/library.json rename to test/assets/flump/animation-100/character/library.json diff --git a/test/assets/flump/animation-100/cube/atlas0.png b/test/assets/flump/animation-100/cube/atlas0.png new file mode 100644 index 0000000..d74258e Binary files /dev/null and b/test/assets/flump/animation-100/cube/atlas0.png differ diff --git a/test/assets/flump/animation-100/cube/library.json b/test/assets/flump/animation-100/cube/library.json new file mode 100644 index 0000000..958f78e --- /dev/null +++ b/test/assets/flump/animation-100/cube/library.json @@ -0,0 +1,104 @@ +{ + "movies": [ + { + "layers": [ + { + "keyframes": [ + { + "ref": "cube", + "index": 0, + "pivot": [ + 21, + 21 + ], + "duration": 9 + }, + { + "pivot": [ + 21, + 21 + ], + "duration": 10, + "ref": "cube", + "index": 9, + "loc": [ + 100, + 0 + ], + "skew": [ + 1.5708, + 1.5708 + ] + }, + { + "ref": "cube", + "index": 19, + "loc": [ + 100, + 100 + ], + "pivot": [ + 21, + 21 + ], + "duration": 10 + }, + { + "loc": [ + 0, + 100 + ], + "pivot": [ + 21, + 21 + ], + "duration": 10, + "ref": "cube", + "index": 29, + "alpha": 0 + }, + { + "ref": "cube", + "index": 39, + "pivot": [ + 21, + 21 + ], + "duration": 1 + } + ], + "name": "Layer 1" + } + ], + "id": "cubeAnimation" + } + ], + "md5": "18c0ff275b28f5579f1ad1e3a28abea9", + "frameRate": 24, + "isNamespaced": false, + "textureGroups": [ + { + "atlases": [ + { + "file": "atlas0.png", + "textures": [ + { + "symbol": "cube", + "origin": [ + 21, + 21 + ], + "rect": [ + 1, + 1, + 42, + 42 + ] + } + ] + } + ], + "scaleFactor": 1 + } + ] +} \ No newline at end of file diff --git a/test/assets/flump/cube.fla b/test/assets/flump/cube.fla new file mode 100644 index 0000000..c012c47 Binary files /dev/null and b/test/assets/flump/cube.fla differ diff --git a/test/assets/flump/cube.swf b/test/assets/flump/cube.swf new file mode 100644 index 0000000..4462d4c Binary files /dev/null and b/test/assets/flump/cube.swf differ diff --git a/test/assets/flump/export.flump b/test/assets/flump/export.flump new file mode 100644 index 0000000..9e462fd --- /dev/null +++ b/test/assets/flump/export.flump @@ -0,0 +1,23 @@ +{ + "fileVersion": 0, + "exports": [ + { + "quality": "best", + "prettyPrint": false, + "name": "animation-100", + "scale": 1, + "combine": false, + "scaleFactors": [ + 1 + ], + "optimize": "Speed", + "format": "JSON", + "maxAtlasSize": 1024, + "textureBorder": 1, + "description": "'animation-100' (JSON, 100%, @1x)", + "scaleFactorsString": "1" + } + ], + "exportDir": "", + "importDir": "" +} \ No newline at end of file