/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';
	
	var Character = __webpack_require__(1);
	var Stroke = __webpack_require__(2);
	
	self.Character = Character;
	self.Stroke = Stroke;

/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';
	
	var Stroke = __webpack_require__(2);
	var utils = __webpack_require__(4);
	
	// Browser
	var KerasJS = __webpack_require__(5);
	/*var pointsNN = new KerasJS.Model({
	  filepaths: {
	    model: 'recognition/PointsNN.json',
	    weights: 'recognition/PointsNN_weights.buf',
	    metadata: 'recognition/PointsNN_metadata.json'
	  },
	  gpu: false
	})*/
	var TeXDrawNN = new KerasJS.Model({
	    filepaths: {
	        model: 'recognition/TeXDrawNN.json',
	        weights: 'recognition/TeXDrawNN_weights.buf',
	        metadata: 'recognition/TeXDrawNN_metadata.json'
	    },
	    gpu: false
	});
	
	/*const KerasJS = require('keras-js')
	var pointsNN = new KerasJS.Model({
	  filepaths: {
	    model: 'dev/recognition/PointsNN.json',
	    weights: 'dev/recognition/PointsNN_weights.buf',
	    metadata: 'dev/recognition/PointsNN_metadata.json'
	  },
	  gpu: false,
	  filesystem: true
	})
	var TeXDrawNN = new KerasJS.Model({
	  filepaths: {
	    model: 'dev/recognition/TeXDrawNN.json',
	    weights: 'dev/recognition/TeXDrawNN_weights.buf',
	    metadata: 'dev/recognition/TeXDrawNN_metadata.json'
	  },
	  gpu: false,
	  filesystem: true
	})*/
	
	// # Character class
	
	// _Creates a new Character object_
	// 
	// **Parameters:**
	// - **obj:** An object, generally obtained from PouchDB that contains all the data that defines the character
	// - **opt:** An object, contains the options for the character creation
	var Character = function Character(obj) {
	    // The sign the character represents
	    this.sign = obj.sign;
	    // An array with all the [Strokes](Stroke.html) that compose the Character
	    this.strokes = obj.strokes;
	    // Compute the bounding box of this character. Although this is not yet necessary, it will be when retrieven points or drawings for this character, so do it already.
	    this.computeBoundingBox();
	};
	
	// ### Character.computeBoundingBox
	// _Computes the bounding box of the character_
	Character.prototype.computeBoundingBox = function () {
	    // To do this, assume that the bounding box for each independent stroke has already been computed.
	    // Set the edges and iterate over all strokes
	    this.mostLeft = Infinity;
	    this.mostRight = 0;
	    this.mostTop = Infinity;
	    this.mostBottom = 0;
	    for (var i = 0; i < this.strokes.length; i++) {
	        this.mostLeft = Math.min(this.mostLeft, this.strokes[i].mostLeft);
	        this.mostTop = Math.min(this.mostTop, this.strokes[i].mostTop);
	        this.mostRight = Math.max(this.mostRight, this.strokes[i].mostRight);
	        this.mostBottom = Math.max(this.mostBottom, this.strokes[i].mostBottom);
	    }
	    // The bounding box of the whole character must be a square, since it will be used later on to retrieve representations of the character that should maintain there original proportions. We decide whether the character is wider or taller and keep that as the side for the bounding box
	    var pixelWidth = this.mostRight - this.mostLeft;
	    var pixelHeight = this.mostBottom - this.mostTop;
	    if (pixelWidth > pixelHeight) {
	        this.boxSide = pixelWidth;
	        this.mostTop -= (this.boxSide - pixelHeight) / 2;
	    } else {
	        this.boxSide = pixelHeight;
	        this.mostLeft -= (this.boxSide - pixelWidth) / 2;
	    }
	};
	
	// ### Character.getDrawingMatrix
	// _Returns a representation of the character as an array of pixels that should be interpreted as a matrix._
	// 
	// **Parameters:**
	// - **opt:** An object, contains the options that determine how to draw the matrix
	//  - **opt.width:** A positive integer, the width of the matrix in which the Character will be drawn
	//  - **opt.height:** A positive integer, the height of the matrix in which the Character will be drawn
	//  - **opt.xElasticity:** A signed float, an elastic deformation to be applied on the x axis before drawing the character. A positive value corresponds to more data being retrieved from the center of the strokes, a negative value from the edges.
	//  - **opt.xElasticity:** A signed float, an elastic deformation to be applied on the y axis before drawing the character. A positive value corresponds to more data being retrieved from the center of the strokes, a negative value from the edges.
	//  - **opt.strokeWidth:** A positive float, the width of the brush that draws the character. Higher values correspond to wider brushes.
	//  - **opt.hardness:** A positive float, how fast the ink decays. A higher value makes the edge of the stroke harder, a lower value makes it softer.
	// 
	// **Returns:**
	// - An array of length _opt.width\*opt.height_, a drawn representation of the character.
	Character.prototype.getDrawingMatrix = function (opt) {
	    // Define the array finalMat and iterate over all the strokes, painting them on top of finalMat. Pass down the opt object given and the bounding box of the character to the Stroke.getDrawingMatrix function.
	    var finalMat = this.strokes[0].getDrawingMatrix(opt, this.mostLeft, this.mostTop, this.boxSide);
	    for (var i = 1; i < this.strokes.length; i++) {
	        var mat = this.strokes[i].getDrawingMatrix(opt, this.mostLeft, this.mostTop, this.boxSide);
	        for (var j = 0; j < mat.length; j++) {
	            finalMat[j] = Math.min(finalMat[j] + mat[j], 1);
	            /*finalMat.push(mat[j])*/
	        }
	    }
	    return finalMat;
	};
	
	// ### Character.getPoints
	// _Returns a representation of the character as a concatenation of n evenly interpolated points of the first k [Strokes](Stroke.html). If the character has less than k [Strokes](Stroke.html), the rest get filled up with 0s. Each point consists of two coordinates (x & y), which range from 0 to 1, from left to right and top to bottom of the bounding box, preserving the aspect ratio of the character._
	// 
	// **Parameters:**
	// - **opt:** An object, contains the options that determine how and what points to retrieve.
	//  - **opt.strokes:** A positive integer, the number of strokes for which to retrieve the points. Take into account that if _opt.strokes_ is less than the number of [Strokes](Stroke.html) in this.strokes, some will not be retrieved and that if it is higher the rest of the points will be filled with 0s. This way the dimension of the array returned is a constant.
	//  - **opt.number:** A positive integer, the number of points to retrieve per stroke.
	// 
	// **Returns:**
	// An array of length _opt.strokes\*opt.number\*2_, the interpolated points retrieved.
	Character.prototype.getPoints = function (opt) {
	    // Iterate over the first _opt.strokes_ [Strokes](Stroke.html) and get _opt.number_ evenly interpolated points.
	    var points = [];
	    for (var i = 0; i < opt.strokes; i++) {
	        if (i < this.strokes.length) {
	            for (var j = 0; j < opt.number; j++) {
	                var t = j * 1.00 / opt.number;
	                // Retrieve the _jth_ point
	                var pt = this.strokes[i].path.point(t);
	                // Make the x and y coordinates range from 0 to 1 and add it to the points array
	                points.push((pt[0] - this.mostLeft) / this.boxSide);
	                points.push((pt[1] - this.mostTop) / this.boxSide);
	            }
	        }
	        // If there aren't enough strokes, fill the rest with 0s
	        else {
	                for (var j = 0; j < opt.number; j++) {
	                    points.push(0);
	                    points.push(0);
	                }
	            }
	    }
	    return points;
	};
	
	Character.prototype.getOnlineFeatures = function (opt) {
	    var points = [];
	    for (var i = 0; i < opt.strokes; i++) {
	        if (i < this.strokes.length) {
	            for (var j = 0; j < opt.number; j++) {
	                var t = (j + 1) * 1.00 / (opt.number + 2);
	                // Retrieve the _jth_ point
	                var pt = this.strokes[i].path.point(t);
	                // Make the x and y coordinates range from 0 to 1 and add it to the points array
	                points.push((pt[0] - this.mostLeft) / this.boxSide);
	                points.push((pt[1] - this.mostTop) / this.boxSide);
	                points.push(this.strokes[i].angle(t));
	            }
	        }
	        // If there aren't enough strokes, fill the rest with 0s
	        else {
	                for (var j = 0; j < opt.number; j++) {
	                    points.push(0);
	                    points.push(0);
	                    points.push(0);
	                }
	            }
	    }
	    return points;
	};
	
	Character.prototype.getFeatures = function () {
	    var data = [];
	    if (this.strokes[0] != undefined) {
	        data.push(Math.log(this.strokes[0].path.totalLength / (this.strokes[0].mostBottom - this.strokes[0].mostTop)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[1] != undefined) {
	        data.push(Math.log(this.strokes[1].path.totalLength / (this.strokes[1].mostBottom - this.strokes[1].mostTop)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[2] != undefined) {
	        data.push(Math.log(this.strokes[2].path.totalLength / (this.strokes[2].mostBottom - this.strokes[2].mostTop)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[3] != undefined) {
	        data.push(Math.log(this.strokes[3].path.totalLength / (this.strokes[3].mostBottom - this.strokes[3].mostTop)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[0] != undefined) {
	        data.push(Math.log(this.strokes[0].path.totalLength / (this.strokes[0].mostRight - this.strokes[0].mostLeft)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[1] != undefined) {
	        data.push(Math.log(this.strokes[1].path.totalLength / (this.strokes[1].mostRight - this.strokes[1].mostLeft)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[2] != undefined) {
	        data.push(Math.log(this.strokes[2].path.totalLength / (this.strokes[2].mostRight - this.strokes[2].mostLeft)));
	    } else {
	        data.push(0);
	    }
	    if (this.strokes[3] != undefined) {
	        data.push(Math.log(this.strokes[3].path.totalLength / (this.strokes[3].mostRight - this.strokes[3].mostLeft)));
	    } else {
	        data.push(0);
	    }
	    var totalLength = this.strokes.reduce(function (b, s) {
	        return s.path.totalLength + b;
	    }, 0);
	    data.push(Math.log(totalLength / (this.mostBottom - this.mostTop)));
	    data.push(Math.log(totalLength / (this.mostRight - this.mostLeft)));
	    if (totalLength == 0) {
	        data.push(0.5);data.push(0.5);
	    } else {
	        var centroidX = this.strokes.reduce(function (b, s) {
	            return s.path.totalLength * s.centroid[0] + b;
	        }, 0) / totalLength;
	        var centroidY = this.strokes.reduce(function (b, s) {
	            return s.path.totalLength * s.centroid[1] + b;
	        }, 0) / totalLength;
	        data.push((centroidX - this.mostLeft) / (this.mostRight - this.mostLeft));
	        data.push((centroidY - this.mostTop) / (this.mostBottom - this.mostTop));
	    }
	    data.push(this.strokes.length);
	    data.push((this.mostRight - this.mostLeft) / (this.mostBottom - this.mostTop));
	    return data;
	};
	
	Character.prototype.recognizeLatex = function () {
	    var points = utils.deepFlatten(this.getPoints({ number: 20, strokes: 4 }));
	    var features = this.getFeatures();
	    return TeXDrawNN.predict({ 'input_1': new Float32Array(points), 'input_2': new Float32Array(features) }).then(function (o) {
	        return o['dense_3'];
	    });
	};
	
	Character.prototype.recognize = function () {
	    var points = utils.deepFlatten(this.getPoints({ number: 20, strokes: 4 }));
	    var features = this.getFeatures();
	    return pointsNN.predict({ 'input_1': new Float32Array(points), 'input_2': new Float32Array(features) }).then(function (o) {
	        return o['dense_3'];
	    });
	};
	
	module.exports = Character;

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';
	
	var Path = __webpack_require__(3);
	
	// Stroke class
	var Stroke = function Stroke(arr) {
	    this.path = new Path(arr);
	    this.computeBoundingBox();
	    this.computeCentroid();
	    this.isPoint = false;
	};
	
	// Stroke.angle
	Stroke.prototype.angle = function (t) {
	    // Get two really close points (as in a derivate)
	    var h = 1 / 100;
	    var p1 = this.path.point(t - h);
	    var p2 = this.path.point(t + h);
	    var u = [p2[0] - p1[0], p2[1] - p1[1]];
	    // Some simple math gives us the angle
	    //var modu = Math.sqrt(Math.pow(u[0],2) + Math.pow(u[1],2))
	    //var angle = Math.acos(u[0] / modu)
	    // Take into account that the angle has a sign
	    //if(u[1] > 0){angle = -angle}
	    // Return the angle
	    return Math.atan2(p2[1] - p1[1], p2[0] - p1[0]);
	};
	
	// Stroke.getDrawingMatrix
	Stroke.prototype.getDrawingMatrix = function (opt, left, top, boxSide) {
	    // Initialize the _matrix_ array all to 0s and iterate over the points of the stroke
	    var matrix = Array.apply(null, Array(opt.width * opt.height)).map(Number.prototype.valueOf, 0);
	    for (var i = 0; i <= 99; i += .25) {
	        // Get the point in the path and normalize its coordinates to be between 0 and 1
	        var point = this.path.point(i / 100);
	        var xPercent = (point[0] - left) / boxSide;
	        var yPercent = (point[1] - top) / boxSide;
	        // Apply an elastic deformation to the point. With positive elasticity, we get more data from the center of the stroke. For negative elasticity, more from the outer part.
	        xPercent = this.elasticDeform(xPercent, opt.xElasticity);
	        yPercent = this.elasticDeform(yPercent, opt.yElasticity);
	        var x = xPercent * opt.width;
	        var y = yPercent * opt.height;
	        // Paint the cells near the point, letting each point affect a 5x5 area at most, in which we iterate
	        for (var x_0 = Math.floor(x) - 2; x_0 <= Math.floor(x) + 2; x_0++) {
	            for (var y_0 = Math.floor(y) - 2; y_0 <= Math.floor(y) + 2; y_0++) {
	                // Make sure that we are inside the bounding box
	                if (x_0 < 0 || y_0 < 0 || x_0 >= opt.width || y_0 >= opt.height) continue;
	                // Calculate the distance to the cell
	                var distanceToPoint = Math.sqrt(Math.pow(x - x_0, 2) + Math.pow(y - y_0, 2));
	                var index = y_0 * opt.width + x_0;
	                // Paint the cell. To model the stroke we use the formula 2*e^(-distance^hardness/strokeWidth), a decaying exponential function, making sure that the cell is only updated with a value higher than it had before and no bigger than 1.
	                matrix[index] = Math.min(Math.max(2 * Math.exp(-Math.pow(distanceToPoint / opt.strokeWidth, opt.hardness)), matrix[index]), 1);
	            }
	        }
	    }
	    return matrix;
	};
	
	// Stroke.computeBoundingBox
	Stroke.prototype.computeBoundingBox = function () {
	    var padding = 0.01;
	    // We iterate over the whole stroke, updating the bounding box if needed to fit the point.
	    this.mostLeft = Infinity;
	    this.mostRight = 0;
	    this.mostTop = Infinity;
	    this.mostBottom = 0;
	    for (var i = 0; i <= 100; i += 1) {
	        var point = this.path.point(i / 100);
	        this.mostLeft = Math.min(this.mostLeft, point[0] - padding);
	        this.mostTop = Math.min(this.mostTop, point[1] - padding);
	        this.mostRight = Math.max(this.mostRight, point[0] + padding);
	        this.mostBottom = Math.max(this.mostBottom, point[1] + padding);
	    }
	};
	
	// Stroke.getCentroid
	Stroke.prototype.computeCentroid = function () {
	    var centroidX = 0;
	    var centroidY = 0;
	    for (var i = 0; i <= 100; i += 5) {
	        var point = this.path.point(i / 100);
	        centroidX += point[0] / 21;
	        centroidY += point[1] / 21;
	    }
	    this.centroid = [centroidX, centroidY];
	};
	
	// ### Stroke.elasticDeform
	// _A help function for Stroke.getDrawingMatrix. Given a float between 0 to 1, it makes it closer to the center or to the edge depending on the value of intensity._
	// 
	// **Parameters:**
	// - **num:** A float between 0 and 1, the float the function modifies
	// - **intensity:** A signed float, how much to modify the float. A positive value makes the returned float closer to the edges (0 for num<0.5 or 1 for num>0.5) and a negative value makes it closer to the center (.5)
	// 
	// **Returns:**
	// - A float between 0 and 1, the modified value
	Stroke.prototype.elasticDeform = function (num, intensity) {
	    // Modify the value according to the formula (2*num)^(1.05^intensity)/2 for num<=.5, or the symmetric version for num>.5 and return the value
	    var exp = Math.pow(1.05, intensity);
	    if (num <= .5) {
	        return Math.pow(num * 2, exp) / 2;
	    } else {
	        return 1 - Math.pow((1 - num) * 2, exp) / 2;
	    }
	};
	
	module.exports = Stroke;

/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {

	'use strict';
	
	var utils = __webpack_require__(4);
	var Path = function Path(points) {
	    this.points = utils.toUint16Array(utils.eraseRepeatedPoints(points));
	    // Parcial segment lengths
	    this.parcialLengths = [];
	    for (var j = 1; j < this.points[0].length; j++) {
	        this.parcialLengths.push(Math.sqrt(Math.pow(this.points[0][j] - this.points[0][j - 1], 2) + Math.pow(this.points[1][j] - this.points[1][j - 1], 2)));
	    }
	    // Total length of the path
	    this.totalLength = this.parcialLengths.reduce(function (a, b) {
	        return a + b;
	    }, 0);
	};
	
	Path.prototype.point = function (t) {
	    if (this.totalLength == 0) {
	        return [this.points[0][0], this.points[1][0]];
	    } else {
	        // Find where the point we want is
	        t *= this.totalLength; //Change t from percentage to pixels
	        var kint = 0;
	        for (var covered = 0; covered + this.parcialLengths[kint] <= t; kint++) {
	            covered += this.parcialLengths[kint];
	        }
	        t -= covered;
	        var kfloat = t / this.parcialLengths[kint];
	        // Return the interpolated number
	        if (kfloat > 0) {
	            var x = this.points[0][kint] + kfloat * (this.points[0][kint + 1] - this.points[0][kint]);
	            var y = this.points[1][kint] + kfloat * (this.points[1][kint + 1] - this.points[1][kint]);
	            return [x, y];
	        } else {
	            //Exact point
	            return [this.points[0][kint], this.points[1][kint]];
	        }
	    }
	};
	
	module.exports = Path;

/***/ }),
/* 4 */
/***/ (function(module, exports) {

	'use strict';
	
	function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
	
	//minkowskiDistance: Returns the minkownskiDistance for two vectors x, y pondering each dimension with factors[i]
	function minkowskiDistance(x, y, p, factors) {
	    var d = 0;
	    for (var i = 0; i < x.length; i++) {
	        d += Math.pow(Math.abs((x[i] - y[i]) * factors[i]), p);
	    }
	    d = Math.pow(d, 1 / p);
	    return d;
	}
	
	//eraseRepeatedPoints: Erases consecutive points that are the same
	var eraseRepeatedPoints = function eraseRepeatedPoints(arr) {
	    for (var i = 0; i < arr.length - 1; i++) {
	        if (arr[i][0] == arr[i + 1][0] && arr[i][1] == arr[i + 1][1]) {
	            arr.splice(i, 1);i--;
	        }
	    }
	    return arr;
	};
	
	//toUint16Array: change array to Uint16Array; we also change the structure from [[x,y], [x2,y2], ...] to [[x,x2,x3,...],[y,y2,y3,...]]
	var toUint16Array = function toUint16Array(arr) {
	    var newArr = [];
	    for (var j = 0; j < arr[0].length; j++) {
	        newArr[j] = new Float32Array(arr.length); //FIX THIS This is only Float32 and not UInt16 because the databases have non-integer pixels... In real life, we need to change it
	        for (var i = 0; i < arr.length; i++) {
	            newArr[j][i] = arr[i][j];
	        }
	    }
	    return newArr;
	};
	
	//shuffle: Shuffles the content of array a. Modifies the original array.
	function shuffle(a) {
	    var j, x, i;
	    for (i = a.length; i; i--) {
	        j = Math.floor(Math.random() * i);
	        x = a[i - 1];
	        a[i - 1] = a[j];
	        a[j] = x;
	    }
	}
	
	//minimize
	function minimize(f, step, its) {
	    var x = new Array(2);
	    //Initial grid search 11x11
	    var min = Infinity;
	    for (var i = 0; i <= 1; i += .1) {
	        for (var j = 0; j <= 1; j += .1) {
	            var d = f([i, j]);
	            if (d < min) {
	                min = d;
	                x[0] = i;x[1] = j;
	            }
	        }
	    }
	    //Linear search
	    /*for(var j = 0; j < its; j++){
	        for(var i = 0; i < x.length; i++){
	            var min = [Infinity, 0]
	            for(var j = Math.max(x[i]-.4, 0); j <= Math.min(x[i]+.4, 1); j += step){
	                x[i] = j
	                var y = f(x)
	                if(y < min[0]) min = [y, x[i]]
	            }
	            x[i] = min[1]
	        }
	    }*/
	    return { f: f(x), x: x };
	}
	
	//Set functions
	Set.prototype.filter = function (f) {
	    var newSet = new Set();
	    var _iteratorNormalCompletion = true;
	    var _didIteratorError = false;
	    var _iteratorError = undefined;
	
	    try {
	        for (var _iterator = this[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
	            var v = _step.value;
	            if (f(v)) newSet.add(v);
	        }
	    } catch (err) {
	        _didIteratorError = true;
	        _iteratorError = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion && _iterator.return) {
	                _iterator.return();
	            }
	        } finally {
	            if (_didIteratorError) {
	                throw _iteratorError;
	            }
	        }
	    }
	
	    return newSet;
	};
	
	Set.prototype.map = function (f) {
	    var newSet = new Set();
	    var _iteratorNormalCompletion2 = true;
	    var _didIteratorError2 = false;
	    var _iteratorError2 = undefined;
	
	    try {
	        for (var _iterator2 = this.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
	            var v = _step2.value;
	            newSet.add(f(v));
	        }
	    } catch (err) {
	        _didIteratorError2 = true;
	        _iteratorError2 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion2 && _iterator2.return) {
	                _iterator2.return();
	            }
	        } finally {
	            if (_didIteratorError2) {
	                throw _iteratorError2;
	            }
	        }
	    }
	
	    return newSet;
	};
	
	Set.prototype.toString = function () {
	    return '[' + Array.from(this).sort().toString() + ']';
	};
	
	Set.prototype.equals = function (bs) {
	    if (this.size !== bs.size) return false;
	    var _iteratorNormalCompletion3 = true;
	    var _didIteratorError3 = false;
	    var _iteratorError3 = undefined;
	
	    try {
	        for (var _iterator3 = this[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
	            var a = _step3.value;
	            if (!bs.has(a)) return false;
	        }
	    } catch (err) {
	        _didIteratorError3 = true;
	        _iteratorError3 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion3 && _iterator3.return) {
	                _iterator3.return();
	            }
	        } finally {
	            if (_didIteratorError3) {
	                throw _iteratorError3;
	            }
	        }
	    }
	
	    return true;
	};
	
	function uniqueSet(a) {
	    var seen = {};
	    return a.filter(function (item) {
	        var k = item.toString(); //Using toString as the hash function
	        return seen.hasOwnProperty(k) ? false : seen[k] = true;
	    });
	}
	
	// Flattening
	function flatten(arr) {
	    var _ref;
	
	    return (_ref = []).concat.apply(_ref, _toConsumableArray(arr));
	}
	
	function deepFlatten(arr) {
	    return flatten( // return shalowly flattened array
	    arr.map(function (x) {
	        return (// with each x in array
	            Array.isArray(x) // is x an array?
	            ? deepFlatten(x) // if yes, return deeply flattened x
	            : x
	        );
	    } // if no, return just x
	    ));
	}
	
	function hashRelations(obj) {
	    // Canonical order
	    obj.sort(function (a, b) {
	        if (a.relation == b.relation) {
	            if (a.from.toString() == b.from.toString()) {
	                return a.to.toString() - b.to.toString();
	            } else return a.from.toString() - b.from.toString();
	        } else return a.relation - b.relation;
	    });
	    // Hash
	    var str = "";
	    var _iteratorNormalCompletion4 = true;
	    var _didIteratorError4 = false;
	    var _iteratorError4 = undefined;
	
	    try {
	        for (var _iterator4 = obj[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
	            var a = _step4.value;
	
	            str += "f" + a.from.toString();
	            str += "t" + a.to.toString();
	            str += "r" + a.relation.toString();
	        }
	    } catch (err) {
	        _didIteratorError4 = true;
	        _iteratorError4 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion4 && _iterator4.return) {
	                _iterator4.return();
	            }
	        } finally {
	            if (_didIteratorError4) {
	                throw _iteratorError4;
	            }
	        }
	    }
	
	    return str;
	}
	
	function andArrays(arr1, arr2) {
	    if (arr1.length != arr2.length) throw new Error("Cannot 'and' arrays of different length");
	    var result = [];
	    for (var i = 0; i < arr1.length; i++) {
	        result[i] = arr1[i] * arr2[i];
	    }
	    return result;
	}
	
	/*function copyState(state){
	    let newState = {inTree:[], relations:[], recognitions:{}}
	    newState.start = state.start
	    for(let a of state.inTree) newState.inTree.push(a)
	    for(let a of state.relations){ 
	      newState.relations.push({
	          relation: a.relation,
	          from: a.from,
	          to: a.to
	    })}
	    newState.recognitions = Object.assign({}, state.recognitions)
	    return newState
	}*/
	
	function copyState(state) {
	    var newState = { inTree: [], relations: [], recognitions: {} };
	    newState.start = state.start;
	    var _iteratorNormalCompletion5 = true;
	    var _didIteratorError5 = false;
	    var _iteratorError5 = undefined;
	
	    try {
	        for (var _iterator5 = state.inTree[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
	            var a = _step5.value;
	            newState.inTree.push(a);
	        }
	    } catch (err) {
	        _didIteratorError5 = true;
	        _iteratorError5 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion5 && _iterator5.return) {
	                _iterator5.return();
	            }
	        } finally {
	            if (_didIteratorError5) {
	                throw _iteratorError5;
	            }
	        }
	    }
	
	    var _iteratorNormalCompletion6 = true;
	    var _didIteratorError6 = false;
	    var _iteratorError6 = undefined;
	
	    try {
	        for (var _iterator6 = state.relations[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
	            var _a = _step6.value;
	
	            newState.relations.push({
	                relation: _a.relation,
	                from: _a.from,
	                to: _a.to
	            });
	        }
	    } catch (err) {
	        _didIteratorError6 = true;
	        _iteratorError6 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion6 && _iterator6.return) {
	                _iterator6.return();
	            }
	        } finally {
	            if (_didIteratorError6) {
	                throw _iteratorError6;
	            }
	        }
	    }
	
	    newState.recognitions = Object.assign({}, state.recognitions);
	    return newState;
	}
	
	/*function hashState(state){
	    // Canonical order
	    state.relations.sort((a,b) => {
	        if(a.relation == b.relation){
	            if(a.from.toString() == b.from.toString()){
	                return a.to.toString().localeCompare(b.to.toString())
	            }
	            else return a.from.toString().localeCompare(b.from.toString())
	        }
	        else return a.relation - b.relation
	    })
	    // Hash
	    let str = ""
	    for(let a of state.relations){
	        str += "f" + a.from.toString()
	        str += "t" + a.to.toString()
	        str += "r" + a.relation.toString()
	    }
	    for(let a of Object.keys(state.recognitions).sort()){
	        str += "k" + a
	        str += "c" + state.recognitions[a].toString()
	    }
	    return str
	}*/
	
	function hashState(state) {
	    // Canonical order
	    state.relations.sort(function (a, b) {
	        if (a.relation == b.relation) {
	            if (a.from == b.from) {
	                return a.to < b.to ? -1 : a.to > b.to ? 1 : 0;
	            } else return a.from < b.from ? -1 : a.from > b.from ? 1 : 0;
	        } else return a.relation - b.relation;
	    });
	    // Hash
	    var str = "";
	    var _iteratorNormalCompletion7 = true;
	    var _didIteratorError7 = false;
	    var _iteratorError7 = undefined;
	
	    try {
	        for (var _iterator7 = state.relations[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
	            var a = _step7.value;
	
	            str += "f" + a.from;
	            str += "t" + a.to;
	            str += "r" + a.relation.toString();
	        }
	    } catch (err) {
	        _didIteratorError7 = true;
	        _iteratorError7 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion7 && _iterator7.return) {
	                _iterator7.return();
	            }
	        } finally {
	            if (_didIteratorError7) {
	                throw _iteratorError7;
	            }
	        }
	    }
	
	    var _iteratorNormalCompletion8 = true;
	    var _didIteratorError8 = false;
	    var _iteratorError8 = undefined;
	
	    try {
	        for (var _iterator8 = Object.keys(state.recognitions).sort()[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
	            var _a2 = _step8.value;
	
	            str += "k" + _a2;
	            str += "c" + state.recognitions[_a2];
	        }
	    } catch (err) {
	        _didIteratorError8 = true;
	        _iteratorError8 = err;
	    } finally {
	        try {
	            if (!_iteratorNormalCompletion8 && _iterator8.return) {
	                _iterator8.return();
	            }
	        } finally {
	            if (_didIteratorError8) {
	                throw _iteratorError8;
	            }
	        }
	    }
	
	    return str;
	}
	
	function logMatrix(arr, width) {
	    for (var i = 0; i * width < arr.length; i++) {
	        var str = i.toString() + "  ";
	        for (var j = 0; j < width; j++) {
	            if (arr[i * width + j] > .95) {
	                str += " @";
	            } else if (arr[i * width + j] > .85) {
	                str += " %";
	            } else if (arr[i * width + j] > .7) {
	                str += " *";
	            } else if (arr[i * width + j] > .55) {
	                str += " +";
	            } else if (arr[i * width + j] > .4) {
	                str += " =";
	            } else if (arr[i * width + j] > .25) {
	                str += " -";
	            } else if (arr[i * width + j] > .1) {
	                str += " .";
	            } else {
	                str += "  ";
	            }
	        }
	        console.log(str);
	    }
	    console.log(" ");
	}
	
	function shuffle(a) {
	    for (var i = a.length; i; i--) {
	        var j = Math.floor(Math.random() * i);
	        var _ref2 = [a[j], a[i - 1]];
	        a[i - 1] = _ref2[0];
	        a[j] = _ref2[1];
	    }
	}
	
	exports.minkowskiDistance = minkowskiDistance;
	exports.eraseRepeatedPoints = eraseRepeatedPoints;
	exports.toUint16Array = toUint16Array;
	exports.shuffle = shuffle;
	exports.minimize = minimize;
	exports.uniqueSet = uniqueSet;
	exports.deepFlatten = deepFlatten;
	exports.hashRelations = hashRelations;
	exports.andArrays = andArrays;
	exports.copyState = copyState;
	exports.hashState = hashState;
	exports.logMatrix = logMatrix;
	exports.shuffle = shuffle;

/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {

	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate, module) {"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};!function t(e,n){"object"==( false?"undefined":_typeof(exports))&&"object"==( false?"undefined":_typeof(module))?module.exports=n(): true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (n), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):"object"==(typeof exports==="undefined"?"undefined":_typeof(exports))?exports.KerasJS=n():e.KerasJS=n();}(undefined,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports;}var n={};return e.m=t,e.c=n,e.i=function(t){return t;},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r});},e.n=function(t){var n=t&&t.__esModule?function e(){return t.default;}:function e(){return t;};return e.d(n,"a",n),n;},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e);},e.p="",e(e.s=227);}([function(t,e,n){var r=n(5),o=n(31),i=n(15),a=n(16),s=n(32),u="prototype",l=function l(t,e,n){var c=t&l.F,f=t&l.G,p=t&l.S,h=t&l.P,d=t&l.B,v=f?r:p?r[e]||(r[e]={}):(r[e]||{})[u],_=f?o:o[e]||(o[e]={}),m=_[u]||(_[u]={}),g,y,b,w;f&&(n=e);for(g in n){y=!c&&v&&void 0!==v[g],b=(y?v:n)[g],w=d&&y?s(b,r):h&&"function"==typeof b?s(Function.call,b):b,v&&a(v,g,b,t&l.U),_[g]!=b&&i(_,g,w),h&&m[g]!=b&&(m[g]=b);}};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),s=n(2),u=r(s),l=n(3),c=r(l),f=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this.layerClass="Layer",this.name=e.name,this.params=[],this.weights={},this.gpu=e.gpu,this.pipeline=e.pipeline,this._useWeblas=!1,this._pipelineEnabled=!1;}return a(t,[{key:"setWeights",value:function t(e){var n=this;this.params.forEach(function(t,r){n.weights[t]=e[r];});}},{key:"toggleGpu",value:function t(e){(void 0===e?!this._useWeblas:e)&&weblas?this._useWeblas=!0:this._useWeblas=!1;}},{key:"call",value:function t(e){return e;}},{key:"transferFromPipeline",value:function t(e){if(!e.weblasTensor)throw new Error("Variable passed in does not contain weblas tensor.");if(!e._fromPipeline)throw new Error("Variable passed in does not contain _fromPipeline.");if(!e._actualShape)throw new Error("Variable passed in does not contain _actualShape.");var n=e.weblasTensor.shape[1],r=e._actualShape.slice(0,-1).reduce(function(t,e){return t*e;},1),i=new u.default([],e.weblasTensor.shape);i.tensor.data=e.weblasTensor.transfer();for(var a=new u.default([],e._actualShape),s=new u.default([],[r]),l=new u.default([],e._actualShape.slice(0,-1)),f=0;f<n;f++){var p;c.default.assign(s.tensor,i.tensor.pick(null,f)),l.replaceTensorData(s.tensor.data);var h=Array(e._actualShape.length-1).fill(null);c.default.assign((p=a.tensor).pick.apply(p,o(h).concat([f])),l.tensor);}return a._fromPipeline=!1,a._actualShape&&delete a._actualShape,a;}}]),t;}();e.default=f;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),s=n(93),u=r(s),l=n(223),c=function t(e,n){if(e.length&&n.length&&e.length!==n.reduce(function(t,e){return t*e;},1))throw new Error("Specified shape incompatible with data.");},f=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,t),this._type=r.type||Float32Array,e&&e.length&&(e instanceof this._type||e instanceof Array)?(c(e,n),this.tensor=(0,u.default)(e,n),this.tensor=(0,u.default)(new this._type(e),n)):!e.length&&n.length?this.tensor=(0,u.default)(new this._type(n.reduce(function(t,e){return t*e;},1)),n):this.tensor=(0,u.default)(new this._type([]),[]);}return a(t,[{key:"replaceTensorData",value:function t(e){if(e&&e.length&&e instanceof this._type)this.tensor.data=e;else{if(!(e&&e.length&&e instanceof Array))throw new Error("[Tensor] invalid input for replaceTensorData method.");this.tensor.data=new this._type(e);}}},{key:"createWeblasTensor",value:function t(){if(this.weblasTensor&&this.weblasTensor.delete(),1===this.tensor.shape.length){var e=this.tensor.shape[0];if(e>l.MAX_TEXTURE_SIZE)this._gpuMaxSizeExceeded=!0;else{var n=[1,e];this.weblasTensor=new weblas.pipeline.Tensor(n,this.tensor.data);}}else{if(2!==this.tensor.shape.length)throw new Error("[Tensor] can only create weblas Tensor for 1-D or 2-D only");if(this.tensor.shape.some(function(t){return t>l.MAX_TEXTURE_SIZE;}))this._gpuMaxSizeExceeded=!0;else{var r=this.tensor.shape;this.weblasTensor=new weblas.pipeline.Tensor(r,this.tensor.data);}}}},{key:"deleteWeblasTensor",value:function t(){this.weblasTensor&&(this.weblasTensor.delete(),delete this.weblasTensor);}},{key:"copyFromWeblasTensor",value:function t(e){var r=weblas.gpu.gl,o=r.context,a=r.createProgram(n(634));this.weblasTensor=new weblas.pipeline.Tensor(e.shape,null),r.selectProgram(a),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,e.texture);var s=o.getUniformLocation(a,"source");o.uniform1i(s,0);var u=i(this.weblasTensor.shape,2),l=u[0],c=u[1],f=r.getPad(c);r.bindOutputTexture(l,(c+f)/4,this.weblasTensor.texture),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),r.unbindInputTexture(o.TEXTURE0);}}]),t;}();e.default=f;},function(t,e,n){"use strict";function r(t){if(!t)return s;for(var e=0;e<t.args.length;++e){var n=t.args[e];t.args[e]=0===e?{name:n,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:{name:n,lvalue:!1,rvalue:!0,count:1};}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t;}function o(t){return a({args:t.args,pre:r(t.pre),body:r(t.body),post:r(t.proc),funcName:t.funcName});}function i(t){for(var e=[],n=0;n<t.args.length;++n){e.push("a"+n);}return new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""))(o(t));}var a=n(173),s={body:"",args:[],thisVars:[],localVars:[]},u={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in u){var n=u[t];e[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+n+"c"},funcName:t}),e[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+n+"=b"},rvalue:!0,funcName:t+"eq"}),e[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+n+"s"},funcName:t+"s"}),e[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+n+"=s"},rvalue:!0,funcName:t+"seq"});}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var n=l[t];e[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+n+"b"},funcName:t}),e[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+n+"a"},rvalue:!0,count:2,funcName:t+"eq"});}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var n=c[t];e[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+n+"c"},funcName:t}),e[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+n+"s"},funcName:t+"s"}),e[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+n+"b"},rvalue:!0,count:2,funcName:t+"eq"}),e[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+n+"s"},rvalue:!0,count:2,funcName:t+"seq"});}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<f.length;++t){var n=f[t];e[n]=i({args:["array","array"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:n}),e[n+"eq"]=i({args:["array"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:n+"eq"});}}();var p=["max","min","atan2","pow"];!function(){for(var t=0;t<p.length;++t){var n=p[t];e[n]=i({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:n}),e[n+"s"]=i({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:n+"s"}),e[n+"eq"]=i({args:["array","array"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:n+"eq"}),e[n+"seq"]=i({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:n+"seq"});}}();var h=["atan2","pow"];!function(){for(var t=0;t<h.length;++t){var n=h[t];e[n+"op"]=i({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:n+"op"}),e[n+"ops"]=i({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:n+"ops"}),e[n+"opeq"]=i({args:["array","array"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:n+"opeq"}),e[n+"opseq"]=i({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+n,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:n+"opseq"});}}(),e.any=a({args:["array"],pre:s,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),e.all=a({args:["array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),e.sum=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),e.prod=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),e.norm2squared=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),e.norm2=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),e.norminf=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),e.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),e.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.argmin=a({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.argmax=a({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),e.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),e.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),e.equals=a({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"});},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t;};},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n);},function(t,e){t.exports=function(t){try{return!!t();}catch(t){return!0;}};},function(t,e){t.exports=function(t){return"object"==(typeof t==="undefined"?"undefined":_typeof(t))?null!==t:"function"==typeof t;};},function(t,e,n){var r=n(78)("wks"),o=n(48),i=n(5).Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t));}).store=r;},function(t,e,n){t.exports=!n(6)(function(){return 7!=Object.defineProperty({},"a",{get:function get(){return 7;}}).a;});},function(t,e,n){var r=n(4),o=n(153),i=n(28),a=Object.defineProperty;e.f=n(9)?Object.defineProperty:function t(e,n,s){if(r(e),n=i(n,!0),r(s),o)try{return a(e,n,s);}catch(t){}if("get"in s||"set"in s)throw TypeError("Accessors not supported!");return"value"in s&&(e[n]=s.value),e;};},function(t,e,n){var r=n(38),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0;};},function(t,e,n){var r=n(24);t.exports=function(t){return Object(r(t));};},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e);};},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t;};},function(t,e,n){var r=n(10),o=n(37);t.exports=n(9)?function(t,e,n){return r.f(t,e,o(1,n));}:function(t,e,n){return t[e]=n,t;};},function(t,e,n){var r=n(5),o=n(15),i=n(13),a=n(48)("src"),s="toString",u=Function[s],l=(""+u).split(s);n(31).inspectSource=function(t){return u.call(t);},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(u&&(i(n,a)||o(n,a,t[e]?""+t[e]:l.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)));})(Function.prototype,s,function t(){return"function"==typeof this&&this[a]||u.call(this);});},function(t,e,n){var r=n(0),o=n(6),i=n(24),a=/"/g,s=function s(t,e,n,r){var o=String(i(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(/"/g,"&quot;")+'"'),a+">"+o+"</"+e+">";};t.exports=function(t,e){var n={};n[t]=e(s),r(r.P+r.F*o(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3;}),"String",n);};},function(t,e,n){var r=n(62),o=n(24);t.exports=function(t){return r(o(t));};},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(1===t.tensor.shape.length){var e=d.default.sup(t.tensor);d.default.subseq(t.tensor,e),d.default.expeq(t.tensor);var n=d.default.sum(t.tensor);d.default.divseq(t.tensor,n);}else{if(2!==t.tensor.shape.length)throw new Error("[activations.softmax] tensor shape "+t.tensor.shape+" not supported.");for(var r=0;r<t.tensor.shape[0];r++){var o=d.default.sup(t.tensor.pick(r,null));d.default.subseq(t.tensor.pick(r,null),o),d.default.expeq(t.tensor.pick(r,null));var i=d.default.sum(t.tensor.pick(r,null));d.default.divseq(t.tensor.pick(r,null),i);}}return this;}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.alpha,r=void 0===n?1:n;return y(t.tensor,r),this;}function a(t){return b(t.tensor),this;}function s(t){return w(t.tensor),this;}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.alpha,r=void 0===n?0:n,o=e.maxValue,i=void 0===o?null:o,a=void 0;return 0!==r&&(a=new g.default([],t.tensor.shape),d.default.mins(a.tensor,t.tensor,0),d.default.mulseq(a.tensor,r)),d.default.maxseq(t.tensor,0),i&&d.default.minseq(t.tensor,i),a&&d.default.addeq(t.tensor,a.tensor),this;}function l(t){return x(t.tensor),this;}function c(t){return E(t.tensor),this;}function f(t){return T(t.tensor),this;}function p(t){return this;}Object.defineProperty(e,"__esModule",{value:!0}),e.softmax=o,e.elu=i,e.softplus=a,e.softsign=s,e.relu=u,e.tanh=l,e.sigmoid=c,e.hard_sigmoid=f,e.linear=p;var h=n(3),d=r(h),v=n(35),_=r(v),m=n(2),g=r(m),y=(0,_.default)({args:["array","scalar"],body:function t(e,n){e=Math.max(e,0)+n*(Math.exp(Math.min(e,0))-1);}}),b=(0,_.default)({args:["array"],body:function t(e){e=Math.log(Math.exp(e)+1);}}),w=(0,_.default)({args:["array"],body:function t(e){e/=1+Math.abs(e);}}),x=(0,_.default)({args:["array"],body:function t(e){e=Math.tanh(e);}}),E=(0,_.default)({args:["array"],body:function t(e){e=1/(1+Math.exp(-e));}}),T=(0,_.default)({args:["array"],body:function t(e){e=.2*e+.5,e<=0?e=0:e>=1&&(e=1);}});},function(t,e,n){"use strict";(function(e){function r(t){return"[object Array]"===T.call(t);}function o(t){return void 0!==e&&e.isBuffer&&e.isBuffer(t);}function i(t){return"[object ArrayBuffer]"===T.call(t);}function a(t){return"undefined"!=typeof FormData&&t instanceof FormData;}function s(t){var e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer;}function u(t){return"string"==typeof t;}function l(t){return"number"==typeof t;}function c(t){return void 0===t;}function f(t){return null!==t&&"object"==(typeof t==="undefined"?"undefined":_typeof(t));}function p(t){return"[object Date]"===T.call(t);}function h(t){return"[object File]"===T.call(t);}function d(t){return"[object Blob]"===T.call(t);}function v(t){return"[object Function]"===T.call(t);}function _(t){return f(t)&&v(t.pipe);}function m(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams;}function g(t){return t.replace(/^\s*/,"").replace(/\s*$/,"");}function y(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document;}function b(t,e){if(null!==t&&void 0!==t)if("object"==(typeof t==="undefined"?"undefined":_typeof(t))||r(t)||(t=[t]),r(t))for(var n=0,o=t.length;n<o;n++){e.call(null,t[n],n,t);}else for(var i in t){Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t);}}function w(){function t(t,n){"object"==_typeof(e[n])&&"object"==(typeof t==="undefined"?"undefined":_typeof(t))?e[n]=w(e[n],t):e[n]=t;}for(var e={},n=0,r=arguments.length;n<r;n++){b(arguments[n],t);}return e;}function x(t,e,n){return b(e,function e(r,o){t[o]=n&&"function"==typeof r?E(r,n):r;}),t;}var E=n(138),T=Object.prototype.toString;t.exports={isArray:r,isArrayBuffer:i,isBuffer:o,isFormData:a,isArrayBufferView:s,isString:u,isNumber:l,isObject:f,isUndefined:c,isDate:p,isFile:h,isBlob:d,isFunction:v,isStream:_,isURLSearchParams:m,isStandardBrowserEnv:y,forEach:b,merge:w,extend:x,trim:g};}).call(e,n(144).Buffer);},function(t,e,n){var r=n(63),o=n(37),i=n(18),a=n(28),s=n(13),u=n(153),l=Object.getOwnPropertyDescriptor;e.f=n(9)?l:function t(e,n){if(e=i(e),n=a(n,!0),u)try{return l(e,n);}catch(t){}if(s(e,n))return o(!r.f.call(e,n),e[n]);};},function(t,e,n){var r=n(13),o=n(12),i=n(112)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null;};},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1);};},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t;};},function(t,e,n){var r=n(6);t.exports=function(t,e){return!!t&&r(function(){e?t.call(null,function(){},1):t.call(null);});};},function(t,e,n){var r=n(32),o=n(62),i=n(12),a=n(11),s=n(301);t.exports=function(t,e){var n=1==t,u=2==t,l=3==t,c=4==t,f=6==t,p=5==t||f,h=e||s;return function(e,s,d){for(var v=i(e),_=o(v),m=r(s,d,3),g=a(_.length),y=0,b=n?h(e,g):u?h(e,0):void 0,w,x;g>y;y++){if((p||y in _)&&(w=_[y],x=m(w,y,v),t))if(n)b[y]=x;else if(x)switch(t){case 3:return!0;case 5:return w;case 6:return y;case 2:b.push(w);}else if(c)return!1;}return f?-1:l||c?c:b;};};},function(t,e,n){var r=n(0),o=n(31),i=n(6);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*i(function(){n(1);}),"Object",a);};},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value");};},function(t,e,n){var r=n(182),o="object"==(typeof self==="undefined"?"undefined":_typeof(self))&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i;},function(t,e){var n=Array.isArray;t.exports=n;},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n);},function(t,e,n){var r=n(14);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n);};case 2:return function(n,r){return t.call(e,n,r);};case 3:return function(n,r,o){return t.call(e,n,r,o);};}return function(){return t.apply(e,arguments);};};},function(t,e,n){var r=n(169),o=n(0),i=n(78)("metadata"),a=i.store||(i.store=new(n(172))()),s=function s(t,e,n){var o=a.get(t);if(!o){if(!n)return;a.set(t,o=new r());}var i=o.get(e);if(!i){if(!n)return;o.set(e,i=new r());}return i;},u=function u(t,e,n){var r=s(e,n,!1);return void 0!==r&&r.has(t);},l=function l(t,e,n){var r=s(e,n,!1);return void 0===r?void 0:r.get(t);},c=function c(t,e,n,r){s(n,r,!0).set(t,e);},f=function f(t,e){var n=s(t,e,!1),r=[];return n&&n.forEach(function(t,e){r.push(e);}),r;},p=function p(t){return void 0===t||"symbol"==(typeof t==="undefined"?"undefined":_typeof(t))?t:String(t);},h=function h(t){o(o.S,"Reflect",t);};t.exports={store:a,map:s,has:u,get:l,set:c,keys:f,key:p,exp:h};},function(t,e,n){"use strict";if(n(9)){var r=n(41),o=n(5),i=n(6),a=n(0),s=n(79),u=n(119),l=n(32),c=n(40),f=n(37),p=n(15),h=n(45),d=n(38),v=n(11),_=n(47),m=n(28),g=n(13),y=n(166),b=n(61),w=n(7),x=n(12),E=n(104),T=n(42),O=n(22),P=n(43).f,j=n(121),A=n(48),S=n(8),M=n(26),k=n(69),C=n(113),R=n(122),I=n(54),N=n(75),F=n(46),U=n(97),L=n(146),D=n(10),B=n(21),V=D.f,X=B.f,z=o.RangeError,W=o.TypeError,G=o.Uint8Array,q="ArrayBuffer",H="SharedArrayBuffer",Y="BYTES_PER_ELEMENT",K="prototype",$=Array[K],Q=u.ArrayBuffer,Z=u.DataView,J=M(0),tt=M(2),et=M(3),nt=M(4),rt=M(5),ot=M(6),it=k(!0),at=k(!1),st=R.values,ut=R.keys,lt=R.entries,ct=$.lastIndexOf,ft=$.reduce,pt=$.reduceRight,ht=$.join,dt=$.sort,vt=$.slice,_t=$.toString,mt=$.toLocaleString,gt=S("iterator"),yt=S("toStringTag"),bt=A("typed_constructor"),wt=A("def_constructor"),xt=s.CONSTR,Et=s.TYPED,Tt=s.VIEW,Ot="Wrong length!",Pt=M(1,function(t,e){return Ct(C(t,t[wt]),e);}),jt=i(function(){return 1===new G(new Uint16Array([1]).buffer)[0];}),At=!!G&&!!G[K].set&&i(function(){new G(1).set({});}),St=function St(t,e){if(void 0===t)throw W(Ot);var n=+t,r=v(t);if(e&&!y(n,r))throw z(Ot);return r;},Mt=function Mt(t,e){var n=d(t);if(n<0||n%e)throw z("Wrong offset!");return n;},kt=function kt(t){if(w(t)&&Et in t)return t;throw W(t+" is not a typed array!");},Ct=function Ct(t,e){if(!(w(t)&&bt in t))throw W("It is not a typed array constructor!");return new t(e);},Rt=function Rt(t,e){return It(C(t,t[wt]),e);},It=function It(t,e){for(var n=0,r=e.length,o=Ct(t,r);r>n;){o[n]=e[n++];}return o;},Nt=function Nt(t,e,n){V(t,e,{get:function get(){return this._d[n];}});},Ft=function t(e){var n=x(e),r=arguments.length,o=r>1?arguments[1]:void 0,i=void 0!==o,a=j(n),s,u,c,f,p,h;if(void 0!=a&&!E(a)){for(h=a.call(n),c=[],s=0;!(p=h.next()).done;s++){c.push(p.value);}n=c;}for(i&&r>2&&(o=l(o,arguments[2],2)),s=0,u=v(n.length),f=Ct(this,u);u>s;s++){f[s]=i?o(n[s],s):n[s];}return f;},Ut=function t(){for(var e=0,n=arguments.length,r=Ct(this,n);n>e;){r[e]=arguments[e++];}return r;},Lt=!!G&&i(function(){mt.call(new G(1));}),Dt=function t(){return mt.apply(Lt?vt.call(kt(this)):kt(this),arguments);},Bt={copyWithin:function t(e,n){return L.call(kt(this),e,n,arguments.length>2?arguments[2]:void 0);},every:function t(e){return nt(kt(this),e,arguments.length>1?arguments[1]:void 0);},fill:function t(e){return U.apply(kt(this),arguments);},filter:function t(e){return Rt(this,tt(kt(this),e,arguments.length>1?arguments[1]:void 0));},find:function t(e){return rt(kt(this),e,arguments.length>1?arguments[1]:void 0);},findIndex:function t(e){return ot(kt(this),e,arguments.length>1?arguments[1]:void 0);},forEach:function t(e){J(kt(this),e,arguments.length>1?arguments[1]:void 0);},indexOf:function t(e){return at(kt(this),e,arguments.length>1?arguments[1]:void 0);},includes:function t(e){return it(kt(this),e,arguments.length>1?arguments[1]:void 0);},join:function t(e){return ht.apply(kt(this),arguments);},lastIndexOf:function t(e){return ct.apply(kt(this),arguments);},map:function t(e){return Pt(kt(this),e,arguments.length>1?arguments[1]:void 0);},reduce:function t(e){return ft.apply(kt(this),arguments);},reduceRight:function t(e){return pt.apply(kt(this),arguments);},reverse:function t(){for(var e=this,n=kt(e).length,r=Math.floor(n/2),o=0,i;o<r;){i=e[o],e[o++]=e[--n],e[n]=i;}return e;},some:function t(e){return et(kt(this),e,arguments.length>1?arguments[1]:void 0);},sort:function t(e){return dt.call(kt(this),e);},subarray:function t(e,n){var r=kt(this),o=r.length,i=_(e,o);return new(C(r,r[wt]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,v((void 0===n?o:_(n,o))-i));}},Vt=function t(e,n){return Rt(this,vt.call(kt(this),e,n));},Xt=function t(e){kt(this);var n=Mt(arguments[1],1),r=this.length,o=x(e),i=v(o.length),a=0;if(i+n>r)throw z(Ot);for(;a<i;){this[n+a]=o[a++];}},zt={entries:function t(){return lt.call(kt(this));},keys:function t(){return ut.call(kt(this));},values:function t(){return st.call(kt(this));}},Wt=function Wt(t,e){return w(t)&&t[Et]&&"symbol"!=(typeof e==="undefined"?"undefined":_typeof(e))&&e in t&&String(+e)==String(e);},Gt=function t(e,n){return Wt(e,n=m(n,!0))?f(2,e[n]):X(e,n);},qt=function t(e,n,r){return!(Wt(e,n=m(n,!0))&&w(r)&&g(r,"value"))||g(r,"get")||g(r,"set")||r.configurable||g(r,"writable")&&!r.writable||g(r,"enumerable")&&!r.enumerable?V(e,n,r):(e[n]=r.value,e);};xt||(B.f=Gt,D.f=qt),a(a.S+a.F*!xt,"Object",{getOwnPropertyDescriptor:Gt,defineProperty:qt}),i(function(){_t.call({});})&&(_t=mt=function t(){return ht.call(this);});var Ht=h({},Bt);h(Ht,zt),p(Ht,gt,zt.values),h(Ht,{slice:Vt,set:Xt,constructor:function constructor(){},toString:_t,toLocaleString:Dt}),Nt(Ht,"buffer","b"),Nt(Ht,"byteOffset","o"),Nt(Ht,"byteLength","l"),Nt(Ht,"length","e"),V(Ht,yt,{get:function get(){return this[Et];}}),t.exports=function(t,e,n,u){u=!!u;var l=t+(u?"Clamped":"")+"Array",f="Uint8Array"!=l,h="get"+t,d="set"+t,_=o[l],m=_||{},g=_&&O(_),y=!_||!s.ABV,x={},E=_&&_[K],j=function j(t,n){var r=t._d;return r.v[h](n*e+r.o,jt);},A=function A(t,n,r){var o=t._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),o.v[d](n*e+o.o,r,jt);},S=function S(t,e){V(t,e,{get:function get(){return j(this,e);},set:function set(t){return A(this,e,t);},enumerable:!0});};y?(_=n(function(t,n,r,o){c(t,_,l,"_d");var i=0,a=0,s,u,f,h;if(w(n)){if(!(n instanceof Q||(h=b(n))==q||h==H))return Et in n?It(_,n):Ft.call(_,n);s=n,a=Mt(r,e);var d=n.byteLength;if(void 0===o){if(d%e)throw z(Ot);if((u=d-a)<0)throw z(Ot);}else if((u=v(o)*e)+a>d)throw z(Ot);f=u/e;}else f=St(n,!0),u=f*e,s=new Q(u);for(p(t,"_d",{b:s,o:a,l:u,e:f,v:new Z(s)});i<f;){S(t,i++);}}),E=_[K]=T(Ht),p(E,"constructor",_)):N(function(t){new _(null),new _(t);},!0)||(_=n(function(t,n,r,o){c(t,_,l);var i;return w(n)?n instanceof Q||(i=b(n))==q||i==H?void 0!==o?new m(n,Mt(r,e),o):void 0!==r?new m(n,Mt(r,e)):new m(n):Et in n?It(_,n):Ft.call(_,n):new m(St(n,f));}),J(g!==Function.prototype?P(m).concat(P(g)):P(m),function(t){t in _||p(_,t,m[t]);}),_[K]=E,r||(E.constructor=_));var M=E[gt],k=!!M&&("values"==M.name||void 0==M.name),C=zt.values;p(_,bt,!0),p(E,Et,l),p(E,Tt,!0),p(E,wt,_),(u?new _(1)[yt]==l:yt in E)||V(E,yt,{get:function get(){return l;}}),x[l]=_,a(a.G+a.W+a.F*(_!=m),x),a(a.S,l,{BYTES_PER_ELEMENT:e,from:Ft,of:Ut}),Y in E||p(E,Y,e),a(a.P,l,Bt),F(l),a(a.P+a.F*At,l,{set:Xt}),a(a.P+a.F*!k,l,zt),a(a.P+a.F*(E.toString!=_t),l,{toString:_t}),a(a.P+a.F*i(function(){new _(1).slice();}),l,{slice:Vt}),a(a.P+a.F*(i(function(){return[1,2].toLocaleString()!=new _([1,2]).toLocaleString();})||!i(function(){E.toLocaleString.call([1,2]);})),l,{toLocaleString:Dt}),I[l]=k?M:C,r||k||p(E,gt,C);};}else t.exports=function(){};},function(t,e,n){"use strict";function r(t){for(var e in t){a.indexOf(e)<0&&s.indexOf(e)<0&&console.warn("cwise: Unknown argument '"+e+"' passed to expression compiler");}for(var n=0;n<a.length;++n){if(!t[a[n]])throw new Error("cwise: Missing argument: "+a[n]);}return i({args:t.args,pre:o(t.pre||function(){}),body:o(t.body),post:o(t.post||function(){}),debug:!!t.printCode,funcName:t.funcName||t.body.name||"cwise",blockSize:t.blockSize||64});}var o=n(482),i=n(173),a=["args","body"],s=["pre","post","printCode","funcName","blockSize"];t.exports=r;},function(t,e,n){var r=n(48)("meta"),o=n(7),i=n(13),a=n(10).f,s=0,u=Object.isExtensible||function(){return!0;},l=!n(6)(function(){return u(Object.preventExtensions({}));}),c=function c(t){a(t,r,{value:{i:"O"+ ++s,w:{}}});},f=function f(t,e){if(!o(t))return"symbol"==(typeof t==="undefined"?"undefined":_typeof(t))?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!u(t))return"F";if(!e)return"E";c(t);}return t[r].i;},p=function p(t,e){if(!i(t,r)){if(!u(t))return!0;if(!e)return!1;c(t);}return t[r].w;},h=function h(t){return l&&d.NEED&&u(t)&&!i(t,r)&&c(t),t;},d=t.exports={KEY:r,NEED:!1,fastKey:f,getWeak:p,onFreeze:h};},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e};};},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t);};},function(t,e){var n;n=function(){return this;}();try{n=n||Function("return this")()||(0,eval)("this");}catch(t){"object"==(typeof window==="undefined"?"undefined":_typeof(window))&&(n=window);}t.exports=n;},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t;};},function(t,e){t.exports=!1;},function(t,e,n){var r=n(4),o=n(159),i=n(100),a=n(112)("IE_PROTO"),s=function s(){},u="prototype",_l=function l(){var t=n(99)("iframe"),e=i.length,r="<",o=">",a;for(t.style.display="none",n(102).appendChild(t),t.src="javascript:",a=t.contentWindow.document,a.open(),a.write("<script>document.F=Object<\/script>"),a.close(),_l=a.F;e--;){delete _l[u][i[e]];}return _l();};t.exports=Object.create||function t(e,n){var i;return null!==e?(s[u]=r(e),i=new s(),s[u]=null,i[a]=e):i=_l(),void 0===n?i:o(i,n);};},function(t,e,n){var r=n(161),o=n(100).concat("length","prototype");e.f=Object.getOwnPropertyNames||function t(e){return r(e,o);};},function(t,e,n){var r=n(161),o=n(100);t.exports=Object.keys||function t(e){return r(e,o);};},function(t,e,n){var r=n(16);t.exports=function(t,e,n){for(var o in e){r(t,o,e[o],n);}return t;};},function(t,e,n){"use strict";var r=n(5),o=n(10),i=n(9),a=n(8)("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function get(){return this;}});};},function(t,e,n){var r=n(38),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e);};},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36));};},function(t,e,n){function r(t,e){var n=i(t,e);return o(n)?n:void 0;}var o=n(510),i=n(542);t.exports=r;},function(t,e,n){function r(t){return a(t)?o(t):i(t);}var o=n(498),i=n(512),a=n(88);t.exports=r;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(2),c=r(l),f=n(1),p=r(f),h=n(59),d=r(h),v=n(3),_=r(v),m=n(92),g=r(m),y=n(197),b=r(y),w=n(89),x=r(w),E=n(194),T=r(E),O=n(195),P=r(O),j=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="_Merge",n;}return s(e,t),u(e,[{key:"_validateInputs",value:function t(e){var n=e.map(function(t){return t.tensor.shape.slice();});if(["sum","mul","ave","max"].indexOf(this.mode)>-1&&!n.every(function(t){return(0,x.default)(t,n[0]);}))throw new Error(this.name+" ["+this.layerClass+" layer] All input shapes must be the same for mode "+this.mode+".");if("dot"===this.mode){if(2!==e.length)throw new Error(this.name+" ["+this.layerClass+" layer] Exactly 2 inputs required for mode "+this.mode+".");if(this.dotAxes[0]<0&&(this.dotAxes[0]=n[0].length+this.dotAxes[0]),this.dotAxes[1]<0&&(this.dotAxes[1]=n[1].length+this.dotAxes[1]),n[0][this.dotAxes[0]]!==n[1][this.dotAxes[1]])throw new Error(this.name+" ["+this.layerClass+" layer] Dimensions incompatibility using dot mode.");}else if("concat"===this.mode){var r=n.slice(),o=this.concatAxis<0?r[0].length+this.concatAxis:this.concatAxis;if(0===this.concatAxis&&(o=0),(0,T.default)(r.length).forEach(function(t){r[t].splice(o,1);}),!r.every(function(t){return(0,x.default)(t,r[0]);}))throw new Error(this.name+" ["+this.layerClass+" layer] In concat mode, all shapes must be the same except along the concat axis.");}return!0;}},{key:"_callPipelineMode",value:function t(e){if(!e.every(function(t){return t._fromPipeline;}))return this._callRegularMode(e);var n=new c.default([],e[0].weblasTensor.shape);return n.weblasTensor=this.webglMerge.call(e.map(function(t){return t.weblasTensor;})),n._fromPipeline=!0,n._actualShape=e[0]._actualShape,"concat"===this.mode&&(n._actualShape=[].concat(o(e[0]._actualShape.slice(0,-1)),[(0,P.default)(e.map(function(t){return t._actualShape.slice(-1)[0];}))])),n;}},{key:"_callRegularMode",value:function t(e){if(!this._validateInputs(e))throw new Error(this.name+" ["+this.layerClass+" layer] Invalid inputs to call method.");var n=void 0,r=void 0;if(["sum","mul","ave","max"].indexOf(this.mode)>-1)r=e[0].tensor.shape.slice(),n=new c.default([],r);else if("concat"===this.mode){r=e[0].tensor.shape.slice();var o=this.concatAxis<0?r.length+this.concatAxis:this.concatAxis;0===this.concatAxis&&(o=0),e.slice(1,e.length).forEach(function(t){var e=t.tensor.shape.slice()[o];r[o]+=e;}),n=new c.default([],r);}else if("dot"===this.mode){var i=e[0].tensor.shape.slice(),a=e[1].tensor.shape.slice();i.splice(this.dotAxes[0],1),a.splice(this.dotAxes[1],1),r=i.concat(a),1===r.length&&r.push(1),n=new c.default([],r);}if("sum"===this.mode)for(var s=0;s<e.length;s++){_.default.addeq(n.tensor,e[s].tensor);}else if("mul"===this.mode){_.default.assigns(n.tensor,1);for(var u=0;u<e.length;u++){_.default.muleq(n.tensor,e[u].tensor);}}else if("ave"===this.mode){for(var l=0;l<e.length;l++){_.default.addeq(n.tensor,e[l].tensor);}_.default.divseq(n.tensor,e.length);}else if("max"===this.mode){_.default.assign(n.tensor,e[0].tensor);for(var f=1;f<e.length;f++){_.default.maxeq(n.tensor,e[f].tensor);}}else if("concat"===this.mode){var p=this.concatAxis<0?e[0].tensor.shape.length+this.concatAxis:this.concatAxis;if(0===this.concatAxis&&(p=0),0===p)(0,b.default)(n.tensor,e.map(function(t){return t.tensor;}));else{for(var h,v=[p],m=0;m<e[0].tensor.shape.length;m++){m!==p&&v.push(m);}(0,b.default)((h=n.tensor).transpose.apply(h,v),e.map(function(t){var e;return(e=t.tensor).transpose.apply(e,v);}));}}else if("dot"===this.mode){if(2!==e[0].tensor.shape.length||2!==e[1].tensor.shape.length)throw new Error(this.name+" ["+this.layerClass+" layer] dot mode for 3+ dim tensors not yet implemented.");if(0===this.dotAxes[0]&&0===this.dotAxes[1]){if(this.normalize){for(var g=0;g<e[0].tensor.shape[1];g++){_.default.divseq(e[0].tensor.pick(null,g),_.default.norm2(e[0].tensor.pick(null,g)));}for(var y=0;y<e[1].tensor.shape[1];y++){_.default.divseq(e[1].tensor.pick(null,y),_.default.norm2(e[1].tensor.pick(null,y)));}}(0,d.default)(n.tensor,e[0].tensor.transpose(1,0),e[1].tensor);}else if(1===this.dotAxes[0]&&1===this.dotAxes[1]){if(this.normalize){for(var w=0;w<e[0].tensor.shape[0];w++){_.default.divseq(e[0].tensor.pick(w,null),_.default.norm2(e[0].tensor.pick(w,null)));}for(var x=0;x<e[1].tensor.shape[0];x++){_.default.divseq(e[1].tensor.pick(x,null),_.default.norm2(e[1].tensor.pick(x,null)));}}(0,d.default)(n.tensor,e[0].tensor,e[1].tensor.transpose(1,0));}}return n;}},{key:"call",value:function t(e){return this._pipelineEnabled?this._callPipelineMode(e):this._callRegularMode(e);}}]),e;}(p.default);e.default=j;},function(t,e,n){var r=n(8)("unscopables"),o=Array.prototype;void 0==o[r]&&n(15)(o,r,{}),t.exports=function(t){o[r][t]=!0;};},function(t,e,n){var r=n(32),o=n(155),i=n(104),a=n(4),s=n(11),u=n(121),l={},c={},e=t.exports=function(t,e,n,f,p){var h=p?function(){return t;}:u(t),d=r(n,f,e?2:1),v=0,_,m,g,y;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(i(h)){for(_=s(t.length);_>v;v++){if((y=e?d(a(m=t[v])[0],m[1]):d(t[v]))===l||y===c)return y;}}else for(g=h.call(t);!(m=g.next()).done;){if((y=o(g,d,m.value,e))===l||y===c)return y;}};e.BREAK=l,e.RETURN=c;},function(t,e){t.exports={};},function(t,e,n){var r=n(10).f,o=n(13),i=n(8)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e});};},function(t,e,n){var r=n(0),o=n(24),i=n(6),a=n(117),s="["+a+"]",u="​",l=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),f=function f(t,e,n){var o={},s=i(function(){return!!a[t]()||u[t]()!=u;}),l=o[t]=s?e(p):a[t];n&&(o[n]=l),r(r.P+r.F*s,"String",o);},p=f.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(c,"")),t;};t.exports=f;},function(t,e){function n(t){var e=typeof t==="undefined"?"undefined":_typeof(t);return null!=t&&("object"==e||"function"==e);}t.exports=n;},function(t,e,n){"use strict";t.exports.gemv=n(610),t.exports.gbmv=n(609),t.exports.symv=n(616),t.exports.sbmv=n(612),t.exports.spmv=n(613),t.exports.trmv=n(622),t.exports.tbmv=n(619),t.exports.trsv=n(623),t.exports.tbsv=n(620),t.exports.tpsv=n(621),t.exports.ger=n(611),t.exports.syr=n(617),t.exports.spr=n(614),t.exports.syr2=n(618),t.exports.spr2=n(615),t.exports.trmv_lower=function(e,n){return console.warn("trmv_lower is deprecated. Please use the 'isLower' flag with trmv."),t.exports.trmv(e,n,!0);},t.exports.trsv_lower=function(e,n){return console.warn("trsv_lower is deprecated. Please use the 'isLower' flag with trsv."),t.exports.trsv(e,n,!0);};},function(t,e,n){"use strict";function r(t){return Array.isArray(t)?[t.length,t[0].length]:t.shape;}function o(t,e,n){var o=r(t),i=r(e),a=r(n);if(o[0]!==i[0]||o[1]!==a[1]||i[1]!==a[0])throw new Error("Mismatched array shapes for matrix product");}function i(t){if(Array.isArray(t)){if(Array.isArray(t))return["r","native"];}else if(t.shape&&2===t.shape.length)return t.order[0]?["r",t.dtype]:["c",t.dtype];throw new Error("Unrecognized data type");}function a(t,e,n,r,a){void 0===r&&(r=1),void 0===a&&(a=0);var l=1!==r,c=0!==a,f=i(t),p=i(e),h=i(n);o(t,e,n);var d=[f,p,h,l,c].join(":"),v=u[d];return v||(v=u[d]=s(f,p,h,l,c)),v(t,e,n,r,a);}t.exports=a;var s=n(624),u={};},function(t,e,n){"use strict";function r(t,e){switch(t){case"Activation":case"Conv2D":return["linear","relu"].indexOf(e.activation)>-1;case"BatchNormalization":return 0===e.mode;case"MaxPooling2D":case"AveragePooling2D":return!0;case"Merge":return["concat","sum","mul","ave","max"].indexOf(e.mode)>-1;default:return!1;}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;},function(t,e,n){var r=n(23),o=n(8)("toStringTag"),i="Arguments"==r(function(){return arguments;}()),a=function a(t,e){try{return t[e];}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),o))?n:i?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s;};},function(t,e,n){var r=n(23);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t);};},function(t,e){e.f={}.propertyIsEnumerable;},function(t,e,n){var r=n(29),o=r.Symbol;t.exports=o;},function(t,e,n){function r(t){return null==t?void 0===t?u:s:l&&l in Object(t)?i(t):a(t);}var o=n(64),i=n(540),a=n(566),s="[object Null]",u="[object Undefined]",l=o?o.toStringTag:void 0;t.exports=r;},function(t,e,n){function r(t){if("string"==typeof t||o(t))return t;var e=t+"";return"0"==e&&1/t==-i?"-0":e;}var o=n(90),i=1/0;t.exports=r;},function(t,e){function n(t){return null!=t&&"object"==(typeof t==="undefined"?"undefined":_typeof(t));}t.exports=n;},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),i=function(){function t(){r(this,t),this.MAX_NUM_TEXTURES=8,this.webgl=weblas.gpu.gl,this.numTextures=8;}return o(t,[{key:"_bindInputTexture",value:function t(e,n,r,o){var i=this.webgl.context;i.activeTexture(r),i.bindTexture(i.TEXTURE_2D,n);var a=i.getUniformLocation(e,o);i.uniform1i(a,r-i.TEXTURE0);}},{key:"_compute",value:function t(){var e=this.webgl.context;e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0);}},{key:"_unbindInputTextures",value:function t(){for(var e=this.webgl.context,n=0;n<this.numTextures;n++){this.webgl.unbindInputTexture(e.TEXTURE0+n);}}}]),t;}();e.default=i;},function(t,e,n){var r=n(18),o=n(11),i=n(47);t.exports=function(t){return function(e,n,a){var s=r(e),u=o(s.length),l=i(a,u),c;if(t&&n!=n){for(;u>l;){if((c=s[l++])!=c)return!0;}}else for(;u>l;l++){if((t||l in s)&&s[l]===n)return t||l||0;}return!t&&-1;};};},function(t,e,n){"use strict";var r=n(5),o=n(0),i=n(16),a=n(45),s=n(36),u=n(53),l=n(40),c=n(7),f=n(6),p=n(75),h=n(55),d=n(103);t.exports=function(t,e,n,v,_,m){var g=r[t],y=g,b=_?"set":"add",w=y&&y.prototype,x={},E=function E(t){var e=w[t];i(w,t,"delete"==t?function(t){return!(m&&!c(t))&&e.call(this,0===t?0:t);}:"has"==t?function t(n){return!(m&&!c(n))&&e.call(this,0===n?0:n);}:"get"==t?function t(n){return m&&!c(n)?void 0:e.call(this,0===n?0:n);}:"add"==t?function t(n){return e.call(this,0===n?0:n),this;}:function t(n,r){return e.call(this,0===n?0:n,r),this;});};if("function"==typeof y&&(m||w.forEach&&!f(function(){new y().entries().next();}))){var T=new y(),O=T[b](m?{}:-0,1)!=T,P=f(function(){T.has(1);}),j=p(function(t){new y(t);}),A=!m&&f(function(){for(var t=new y(),e=5;e--;){t[b](e,e);}return!t.has(-0);});j||(y=e(function(e,n){l(e,y,t);var r=d(new g(),e,y);return void 0!=n&&u(n,_,r[b],r),r;}),y.prototype=w,w.constructor=y),(P||A)&&(E("delete"),E("has"),_&&E("get")),(A||O)&&E(b),m&&w.clear&&delete w.clear;}else y=v.getConstructor(e,t,_,b),a(y.prototype,n),s.NEED=!0;return h(y,t),x[t]=y,o(o.G+o.W+o.F*(y!=g),x),m||v.setStrong(y,t,_),y;};},function(t,e,n){"use strict";var r=n(15),o=n(16),i=n(6),a=n(24),s=n(8);t.exports=function(t,e,n){var u=s(t),l=n(a,u,""[t]),c=l[0],f=l[1];i(function(){var e={};return e[u]=function(){return 7;},7!=""[t](e);})&&(o(String.prototype,t,c),r(RegExp.prototype,u,2==e?function(t,e){return f.call(t,this,e);}:function(t){return f.call(t,this);}));};},function(t,e,n){"use strict";var r=n(4);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e;};},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3]);}return t.apply(n,e);};},function(t,e,n){var r=n(7),o=n(23),i=n(8)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t));};},function(t,e,n){var r=n(8)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0;},Array.from(i,function(){throw 2;});}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0};},i[r]=function(){return a;},t(i);}catch(t){}return n;};},function(t,e,n){t.exports=n(41)||!n(6)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete n(5)[t];});},function(t,e){e.f=Object.getOwnPropertySymbols;},function(t,e,n){var r=n(5),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={});};},function(t,e,n){for(var r=n(5),o=n(15),i=n(48),a=i("typed_array"),s=i("view"),u=!(!r.ArrayBuffer||!r.DataView),l=u,c=0,f=9,p,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");c<9;){(p=r[h[c++]])?(o(p.prototype,a,!0),o(p.prototype,s,!0)):l=!1;}t.exports={ABV:u,CONSTR:l,TYPED:a,VIEW:s};},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1]);}}var o=n(553),i=n(554),a=n(555),s=n(556),u=n(557);r.prototype.clear=o,r.prototype.delete=i,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,t.exports=r;},function(t,e,n){function r(t,e){for(var n=t.length;n--;){if(o(t[n][0],e))return n;}return-1;}var o=n(87);t.exports=r;},function(t,e,n){function r(t){return"function"==typeof t?t:null==t?a:"object"==(typeof t==="undefined"?"undefined":_typeof(t))?s(t)?i(t[0],t[1]):o(t):u(t);}var o=n(513),i=n(514),a=n(129),s=n(30),u=n(591);t.exports=r;},function(t,e,n){function r(t,e){return o(t)?t:i(t,e)?[t]:a(s(t));}var o=n(30),i=n(128),a=n(580),s=n(597);t.exports=r;},function(t,e,n){function r(t,e){var n=t.__data__;return o(e)?n["string"==typeof e?"string":"hash"]:n.map;}var o=n(550);t.exports=r;},function(t,e){function n(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<e;}var r=9007199254740991,o=/^(?:0|[1-9]\d*)$/;t.exports=n;},function(t,e,n){var r=n(49),o=r(Object,"create");t.exports=o;},function(t,e){function n(t,e){return t===e||t!==t&&e!==e;}t.exports=n;},function(t,e,n){function r(t){return null!=t&&i(t.length)&&!o(t);}var o=n(192),i=n(131);t.exports=r;},function(t,e,n){function r(t,e){return o(t,e);}var o=n(127);t.exports=r;},function(t,e,n){function r(t){return"symbol"==(typeof t==="undefined"?"undefined":_typeof(t))||i(t)&&o(t)==a;}var o=n(65),i=n(67),a="[object Symbol]";t.exports=r;},function(t,e,n){"use strict";t.exports.swap=n(608),t.exports.scal=n(607),t.exports.copy=n(601),t.exports.axpy=n(600),t.exports.dot=n(603),t.exports.cpsc=n(602),t.exports.nrm2=n(605),t.exports.asum=n(599),t.exports.iamax=n(604),t.exports.rotg=n(606);},function(t,e,n){"use strict";function r(t,e){var n,r;if(void 0!==e&&(!Number.isFinite(e)||e%1!==e))throw new Error("axis of dimension to unsqueeze must be an integer");return e=void 0===e?t.shape.length:e,n=t.shape.slice(0),r=t.stride.slice(0),n.splice(e||0,0,1),r.splice(e||0,0,(r[e]||1)*(n[e+1]||1)),o(t.data,n,r,t.offset);}var o=n(93);t.exports=r;},function(t,e,n){function r(t,e){return t[0]-e[0];}function o(){var t=this.stride,e=new Array(t.length),n;for(n=0;n<e.length;++n){e[n]=[Math.abs(t[n]),n];}e.sort(r);var o=new Array(e.length);for(n=0;n<o.length;++n){o[n]=e[n][1];}return o;}function i(t,e){var n=["View",e,"d",t].join("");e<0&&(n="View_Nil"+t);var r="generic"===t;if(-1===e){var i="function "+n+"(a){this.data=a;};var proto="+n+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+n+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+n+"(a){return new "+n+"(a);}",a=new Function(i);return a();}if(0===e){var i="function "+n+"(a,d) {this.data = a;this.offset = d};var proto="+n+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+n+"_copy() {return new "+n+"(this.data,this.offset)};proto.pick=function "+n+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+n+"_get(){return "+(r?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+n+"_set(v){return "+(r?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+n+"(a,b,c,d){return new "+n+"(a,d)}",a=new Function("TrivialArray",i);return a(f[t][0]);}var i=["'use strict'"],s=u(e),l=s.map(function(t){return"i"+t;}),c="this.offset+"+s.map(function(t){return"this.stride["+t+"]*i"+t;}).join("+"),p=s.map(function(t){return"b"+t;}).join(","),h=s.map(function(t){return"c"+t;}).join(",");i.push("function "+n+"(a,"+p+","+h+",d){this.data=a","this.shape=["+p+"]","this.stride=["+h+"]","this.offset=d|0}","var proto="+n+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),i.push("Object.defineProperty(proto,'size',{get:function "+n+"_size(){return "+s.map(function(t){return"this.shape["+t+"]";}).join("*"),"}})"),1===e?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),e<4?(i.push("function "+n+"_order(){"),2===e?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+n+"_set("+l.join(",")+",v){"),r?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+n+"_get("+l.join(",")+"){"),r?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+n+"_index(",l.join(),"){return "+c+"}"),i.push("proto.hi=function "+n+"_hi("+l.join(",")+"){return new "+n+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("");}).join(",")+","+s.map(function(t){return"this.stride["+t+"]";}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]";}),v=s.map(function(t){return"c"+t+"=this.stride["+t+"]";});i.push("proto.lo=function "+n+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+v.join(","));for(var _=0;_<e;++_){i.push("if(typeof i"+_+"==='number'&&i"+_+">=0){d=i"+_+"|0;b+=c"+_+"*d;a"+_+"-=d}");}i.push("return new "+n+"(this.data,"+s.map(function(t){return"a"+t;}).join(",")+","+s.map(function(t){return"c"+t;}).join(",")+",b)}"),i.push("proto.step=function "+n+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]";}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]";}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var _=0;_<e;++_){i.push("if(typeof i"+_+"==='number'){d=i"+_+"|0;if(d<0){c+=b"+_+"*(a"+_+"-1);a"+_+"=ceil(-a"+_+"/d)}else{a"+_+"=ceil(a"+_+"/d)}b"+_+"*=d}");}i.push("return new "+n+"(this.data,"+s.map(function(t){return"a"+t;}).join(",")+","+s.map(function(t){return"b"+t;}).join(",")+",c)}");for(var m=new Array(e),g=new Array(e),_=0;_<e;++_){m[_]="a[i"+_+"]",g[_]="b[i"+_+"]";}i.push("proto.transpose=function "+n+"_transpose("+l+"){"+l.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)";}).join(";"),"var a=this.shape,b=this.stride;return new "+n+"(this.data,"+m.join(",")+","+g.join(",")+",this.offset)}"),i.push("proto.pick=function "+n+"_pick("+l+"){var a=[],b=[],c=this.offset");for(var _=0;_<e;++_){i.push("if(typeof i"+_+"==='number'&&i"+_+">=0){c=(c+this.stride["+_+"]*i"+_+")|0}else{a.push(this.shape["+_+"]);b.push(this.stride["+_+"])}");}i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+n+"(data,shape,stride,offset){return new "+n+"(data,"+s.map(function(t){return"shape["+t+"]";}).join(",")+","+s.map(function(t){return"stride["+t+"]";}).join(",")+",offset)}");var a=new Function("CTOR_LIST","ORDER",i.join("\n"));return a(f[t],o);}function a(t){if(l(t))return"buffer";if(c)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";}return Array.isArray(t)?"array":"generic";}function s(t,e,n,r){if(void 0===t){var o=f.array[0];return o([]);}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===n){n=new Array(s);for(var u=s-1,l=1;u>=0;--u){n[u]=l,l*=e[u];}}if(void 0===r){r=0;for(var u=0;u<s;++u){n[u]<0&&(r-=(e[u]-1)*n[u]);}}for(var c=a(t),p=f[c];p.length<=s+1;){p.push(i(c,p.length-1));}var o=p[s+1];return o(t,e,n,r);}var u=n(485),l=n(486),c="undefined"!=typeof Float64Array,f={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=s;},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function get(){return t.l;}}),Object.defineProperty(t,"id",{enumerable:!0,get:function get(){return t.i;}}),t.webpackPolyfill=1),t;};},function(t,e,n){"use strict";(function(e){function r(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e);}function o(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(134):void 0!==e&&(t=n(134)),t;}var i=n(20),a=n(220),s={"Content-Type":"application/x-www-form-urlencoded"},u={adapter:o(),transformRequest:[function t(e,n){return a(n,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(r(n,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(r(n,"application/json;charset=utf-8"),JSON.stringify(e)):e;}],transformResponse:[function t(e){if("string"==typeof e)try{e=JSON.parse(e);}catch(t){}return e;}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function t(e){return e>=200&&e<300;}};u.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function t(e){u.headers[e]={};}),i.forEach(["post","put","patch"],function t(e){u.headers[e]=i.merge(s);}),t.exports=u;}).call(e,n(132));},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),f=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},p=n(19),h=o(p),d=n(2),v=r(d),_=n(1),m=r(_),g=n(3),y=r(g),b=n(59),w=r(b),x=n(60),E=r(x),T=n(224),O=r(T),P=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var n=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Conv2D";var r=t.filters,o=void 0===r?1:r,u=t.kernel_size,l=void 0===u?[3,3]:u,c=t.strides,f=void 0===c?[1,1]:c,p=t.padding,d=void 0===p?"valid":p,v=t.data_format,_=void 0===v?"channels_last":v,m=t.dilation_rate,g=void 0===m?[1,1]:m,y=t.activation,b=void 0===y?"linear":y,w=t.use_bias,x=void 0===w||w;if(Array.isArray(l)?n.kernelShape=[o].concat(i(l)):n.kernelShape=[o,l,l],Array.isArray(f)?n.strides=f:n.strides=[f,f],"valid"!==d&&"same"!==d)throw new Error(n.name+" [Conv2D layer] Invalid padding.");if(n.padding=d,"channels_last"!==_&&"channels_first"!==_)throw new Error(n.name+" [Conv2D layer] Only channels_last and channels_first data formats are allowed.");if(n.dataFormat=_,Array.isArray(g)?n.dilationRate=g:n.dilationRate=[g,g],!(1===n.dilationRate[0]&&1===n.dilationRate[1]||1===n.strides[0]&&1===n.strides[1]))throw new Error(n.name+" [Conv2D layer] Incompatible combination of dilation_rate with strides.");if(n.activation=b,n.activationFunc=h[b],n.use_bias=x,n.params=n.use_bias?["kernel","bias"]:["kernel"],n.gpu&&weblas&&(n._useWeblas=!0,n.pipeline)){(0,E.default)(n.layerClass,t)?(n._pipelineEnabled=!0,n.webglConv2D=new O.default()):n._pipelineEnabled=!1;}return n;}return u(e,t),c(e,[{key:"setWeights",value:function t(n){"channels_first"===this.dataFormat&&(n[0].tensor=n[0].tensor.transpose(2,3,1,0)),f(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n),this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat._gpuMaxSizeExceeded||(this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose()),this.use_bias?this.weights.bias.createWeblasTensor():(this._zerosVec=new v.default([],[this.weights.kernel.tensor.shape[3]]),this._zerosVec.createWeblasTensor()));}},{key:"_calcOutputShape",value:function t(e){var n=e[0],r=e[1],o=l(this.kernelShape,3),i=o[0],a=o[1],s=o[2],u=a+(a-1)*(this.dilationRate[0]-1),c=s+(s-1)*(this.dilationRate[1]-1),f="same"===this.padding?Math.floor((n+this.strides[0]-1)/this.strides[0]):Math.floor((n-u+this.strides[0])/this.strides[0]),p="same"===this.padding?Math.floor((r+this.strides[1]-1)/this.strides[1]):Math.floor((r-c+this.strides[1])/this.strides[1]),h=i,d="same"===this.padding?Math.max(0,Math.floor((f-1)*this.strides[0]+u-n)):0,v="same"===this.padding?Math.max(0,Math.floor((p-1)*this.strides[1]+c-r)):0,_=Math.floor(d/2),m=d-_,g=Math.floor(v/2),y=v-g;this.outputShape=[f,p,h],this.inputPadding=[_,m,g,y];}},{key:"_padInput",value:function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if("same"===this.padding){var r=l(e.tensor.shape,3),o=r[0],i=r[1],a=r[2],s=l(this.inputPadding,4),u=s[0],c=s[1],f=s[2],p=s[3],h=o+u+c,d=i+f+p,_=new v.default([],[h,d,a]);0!==n&&y.default.assigns(_.tensor,n),y.default.assign(_.tensor.hi(o+u,i+f,a).lo(u,f,0),e.tensor),e.tensor=_.tensor;}return e;}},{key:"_im2col",value:function t(e){var n=l(e.tensor.shape,3),r=n[0],o=n[1],i=n[2],a=this.kernelShape[1],s=this.kernelShape[2],u=this.outputShape[0],c=this.outputShape[1],f=u*c,p=a*s*i,h=a+(a-1)*(this.dilationRate[0]-1),d=s+(s-1)*(this.dilationRate[1]-1);if(this._imColsMat||(this._imColsMat=new v.default([],[f,p])),1===h&&1===d&&1===this.strides[0]&&1===this.strides[1])return this._imColsMat.replaceTensorData(e.tensor.data),this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat;for(var _=new v.default([],[a,s,i]),m=0,g=0,b=r-h;g<=b;g+=this.strides[0]){for(var w=0,x=o-d;w<=x;w+=this.strides[1]){y.default.assign(_.tensor,e.tensor.hi(g+h,w+d,i).lo(g,w,0).step(this.dilationRate[0],this.dilationRate[1],1)),this._imColsMat.tensor.data.set(_.tensor.data,m),m+=p;}}return this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat;}},{key:"_w2row",value:function t(){var e=this.weights.kernel.tensor.shape[2],n=l(this.kernelShape,3),r=n[0],o=n[1],i=n[2],a=o*i*e;this._wRowsMat=new v.default([],[a,r]);for(var s=new v.default([],[o,i,e]),u=new v.default([],[a]),c=0;c<r;c++){y.default.assign(s.tensor,this.weights.kernel.tensor.pick(null,null,null,c)),u.replaceTensorData(s.tensor.data),y.default.assign(this._wRowsMat.tensor.pick(null,c),u.tensor);}return this._wRowsMat;}},{key:"_tiledIndexMapping",value:function t(e){if(!this._tiledIndexMappingRow||!this._tiledIndexMappingCol){for(var n=l(e,3),r=n[0],o=n[1],i=n[2],a=new v.default([],e),s=new v.default([],e),u=0;u<r;u++){for(var c=0;c<o;c++){y.default.assigns(a.tensor.pick(u,c,null),u*o+c);}}for(var f=0;f<i;f++){y.default.assigns(s.tensor.pick(null,null,f),f);}if("same"===this.padding){var p=l(this.inputPadding,4),h=p[0],d=p[1],_=p[2],m=p[3];r=r+h+d,o=o+_+m;var g=-1;this._padInput(a,-1),this._padInput(s,-1);}var b=this.kernelShape[1],w=this.kernelShape[2],x=this.outputShape[0],E=this.outputShape[1],T=x*E,O=b*w*i;this._tiledIndexMappingRow=new v.default([],[T,O]),this._tiledIndexMappingCol=new v.default([],[T,O]);for(var P=new v.default([],[b,w,i]),j=new v.default([],[b,w,i]),A=0,S=0,M=r-b;S<=M;S+=this.strides[0]){for(var k=0,C=o-w;k<=C;k+=this.strides[1]){y.default.assign(P.tensor,a.tensor.hi(S+b,k+w,i).lo(S,k,0)),y.default.assign(j.tensor,s.tensor.hi(S+b,k+w,i).lo(S,k,0)),this._tiledIndexMappingRow.tensor.data.set(P.tensor.data,A),this._tiledIndexMappingCol.tensor.data.set(j.tensor.data,A),A+=O;}}this._tiledIndexMappingRow.createWeblasTensor(),this._tiledIndexMappingCol.createWeblasTensor();}}},{key:"_callPipelineMode",value:function t(e){if(!e.weblasTensor)throw new Error("Variable passed in does not contain weblas tensor.");this._tiledIndexMapping(this.inputShape);var n=this.use_bias?this.weights.bias.weblasTensor:this._zerosVec.weblasTensor;return e.weblasTensor=this.webglConv2D.call(e.weblasTensor,this._wRowsMat.weblasTensor,n,this.activation,e._fromPipeline?this._tiledIndexMappingRow.weblasTensor:null,e._fromPipeline?this._tiledIndexMappingCol.weblasTensor:null),e._fromPipeline=!0,e._actualShape=this.outputShape,e;}},{key:"_callRegularMode",value:function t(e){if(!e.tensor)throw new Error("Variable passed in does not contain tensor.");"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));var n=this.kernelShape[0],r=this.outputShape[0],o=this.outputShape[1],i=r*o,a=new v.default([],[i,n]);if(!this._useWeblas||this._imColsMat._gpuMaxSizeExceeded||this._wRowsMat._gpuMaxSizeExceeded){if(this.use_bias)for(var s=0;s<n;s++){y.default.assigns(a.tensor.pick(null,s),this.weights.bias.tensor.get(s));}(0,w.default)(a.tensor,this._imColsMat.tensor,this._wRowsMat.tensor,1,1);}else{var u=this.use_bias?this.weights.bias.weblasTensor:this._zerosVec.weblasTensor;a.tensor.data=weblas.pipeline.sgemm(1,this._imColsMat.weblasTensor,this._wRowsMat.weblasTensor,1,u).transfer();}for(var l=new v.default([],this.outputShape),c=new v.default([],[r*o]),f=new v.default([],[r,o]),p=0;p<n;p++){y.default.assign(c.tensor,a.tensor.pick(null,p)),f.replaceTensorData(c.tensor.data),y.default.assign(l.tensor.pick(null,null,p),f.tensor);}return e.tensor=l.tensor,this.activationFunc(e),"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(2,0,1)),e;}},{key:"call",value:function t(e){if(e._fromPipeline?this.inputShape=e._actualShape:this.inputShape=e.tensor.shape,this._calcOutputShape(this.inputShape),this._pipelineEnabled){if(!e._fromPipeline){if(this._padInput(e),this._im2col(e),this._imColsMat._gpuMaxSizeExceeded)return this._callRegularMode(e);e.weblasTensor=this._imColsMat.weblasTensor;}return this._callPipelineMode(e);}return this._padInput(e),this._im2col(e),this._callRegularMode(e);}}]),e;}(m.default);e.default=P;},function(t,e,n){"use strict";var r=n(12),o=n(47),i=n(11);t.exports=function t(e){for(var n=r(this),a=i(n.length),s=arguments.length,u=o(s>1?arguments[1]:void 0,a),l=s>2?arguments[2]:void 0,c=void 0===l?a:o(l,a);c>u;){n[u++]=e;}return n;};},function(t,e,n){"use strict";var r=n(10),o=n(37);t.exports=function(t,e,n){e in t?r.f(t,e,o(0,n)):t[e]=n;};},function(t,e,n){var r=n(7),o=n(5).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{};};},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");},function(t,e,n){var r=n(8)("match");t.exports=function(t){var e=/./;try{"/./"[t](e);}catch(n){try{return e[r]=!1,!"/./"[t](e);}catch(t){}}return!0;};},function(t,e,n){t.exports=n(5).document&&document.documentElement;},function(t,e,n){var r=n(7),o=n(111).set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t;};},function(t,e,n){var r=n(54),o=n(8)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t);};},function(t,e,n){var r=n(23);t.exports=Array.isArray||function t(e){return"Array"==r(e);};},function(t,e,n){"use strict";var r=n(42),o=n(37),i=n(55),a={};n(15)(a,n(8)("iterator"),function(){return this;}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator");};},function(t,e,n){"use strict";var r=n(41),o=n(0),i=n(16),a=n(15),s=n(13),u=n(54),l=n(106),c=n(55),f=n(22),p=n(8)("iterator"),h=!([].keys&&"next"in[].keys()),d="keys",v="values",_=function _(){return this;};t.exports=function(t,e,n,m,g,y,b){l(n,e,m);var w=function w(t){if(!h&&t in O)return O[t];switch(t){case d:return function e(){return new n(this,t);};case v:return function e(){return new n(this,t);};}return function e(){return new n(this,t);};},x=e+" Iterator",E=g==v,T=!1,O=t.prototype,P=O[p]||O["@@iterator"]||g&&O[g],j=P||w(g),A=g?E?w("entries"):j:void 0,S="Array"==e?O.entries||P:P,M,k,C;if(S&&(C=f(S.call(new t())))!==Object.prototype&&(c(C,x,!0),r||s(C,p)||a(C,p,_)),E&&P&&P.name!==v&&(T=!0,j=function t(){return P.call(this);}),r&&!b||!h&&!T&&O[p]||a(O,p,j),u[e]=j,u[x]=_,g)if(M={values:E?j:w(v),keys:y?j:w(d),entries:A},b)for(k in M){k in O||i(O,k,M[k]);}else o(o.P+o.F*(h||T),e,M);return M;};},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function t(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1;}:n;},function(t,e){t.exports=Math.sign||function t(e){return 0==(e=+e)||e!=e?e:e<0?-1:1;};},function(t,e,n){var r=n(5),o=n(118).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,u="process"==n(23)(a);t.exports=function(){var t,e,n,l=function l(){var r,o;for(u&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o();}catch(r){throw t?n():e=void 0,r;}}e=void 0,r&&r.enter();};if(u)n=function n(){a.nextTick(l);};else if(i){var c=!0,f=document.createTextNode("");new i(l).observe(f,{characterData:!0}),n=function n(){f.data=c=!c;};}else if(s&&s.resolve){var p=s.resolve();n=function n(){p.then(l);};}else n=function n(){o.call(r,l);};return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o;};};},function(t,e,n){var r=n(7),o=n(4),i=function i(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!");};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{r=n(32)(Function.call,n(21).f(Object.prototype,"__proto__").set,2),r(t,[]),e=!(t instanceof Array);}catch(t){e=!0;}return function t(n,o){return i(n,o),e?n.__proto__=o:r(n,o),n;};}({},!1):void 0),check:i};},function(t,e,n){var r=n(78)("keys"),o=n(48);t.exports=function(t){return r[t]||(r[t]=o(t));};},function(t,e,n){var r=n(4),o=n(14),i=n(8)("species");t.exports=function(t,e){var n=r(t).constructor,a;return void 0===n||void 0==(a=r(n)[i])?e:o(a);};},function(t,e,n){var r=n(38),o=n(24);t.exports=function(t){return function(e,n){var i=String(o(e)),a=r(n),s=i.length,u,l;return a<0||a>=s?t?"":void 0:(u=i.charCodeAt(a),u<55296||u>56319||a+1===s||(l=i.charCodeAt(a+1))<56320||l>57343?t?i.charAt(a):u:t?i.slice(a,a+2):l-56320+(u-55296<<10)+65536);};};},function(t,e,n){var r=n(74),o=n(24);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t));};},function(t,e,n){"use strict";var r=n(38),o=n(24);t.exports=function t(e){var n=String(o(this)),i="",a=r(e);if(a<0||a==1/0)throw RangeError("Count can't be negative");for(;a>0;(a>>>=1)&&(n+=n)){1&a&&(i+=n);}return i;};},function(t,e){t.exports="\t\n\x0B\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";},function(t,e,n){var r=n(32),o=n(73),i=n(102),a=n(99),s=n(5),u=s.process,l=s.setImmediate,c=s.clearImmediate,f=s.MessageChannel,p=0,h={},d="onreadystatechange",v,_,m,g=function g(){var t=+this;if(h.hasOwnProperty(t)){var e=h[t];delete h[t],e();}},y=function y(t){g.call(t.data);};l&&c||(l=function t(e){for(var n=[],r=1;arguments.length>r;){n.push(arguments[r++]);}return h[++p]=function(){o("function"==typeof e?e:Function(e),n);},v(p),p;},c=function t(e){delete h[e];},"process"==n(23)(u)?v=function v(t){u.nextTick(r(g,t,1));}:f?(_=new f(),m=_.port2,_.port1.onmessage=y,v=r(m.postMessage,m,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(v=function v(t){s.postMessage(t+"","*");},s.addEventListener("message",y,!1)):v=d in a("script")?function(t){i.appendChild(a("script"))[d]=function(){i.removeChild(this),g.call(t);};}:function(t){setTimeout(r(g,t,1),0);}),t.exports={set:l,clear:c};},function(t,e,n){"use strict";var r=n(5),o=n(9),i=n(41),a=n(79),s=n(15),u=n(45),l=n(6),c=n(40),f=n(38),p=n(11),h=n(43).f,d=n(10).f,v=n(97),_=n(55),m="ArrayBuffer",g="DataView",y="prototype",b="Wrong length!",w="Wrong index!",x=r[m],E=r[g],T=r.Math,O=r.RangeError,P=r.Infinity,j=x,A=T.abs,S=T.pow,M=T.floor,k=T.log,C=T.LN2,R="buffer",I="byteLength",N="byteOffset",F=o?"_b":R,U=o?"_l":I,L=o?"_o":N,D=function D(t,e,n){var r=Array(n),o=8*n-e-1,i=(1<<o)-1,a=i>>1,s=23===e?S(2,-24)-S(2,-77):0,u=0,l=t<0||0===t&&1/t<0?1:0,c,f,p;for(t=A(t),t!=t||t===P?(f=t!=t?1:0,c=i):(c=M(k(t)/C),t*(p=S(2,-c))<1&&(c--,p*=2),t+=c+a>=1?s/p:s*S(2,1-a),t*p>=2&&(c++,p/=2),c+a>=i?(f=0,c=i):c+a>=1?(f=(t*p-1)*S(2,e),c+=a):(f=t*S(2,a-1)*S(2,e),c=0));e>=8;r[u++]=255&f,f/=256,e-=8){}for(c=c<<e|f,o+=e;o>0;r[u++]=255&c,c/=256,o-=8){}return r[--u]|=128*l,r;},B=function B(t,e,n){var r=8*n-e-1,o=(1<<r)-1,i=o>>1,a=r-7,s=n-1,u=t[s--],l=127&u,c;for(u>>=7;a>0;l=256*l+t[s],s--,a-=8){}for(c=l&(1<<-a)-1,l>>=-a,a+=e;a>0;c=256*c+t[s],s--,a-=8){}if(0===l)l=1-i;else{if(l===o)return c?NaN:u?-P:P;c+=S(2,e),l-=i;}return(u?-1:1)*c*S(2,l-e);},V=function V(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0];},X=function X(t){return[255&t];},z=function z(t){return[255&t,t>>8&255];},W=function W(t){return[255&t,t>>8&255,t>>16&255,t>>24&255];},G=function G(t){return D(t,52,8);},q=function q(t){return D(t,23,4);},H=function H(t,e,n){d(t[y],e,{get:function get(){return this[n];}});},Y=function Y(t,e,n,r){var o=+n,i=f(o);if(o!=i||i<0||i+e>t[U])throw O(w);var a=t[F]._b,s=i+t[L],u=a.slice(s,s+e);return r?u:u.reverse();},K=function K(t,e,n,r,o,i){var a=+n,s=f(a);if(a!=s||s<0||s+e>t[U])throw O(w);for(var u=t[F]._b,l=s+t[L],c=r(+o),p=0;p<e;p++){u[l+p]=c[i?p:e-p-1];}},$=function $(t,e){c(t,x,m);var n=+e,r=p(n);if(n!=r)throw O(b);return r;};if(a.ABV){if(!l(function(){new x();})||!l(function(){new x(.5);})){x=function t(e){return new j($(this,e));};for(var Q=x[y]=j[y],Z=h(j),J=0,tt;Z.length>J;){(tt=Z[J++])in x||s(x,tt,j[tt]);}i||(Q.constructor=x);}var et=new E(new x(2)),nt=E[y].setInt8;et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||u(E[y],{setInt8:function t(e,n){nt.call(this,e,n<<24>>24);},setUint8:function t(e,n){nt.call(this,e,n<<24>>24);}},!0);}else x=function t(e){var n=$(this,e);this._b=v.call(Array(n),0),this[U]=n;},E=function t(e,n,r){c(this,E,g),c(e,x,g);var o=e[U],i=f(n);if(i<0||i>o)throw O("Wrong offset!");if(r=void 0===r?o-i:p(r),i+r>o)throw O(b);this[F]=e,this[L]=i,this[U]=r;},o&&(H(x,I,"_l"),H(E,R,"_b"),H(E,I,"_l"),H(E,N,"_o")),u(E[y],{getInt8:function t(e){return Y(this,1,e)[0]<<24>>24;},getUint8:function t(e){return Y(this,1,e)[0];},getInt16:function t(e){var n=Y(this,2,e,arguments[1]);return(n[1]<<8|n[0])<<16>>16;},getUint16:function t(e){var n=Y(this,2,e,arguments[1]);return n[1]<<8|n[0];},getInt32:function t(e){return V(Y(this,4,e,arguments[1]));},getUint32:function t(e){return V(Y(this,4,e,arguments[1]))>>>0;},getFloat32:function t(e){return B(Y(this,4,e,arguments[1]),23,4);},getFloat64:function t(e){return B(Y(this,8,e,arguments[1]),52,8);},setInt8:function t(e,n){K(this,1,e,X,n);},setUint8:function t(e,n){K(this,1,e,X,n);},setInt16:function t(e,n){K(this,2,e,z,n,arguments[2]);},setUint16:function t(e,n){K(this,2,e,z,n,arguments[2]);},setInt32:function t(e,n){K(this,4,e,W,n,arguments[2]);},setUint32:function t(e,n){K(this,4,e,W,n,arguments[2]);},setFloat32:function t(e,n){K(this,4,e,q,n,arguments[2]);},setFloat64:function t(e,n){K(this,8,e,G,n,arguments[2]);}});_(x,m),_(E,g),s(E[y],a.VIEW,!0),e[m]=x,e[g]=E;},function(t,e,n){var r=n(5),o=n(31),i=n(41),a=n(168),s=n(10).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)});};},function(t,e,n){var r=n(61),o=n(8)("iterator"),i=n(54);t.exports=n(31).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)];};},function(t,e,n){"use strict";var r=n(52),o=n(156),i=n(54),a=n(18);t.exports=n(107)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e;},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]]);},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries");},function(t,e,n){var r=n(49),o=n(29),i=r(o,"Map");t.exports=i;},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1]);}}var o=n(558),i=n(559),a=n(560),s=n(561),u=n(562);r.prototype.clear=o,r.prototype.delete=i,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,t.exports=r;},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;){o[n]=e(t[n],n,t);}return o;}t.exports=n;},function(t,e,n){function r(t,e){e=o(e,t);for(var n=0,r=e.length;null!=t&&n<r;){t=t[i(e[n++])];}return n&&n==r?t:void 0;}var o=n(83),i=n(66);t.exports=r;},function(t,e,n){function r(t,e,n,a,s){return t===e||(null==t||null==e||!i(t)&&!i(e)?t!==t&&e!==e:o(t,e,n,a,r,s));}var o=n(508),i=n(67);t.exports=r;},function(t,e,n){function r(t,e){if(o(t))return!1;var n=typeof t==="undefined"?"undefined":_typeof(t);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||s.test(t)||!a.test(t)||null!=e&&t in Object(e);}var o=n(30),i=n(90),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=r;},function(t,e){function n(t){return t;}t.exports=n;},function(t,e,n){var r=n(507),o=n(67),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments;}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee");};t.exports=u;},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r;}var r=9007199254740991;t.exports=n;},function(t,e){function n(){throw new Error("setTimeout has not been defined");}function r(){throw new Error("clearTimeout has not been defined");}function o(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0);}catch(e){try{return f.call(null,t,0);}catch(e){return f.call(this,t,0);}}}function i(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t);}catch(e){try{return p.call(null,t);}catch(e){return p.call(this,t);}}}function a(){d&&v&&(d=!1,v.length?h=v.concat(h):_=-1,h.length&&s());}function s(){if(!d){var t=o(a);d=!0;for(var e=h.length;e;){for(v=h,h=[];++_<e;){v&&v[_].run();}_=-1,e=h.length;}v=null,d=!1,i(t);}}function u(t,e){this.fun=t,this.array=e;}function l(){}var c=t.exports={},f,p;!function(){try{f="function"==typeof setTimeout?setTimeout:n;}catch(t){f=n;}try{p="function"==typeof clearTimeout?clearTimeout:r;}catch(t){p=r;}}();var h=[],d=!1,v,_=-1;c.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n];}h.push(new u(t,e)),1!==h.length||d||o(s);},u.prototype.run=function(){this.fun.apply(null,this.array);},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=l,c.addListener=l,c.once=l,c.off=l,c.removeListener=l,c.removeAllListeners=l,c.emit=l,c.prependListener=l,c.prependOnceListener=l,c.listeners=function(t){return[];},c.binding=function(t){throw new Error("process.binding is not supported");},c.cwd=function(){return"/";},c.chdir=function(t){throw new Error("process.chdir is not supported");},c.umask=function(){return 0;};},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.InputLayer=void 0;var o=n(258);Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return o[t];}});});var i=n(247);Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return i[t];}});});var a=n(289);Object.keys(a).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return a[t];}});});var s=n(143);Object.keys(s).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return s[t];}});});var u=n(260);Object.keys(u).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return u[t];}});});var l=n(271);Object.keys(l).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return l[t];}});});var c=n(233);Object.keys(c).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return c[t];}});});var f=n(276);Object.keys(f).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return f[t];}});});var p=n(274);Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return p[t];}});});var h=n(295);Object.keys(h).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return h[t];}});});var d=n(264);Object.keys(d).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return d[t];}});});var v=n(228),_=r(v);e.InputLayer=_.default;},function(t,e,n){"use strict";var r=n(20),o=n(212),i=n(215),a=n(221),s=n(219),u=n(137),l="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(214);t.exports=function t(e){return new Promise(function t(c,f){var p=e.data,h=e.headers;r.isFormData(p)&&delete h["Content-Type"];var d=new XMLHttpRequest(),v="onreadystatechange",_=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in d||s(e.url)||(d=new window.XDomainRequest(),v="onload",_=!0,d.onprogress=function t(){},d.ontimeout=function t(){}),e.auth){var m=e.auth.username||"",g=e.auth.password||"";h.Authorization="Basic "+l(m+":"+g);}if(d.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d[v]=function t(){if(d&&(4===d.readyState||_)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?d.response:d.responseText,i={data:r,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,config:e,request:d};o(c,f,i),d=null;}},d.onerror=function t(){f(u("Network Error",e)),d=null;},d.ontimeout=function t(){f(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED")),d=null;},r.isStandardBrowserEnv()){var y=n(217),b=(e.withCredentials||s(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;b&&(h[e.xsrfHeaderName]=b);}if("setRequestHeader"in d&&r.forEach(h,function t(e,n){void 0===p&&"content-type"===n.toLowerCase()?delete h[n]:d.setRequestHeader(n,e);}),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType;}catch(t){if("json"!==e.responseType)throw t;}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function t(e){d&&(d.abort(),f(e),d=null);}),void 0===p&&(p=null),d.send(p);});};},function(t,e,n){"use strict";function r(t){this.message=t;}r.prototype.toString=function t(){return"Cancel"+(this.message?": "+this.message:"");},r.prototype.__CANCEL__=!0,t.exports=r;},function(t,e,n){"use strict";t.exports=function t(e){return!(!e||!e.__CANCEL__);};},function(t,e,n){"use strict";var r=n(211);t.exports=function t(e,n,o,i){var a=new Error(e);return r(a,n,o,i);};},function(t,e,n){"use strict";t.exports=function t(e,n){return function t(){for(var r=new Array(arguments.length),o=0;o<r.length;o++){r[o]=arguments[o];}return e.apply(n,r);};};},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(68),l=r(u),c=function(t){function e(t){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));if("max"===t)r.program=r.webgl.createProgram(n(633));else{if("average"!==t)throw new Error("[WebGLPooling2D] pooling function must be max or average.");r.program=r.webgl.createProgram(n(632));}return r;}return a(e,t),s(e,[{key:"_bindInputTextures",value:function t(n,r){var o=this.webgl.context;this.numTextures=2,this._bindInputTexture(this.program,n.texture,o.TEXTURE0,e.INPUT_TEXTURE_NAME),this._bindInputTexture(this.program,r.texture,o.TEXTURE1,e.POOL_IMAP_TEXTURE_NAME);}},{key:"_bindUniforms",value:function t(n,r){var o=this.webgl.context,i=n.shape[0],a=n.shape[1],s=this.webgl.getPad(a),u=r.shape[1],l=this.webgl.getPad(u);o.uniform1i(o.getUniformLocation(this.program,e.INPUT_ROWS_UNIFORM_NAME),i),o.uniform1i(o.getUniformLocation(this.program,e.CHANNELS_UNIFORM_NAME),a),o.uniform1i(o.getUniformLocation(this.program,e.CHANNELS_PAD_UNIFORM_NAME),s),o.uniform1i(o.getUniformLocation(this.program,e.POOL_ELEMENTS_UNIFORM_NAME),u),o.uniform1i(o.getUniformLocation(this.program,e.POOL_ELEMENTS_PAD_UNIFORM_NAME),l);}},{key:"_bindOutputTexture",value:function t(e,n,r){var o=n.shape[0],i=e.shape[1],a=this.webgl.getPad(i);this.webgl.bindOutputTexture(o,(i+a)/4,r.texture);}},{key:"call",value:function t(e,n){this.webgl.selectProgram(this.program);var r=n.shape[0],o=e.shape[1],i=new weblas.pipeline.Tensor([r,o],null);return this._bindInputTextures(e,n),this._bindUniforms(e,n),this._bindOutputTexture(e,n,i),this._compute(),this._unbindInputTextures(),i;}}]),e;}(l.default);c.INPUT_TEXTURE_NAME="X",c.POOL_IMAP_TEXTURE_NAME="poolIndexMapping",c.INPUT_ROWS_UNIFORM_NAME="inputRows",c.CHANNELS_UNIFORM_NAME="channels",c.CHANNELS_PAD_UNIFORM_NAME="channelsPad",c.POOL_ELEMENTS_UNIFORM_NAME="poolElements",c.POOL_ELEMENTS_PAD_UNIFORM_NAME="poolElementsPad",e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="_Pooling1D";var r=t.pool_size,a=void 0===r?2:r,s=t.strides,u=void 0===s?null:s,l=t.padding,c=void 0===l?"valid":l;return n.poolSize=a,n.strides=null===u?n.poolSize:u,n.padding=c,n.poolingFunc="max",n;}return a(e,t),s(e,[{key:"call",value:function t(e){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling1D] pooling function must be max or average.");for(var n="valid"===this.padding?Math.floor((e.tensor.shape[0]-this.poolSize+this.strides)/this.strides):Math.floor((e.tensor.shape[0]+this.strides-1)/this.strides),r=new f.default([],[n,e.tensor.shape[1]]),o=new f.default([],[e.tensor.shape[1]]),i="valid"===this.padding?0:Math.min(0,Math.ceil((e.tensor.shape[0]-(n-1)*this.strides-this.poolSize)/2)),a=0;a<n;a++){var s=Math.max(0,i),u=this.poolSize+Math.min(0,i);h.default.assign(o.tensor,e.tensor.pick(s,null));for(var l=1,c=1;c<u&&!(s+c>e.tensor.shape[0]-1);c++){"max"===this.poolingFunc?h.default.maxeq(o.tensor,e.tensor.pick(s+c,null)):"average"===this.poolingFunc&&h.default.addeq(o.tensor,e.tensor.pick(s+c,null)),l+=1;}"average"===this.poolingFunc&&h.default.divseq(o.tensor,l),h.default.assign(r.tensor.pick(a,null),o.tensor),i+=this.strides;}return e.tensor=r.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="_Pooling2D";var r=t.pool_size,a=void 0===r?[2,2]:r,s=t.strides,u=void 0===s?null:s,l=t.padding,c=void 0===l?"valid":l,f=t.data_format,p=void 0===f?"channels_last":f;return Array.isArray(a)?n.poolSize=a:n.poolSize=[a,a],Array.isArray(u)?n.strides=u:n.strides=null!==u?[u,u]:n.poolSize,n.padding=c,n.dataFormat=p,n.poolingFunc="max",n;}return a(e,t),u(e,[{key:"_calcOutputShape",value:function t(e){var n=s(e,3),r=n[0],o=n[1],i=n[2],a=s(this.poolSize,2),u=a[0],l=a[1],c="same"===this.padding?Math.floor((r+this.strides[0]-1)/this.strides[0]):Math.floor((r-u+this.strides[0])/this.strides[0]),f="same"===this.padding?Math.floor((o+this.strides[1]-1)/this.strides[1]):Math.floor((o-l+this.strides[1])/this.strides[1]),p="same"===this.padding?Math.max(0,Math.floor((c-1)*this.strides[0]+u-r)):0,h="same"===this.padding?Math.max(0,Math.floor((f-1)*this.strides[1]+l-o)):0,d=Math.floor(p/2),v=p-d,_=Math.floor(h/2),m=h-_;this.outputShape=[c,f,i],this.inputPadding=[d,v,_,m];}},{key:"_padInput",value:function t(e){if("same"===this.padding){var n=s(e.tensor.shape,3),r=n[0],o=n[1],i=n[2],a=s(this.inputPadding,4),u=a[0],l=a[1],c=a[2],f=a[3],h=r+u+l,v=o+c+f,_=new p.default([],[h,v,i]);"max"===this.poolingFunc&&d.default.assigns(_.tensor,Number.NEGATIVE_INFINITY),d.default.assign(_.tensor.hi(r+u,o+c,i).lo(u,c,0),e.tensor),e.tensor=_.tensor;}return e;}},{key:"_poolIndexMapping",value:function t(e){if(!this._poolIndicesPerChannel){for(var n=e[0],r=e[1],o=new p.default([],[n,r]),i=0,a=0;a<n;a++){for(var u=0;u<r;u++){o.tensor.set(a,u,i),i+=1;}}if("same"===this.padding){var l=s(this.inputPadding,4),c=l[0],f=l[1],h=l[2],v=l[3];n=n+c+f,r=r+h+v;var _=new p.default([],[n,r]);d.default.assigns(_.tensor,-1),d.default.assign(_.tensor.hi(e[0]+c,e[1]+h).lo(c,h),o.tensor),o.tensor=_.tensor;}var m=s(this.poolSize,2),g=m[0],y=m[1],b=this.outputShape[0],w=this.outputShape[1];this._poolIndicesPerChannel=new p.default([],[b*w,g*y]);for(var x=new p.default([],[g,y]),E=0,T=0,O=n-g;T<=O;T+=this.strides[0]){for(var P=0,j=r-y;P<=j;P+=this.strides[1]){d.default.assign(x.tensor,o.tensor.hi(T+g,P+y).lo(T,P)),this._poolIndicesPerChannel.tensor.data.set(x.tensor.data,E),E+=g*y;}}this._poolIndicesPerChannel.createWeblasTensor();}}},{key:"_callPipelineMode",value:function t(e){if(!e.weblasTensor)throw new Error("Variable passed in does not contain weblas tensor.");return this._calcOutputShape(e._actualShape),this._poolIndexMapping(e._actualShape),e.weblasTensor=this.webglPooling2D.call(e.weblasTensor,this._poolIndicesPerChannel.weblasTensor),e._fromPipeline=!0,e._actualShape=this.outputShape,e;}},{key:"_callRegularMode",value:function t(e){if(!e.tensor)throw new Error("Variable passed in does not contain tensor.");"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0)),this._calcOutputShape(e.tensor.shape),this._padInput(e);for(var n=s(e.tensor.shape,3),r=n[0],o=n[1],i=n[2],a=s(this.poolSize,2),u=a[0],l=a[1],c=new p.default([],this.outputShape),f=new p.default([],[u,l,i]),h=s(this.inputPadding,4),v=h[0],_=h[1],m=h[2],g=h[3],y=0,b=0;y<=r-u;y+=this.strides[0],b++){var w=0;y<v?w=v-y:y+u>r-_&&(w=y+u-(r-_));for(var x=0,E=0;x<=o-l;x+=this.strides[1],E++){var T=0;x<m?T=m-x:x+l>o-g&&(T=x+l-(o-g)),d.default.assign(f.tensor,e.tensor.hi(y+u,x+l,i).lo(y,x,0));for(var O=0;O<i;O++){if("max"===this.poolingFunc)c.tensor.set(b,E,O,d.default.sup(f.tensor.pick(null,null,O)));else if("average"===this.poolingFunc){var P=(u-w)*(l-T);c.tensor.set(b,E,O,d.default.sum(f.tensor.pick(null,null,O))/P);}}}}return e.tensor=c.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(2,0,1)),e;}},{key:"call",value:function t(e){return this._pipelineEnabled&&e._fromPipeline?this._callPipelineMode(e):this._callRegularMode(e);}}]),e;}(c.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="_Pooling3D";var r=t.pool_size,a=void 0===r?[2,2,2]:r,s=t.strides,u=void 0===s?null:s,l=t.padding,c=void 0===l?"valid":l,f=t.data_format,p=void 0===f?"channels_last":f;return Array.isArray(a)?n.poolSize=a:n.poolSize=[a,a,a],Array.isArray(u)?n.strides=u:n.strides=null!==u?[u,u,u]:n.poolSize,n.padding=c,n.dataFormat=p,n.poolingFunc="max",n;}return a(e,t),u(e,[{key:"_calcOutputShape",value:function t(e){var n=s(e.tensor.shape,4),r=n[0],o=n[1],i=n[2],a=n[3],u=s(this.poolSize,3),l=u[0],c=u[1],f=u[2],p="same"===this.padding?Math.floor((r+this.strides[0]-1)/this.strides[0]):Math.floor((r-l+this.strides[0])/this.strides[0]),h="same"===this.padding?Math.floor((o+this.strides[1]-1)/this.strides[1]):Math.floor((o-c+this.strides[1])/this.strides[1]),d="same"===this.padding?Math.floor((i+this.strides[2]-1)/this.strides[2]):Math.floor((i-f+this.strides[2])/this.strides[2]),v="same"===this.padding?Math.max(0,Math.floor((p-1)*this.strides[0]+l-r)):0,_="same"===this.padding?Math.max(0,Math.floor((h-1)*this.strides[1]+c-o)):0,m="same"===this.padding?Math.max(0,Math.floor((d-1)*this.strides[2]+f-i)):0,g=Math.floor(v/2),y=v-g,b=Math.floor(_/2),w=_-b,x=Math.floor(m/2),E=m-x;this.outputShape=[p,h,d,a],this.inputPadding=[g,y,b,w,x,E];}},{key:"_padInput",value:function t(e){if("same"===this.padding){var n=s(e.tensor.shape,4),r=n[0],o=n[1],i=n[2],a=n[3],u=s(this.inputPadding,6),l=u[0],c=u[1],f=u[2],h=u[3],v=u[4],_=u[5],m=r+l+c,g=o+f+h,y=i+v+_,b=new p.default([],[m,g,y,a]);"max"===this.poolingFunc&&d.default.assigns(b.tensor,Number.NEGATIVE_INFINITY),d.default.assign(b.tensor.hi(r+l,o+f,i+v,a).lo(l,f,v,0),e.tensor),e.tensor=b.tensor;}return e;}},{key:"call",value:function t(e){if("max"!==this.poolingFunc&&"average"!==this.poolingFunc)throw new Error("[pooling._Pooling3D] pooling function must be max or average.");"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0)),this._calcOutputShape(e),this._padInput(e);for(var n=s(e.tensor.shape,4),r=n[0],o=n[1],i=n[2],a=n[3],u=s(this.poolSize,3),l=u[0],c=u[1],f=u[2],h=new p.default([],this.outputShape),v=new p.default([],[l,c,f,a]),_=s(this.inputPadding,6),m=_[0],g=_[1],y=_[2],b=_[3],w=_[4],x=_[5],E=0,T=0;E<=r-l;E+=this.strides[0],T++){var O=0;E<m?O=m-E:E+l>r-g&&(O=E+l-(r-g));for(var P=0,j=0;P<=o-c;P+=this.strides[1],j++){var A=0;P<y?A=y-P:P+c>o-b&&(A=P+c-(o-b));for(var S=0,M=0;S<=i-f;S+=this.strides[2],M++){var k=0;S<w?k=w-S:S+f>i-x&&(k=S+f-(i-x)),d.default.assign(v.tensor,e.tensor.hi(E+l,P+c,S+f,a).lo(E,P,S,0));for(var C=0;C<a;C++){if("max"===this.poolingFunc)h.tensor.set(T,j,M,C,d.default.sup(v.tensor.pick(null,null,null,C)));else if("average"===this.poolingFunc){var R=(l-O)*(c-A)*(f-k);h.tensor.set(T,j,M,C,d.default.sum(v.tensor.pick(null,null,null,C))/R);}}}}}return e.tensor=h.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(3,0,1,2)),e;}}]),e;}(c.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.GRU=e.LSTM=e.SimpleRNN=void 0;var o=n(292),i=r(o),a=n(291),s=r(a),u=n(290),l=r(u);e.SimpleRNN=i.default,e.LSTM=s.default,e.GRU=l.default;},function(t,e,n){"use strict";(function(t){function r(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function foo(){return 42;}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength;}catch(t){return!1;}}function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823;}function i(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(null===t&&(t=new a(e)),t.length=e),t;}function a(t,e,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t);}return s(this,t,e,n);}function s(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?h(t,e,n,r):"string"==typeof e?f(t,e,n):d(t,e);}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');}function l(t,e,n,r){return u(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e);}function c(t,e){if(u(e),t=i(t,e<0?0:0|v(e)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n){t[n]=0;}return t;}function f(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(e,n);t=i(t,r);var o=t.write(e,n);return o!==r&&(t=t.slice(0,o)),t;}function p(t,e){var n=e.length<0?0:0|v(e.length);t=i(t,n);for(var r=0;r<n;r+=1){t[r]=255&e[r];}return t;}function h(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=p(t,e),t;}function d(t,e){if(a.isBuffer(e)){var n=0|v(e.length);return t=i(t,n),0===t.length?t:(e.copy(t,0,0,n),t);}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||$(e.length)?i(t,0):p(t,e);if("Buffer"===e.type&&J(e.data))return p(t,e.data);}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function v(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t;}function _(t){return+t!=t&&(t=0),a.alloc(+t);}function m(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;){switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(r)return G(t).length;e=(""+e).toLowerCase(),r=!0;}}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;){switch(t){case"hex":return R(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return C(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0;}}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r;}function b(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1;}else if(n<0){if(!o)return-1;n=0;}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,o);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer");}function w(t,e,n,r,o){function i(t,e){return 1===a?t[e]:t.readUInt16BE(e*a);}var a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2;}var l;if(o){var c=-1;for(l=n;l<s;l++){if(i(t,l)===i(e,-1===c?0:l-c)){if(-1===c&&(c=l),l-c+1===u)return c*a;}else-1!==c&&(l-=l-c),c=-1;}}else for(n+u>s&&(n=s-u),l=n;l>=0;l--){for(var f=!0,p=0;p<u;p++){if(i(t,l+p)!==i(e,p)){f=!1;break;}}if(f)return l;}return-1;}function x(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s;}return a;}function E(t,e,n,r){return K(G(e,t.length-n),t,n,r);}function T(t,e,n,r){return K(q(e),t,n,r);}function O(t,e,n,r){return T(t,e,n,r);}function P(t,e,n,r){return K(Y(e),t,n,r);}function j(t,e,n,r){return K(H(e,t.length-n),t,n,r);}function A(t,e,n){return 0===e&&n===t.length?Q.fromByteArray(t):Q.fromByteArray(t.slice(e,n));}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i=t[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(o+s<=n){var u,l,c,f;switch(s){case 1:i<128&&(a=i);break;case 2:u=t[o+1],128==(192&u)&&(f=(31&i)<<6|63&u)>127&&(a=f);break;case 3:u=t[o+1],l=t[o+2],128==(192&u)&&128==(192&l)&&(f=(15&i)<<12|(63&u)<<6|63&l)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:u=t[o+1],l=t[o+2],c=t[o+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(f=(15&i)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&f<1114112&&(a=f);}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=s;}return M(r);}function M(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;){n+=String.fromCharCode.apply(String,t.slice(r,r+=tt));}return n;}function k(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o){r+=String.fromCharCode(127&t[o]);}return r;}function C(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o){r+=String.fromCharCode(t[o]);}return r;}function R(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i){o+=W(t[i]);}return o;}function I(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2){o+=String.fromCharCode(r[i]+256*r[i+1]);}return o;}function N(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length");}function F(t,e,n,r,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range");}function U(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o){t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o);}}function L(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o){t[n+o]=e>>>8*(r?o:3-o)&255;}}function D(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range");}function B(t,e,n,r,o){return o||D(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,n,r,23,4),n+4;}function V(t,e,n,r,o){return o||D(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,n,r,52,8),n+8;}function X(t){if(t=z(t).replace(et,""),t.length<2)return"";for(;t.length%4!=0;){t+="=";}return t;}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"");}function W(t){return t<16?"0"+t.toString(16):t.toString(16);}function G(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue;}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue;}o=n;continue;}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue;}n=65536+(o-55296<<10|n-56320);}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n);}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128);}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128);}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128);}}return i;}function q(t){for(var e=[],n=0;n<t.length;++n){e.push(255&t.charCodeAt(n));}return e;}function H(t,e){for(var n,r,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a){n=t.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);}return i;}function Y(t){return Q.toByteArray(X(t));}function K(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o){e[o+n]=t[o];}return o;}function $(t){return t!==t;}/*!
	             * The buffer module from node.js, for the browser.
	             *
	             * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
	             * @license  MIT
	             */var Q=n(296),Z=n(484),J=n(487);e.Buffer=a,e.SlowBuffer=_,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),e.kMaxLength=o(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t;},a.from=function(t,e,n){return s(null,t,e,n);},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,n){return l(null,t,e,n);},a.allocUnsafe=function(t){return c(null,t);},a.allocUnsafeSlow=function(t){return c(null,t);},a.isBuffer=function t(e){return!(null==e||!e._isBuffer);},a.compare=function t(e,n){if(!a.isBuffer(e)||!a.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,o=n.length,i=0,s=Math.min(r,o);i<s;++i){if(e[i]!==n[i]){r=e[i],o=n[i];break;}}return r<o?-1:o<r?1:0;},a.isEncoding=function t(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1;}},a.concat=function t(e,n){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<e.length;++r){n+=e[r].length;}var o=a.allocUnsafe(n),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(o,i),i+=s.length;}return o;},a.byteLength=m,a.prototype._isBuffer=!0,a.prototype.swap16=function t(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<e;n+=2){y(this,n,n+1);}return this;},a.prototype.swap32=function t(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<e;n+=4){y(this,n,n+3),y(this,n+1,n+2);}return this;},a.prototype.swap64=function t(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<e;n+=8){y(this,n,n+7),y(this,n+1,n+6),y(this,n+2,n+5),y(this,n+3,n+4);}return this;},a.prototype.toString=function t(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):g.apply(this,arguments);},a.prototype.equals=function t(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e);},a.prototype.inspect=function t(){var n="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(n+=" ... ")),"<Buffer "+n+">";},a.prototype.compare=function t(e,n,r,o,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),n<0||r>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&n>=r)return 0;if(o>=i)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var s=i-o,u=r-n,l=Math.min(s,u),c=this.slice(o,i),f=e.slice(n,r),p=0;p<l;++p){if(c[p]!==f[p]){s=c[p],u=f[p];break;}}return s<u?-1:u<s?1:0;},a.prototype.includes=function t(e,n,r){return-1!==this.indexOf(e,n,r);},a.prototype.indexOf=function t(e,n,r){return b(this,e,n,r,!0);},a.prototype.lastIndexOf=function t(e,n,r){return b(this,e,n,r,!1);},a.prototype.write=function t(e,n,r,o){if(void 0===n)o="utf8",r=this.length,n=0;else if(void 0===r&&"string"==typeof n)o=n,r=this.length,n=0;else{if(!isFinite(n))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");n|=0,isFinite(r)?(r|=0,void 0===o&&(o="utf8")):(o=r,r=void 0);}var i=this.length-n;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;){switch(o){case"hex":return x(this,e,n,r);case"utf8":case"utf-8":return E(this,e,n,r);case"ascii":return T(this,e,n,r);case"latin1":case"binary":return O(this,e,n,r);case"base64":return P(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,n,r);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0;}}},a.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)};};var tt=4096;a.prototype.slice=function t(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),n<0?(n+=r)<0&&(n=0):n>r&&(n=r),n<e&&(n=e);var o;if(a.TYPED_ARRAY_SUPPORT)o=this.subarray(e,n),o.__proto__=a.prototype;else{var i=n-e;o=new a(i,void 0);for(var s=0;s<i;++s){o[s]=this[s+e];}}return o;},a.prototype.readUIntLE=function t(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var o=this[e],i=1,a=0;++a<n&&(i*=256);){o+=this[e+a]*i;}return o;},a.prototype.readUIntBE=function t(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var o=this[e+--n],i=1;n>0&&(i*=256);){o+=this[e+--n]*i;}return o;},a.prototype.readUInt8=function t(e,n){return n||N(e,1,this.length),this[e];},a.prototype.readUInt16LE=function t(e,n){return n||N(e,2,this.length),this[e]|this[e+1]<<8;},a.prototype.readUInt16BE=function t(e,n){return n||N(e,2,this.length),this[e]<<8|this[e+1];},a.prototype.readUInt32LE=function t(e,n){return n||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3];},a.prototype.readUInt32BE=function t(e,n){return n||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3]);},a.prototype.readIntLE=function t(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var o=this[e],i=1,a=0;++a<n&&(i*=256);){o+=this[e+a]*i;}return i*=128,o>=i&&(o-=Math.pow(2,8*n)),o;},a.prototype.readIntBE=function t(e,n,r){e|=0,n|=0,r||N(e,n,this.length);for(var o=n,i=1,a=this[e+--o];o>0&&(i*=256);){a+=this[e+--o]*i;}return i*=128,a>=i&&(a-=Math.pow(2,8*n)),a;},a.prototype.readInt8=function t(e,n){return n||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e];},a.prototype.readInt16LE=function t(e,n){n||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r;},a.prototype.readInt16BE=function t(e,n){n||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r;},a.prototype.readInt32LE=function t(e,n){return n||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24;},a.prototype.readInt32BE=function t(e,n){return n||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3];},a.prototype.readFloatLE=function t(e,n){return n||N(e,4,this.length),Z.read(this,e,!0,23,4);},a.prototype.readFloatBE=function t(e,n){return n||N(e,4,this.length),Z.read(this,e,!1,23,4);},a.prototype.readDoubleLE=function t(e,n){return n||N(e,8,this.length),Z.read(this,e,!0,52,8);},a.prototype.readDoubleBE=function t(e,n){return n||N(e,8,this.length),Z.read(this,e,!1,52,8);},a.prototype.writeUIntLE=function t(e,n,r,o){if(e=+e,n|=0,r|=0,!o){F(this,e,n,r,Math.pow(2,8*r)-1,0);}var i=1,a=0;for(this[n]=255&e;++a<r&&(i*=256);){this[n+a]=e/i&255;}return n+r;},a.prototype.writeUIntBE=function t(e,n,r,o){if(e=+e,n|=0,r|=0,!o){F(this,e,n,r,Math.pow(2,8*r)-1,0);}var i=r-1,a=1;for(this[n+i]=255&e;--i>=0&&(a*=256);){this[n+i]=e/a&255;}return n+r;},a.prototype.writeUInt8=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1;},a.prototype.writeUInt16LE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):U(this,e,n,!0),n+2;},a.prototype.writeUInt16BE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):U(this,e,n,!1),n+2;},a.prototype.writeUInt32LE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):L(this,e,n,!0),n+4;},a.prototype.writeUInt32BE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):L(this,e,n,!1),n+4;},a.prototype.writeIntLE=function t(e,n,r,o){if(e=+e,n|=0,!o){var i=Math.pow(2,8*r-1);F(this,e,n,r,i-1,-i);}var a=0,s=1,u=0;for(this[n]=255&e;++a<r&&(s*=256);){e<0&&0===u&&0!==this[n+a-1]&&(u=1),this[n+a]=(e/s>>0)-u&255;}return n+r;},a.prototype.writeIntBE=function t(e,n,r,o){if(e=+e,n|=0,!o){var i=Math.pow(2,8*r-1);F(this,e,n,r,i-1,-i);}var a=r-1,s=1,u=0;for(this[n+a]=255&e;--a>=0&&(s*=256);){e<0&&0===u&&0!==this[n+a+1]&&(u=1),this[n+a]=(e/s>>0)-u&255;}return n+r;},a.prototype.writeInt8=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1;},a.prototype.writeInt16LE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):U(this,e,n,!0),n+2;},a.prototype.writeInt16BE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):U(this,e,n,!1),n+2;},a.prototype.writeInt32LE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):L(this,e,n,!0),n+4;},a.prototype.writeInt32BE=function t(e,n,r){return e=+e,n|=0,r||F(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):L(this,e,n,!1),n+4;},a.prototype.writeFloatLE=function t(e,n,r){return B(this,e,n,!0,r);},a.prototype.writeFloatBE=function t(e,n,r){return B(this,e,n,!1,r);},a.prototype.writeDoubleLE=function t(e,n,r){return V(this,e,n,!0,r);},a.prototype.writeDoubleBE=function t(e,n,r){return V(this,e,n,!1,r);},a.prototype.copy=function t(e,n,r,o){if(r||(r=0),o||0===o||(o=this.length),n>=e.length&&(n=e.length),n||(n=0),o>0&&o<r&&(o=r),o===r)return 0;if(0===e.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-n<o-r&&(o=e.length-n+r);var i=o-r,s;if(this===e&&r<n&&n<o)for(s=i-1;s>=0;--s){e[s+n]=this[s+r];}else if(i<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<i;++s){e[s+n]=this[s+r];}else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),n);return i;},a.prototype.fill=function t(e,n,r,o){if("string"==typeof e){if("string"==typeof n?(o=n,n=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i);}if(void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!a.isEncoding(o))throw new TypeError("Unknown encoding: "+o);}else"number"==typeof e&&(e&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=n;s<r;++s){this[s]=e;}else{var u=a.isBuffer(e)?e:G(new a(e,o).toString()),l=u.length;for(s=0;s<r-n;++s){this[s+n]=u[s%l];}}return this;};var et=/[^+\/0-9A-Za-z-_]/g;}).call(e,n(39));},function(t,e,n){var r=n(23);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t;};},function(t,e,n){"use strict";var r=n(12),o=n(47),i=n(11);t.exports=[].copyWithin||function t(e,n){var a=r(this),s=i(a.length),u=o(e,s),l=o(n,s),c=arguments.length>2?arguments[2]:void 0,f=Math.min((void 0===c?s:o(c,s))-l,s-u),p=1;for(l<u&&u<l+f&&(p=-1,l+=f-1,u+=f-1);f-->0;){l in a?a[u]=a[l]:delete a[u],u+=p,l+=p;}return a;};},function(t,e,n){var r=n(53);t.exports=function(t,e){var n=[];return r(t,!1,n.push,n,e),n;};},function(t,e,n){var r=n(14),o=n(12),i=n(62),a=n(11);t.exports=function(t,e,n,s,u){r(e);var l=o(t),c=i(l),f=a(l.length),p=u?f-1:0,h=u?-1:1;if(n<2)for(;;){if(p in c){s=c[p],p+=h;break;}if(p+=h,u?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value");}for(;u?p>=0:f>p;p+=h){p in c&&(s=e(s,c[p],p,l));}return s;};},function(t,e,n){"use strict";var r=n(14),o=n(7),i=n(73),a=[].slice,s={},u=function u(t,e,n){if(!(e in s)){for(var r=[],o=0;o<e;o++){r[o]="a["+o+"]";}s[e]=Function("F,a","return new F("+r.join(",")+")");}return s[e](t,n);};t.exports=Function.bind||function t(e){var n=r(this),s=a.call(arguments,1),l=function l(){var t=s.concat(a.call(arguments));return this instanceof l?u(n,t.length,t):i(n,t,e);};return o(n.prototype)&&(l.prototype=n.prototype),l;};},function(t,e,n){"use strict";var r=n(10).f,o=n(42),i=n(45),a=n(32),s=n(40),u=n(24),l=n(53),c=n(107),f=n(156),p=n(46),h=n(9),d=n(36).fastKey,v=h?"_s":"size",_=function _(t,e){var n=d(e),r;if("F"!==n)return t._i[n];for(r=t._f;r;r=r.n){if(r.k==e)return r;}};t.exports={getConstructor:function getConstructor(t,e,n,c){var f=t(function(t,r){s(t,f,e,"_i"),t._i=o(null),t._f=void 0,t._l=void 0,t[v]=0,void 0!=r&&l(r,n,t[c],t);});return i(f.prototype,{clear:function t(){for(var e=this,n=e._i,r=e._f;r;r=r.n){r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];}e._f=e._l=void 0,e[v]=0;},delete:function _delete(t){var e=this,n=_(e,t);if(n){var r=n.n,o=n.p;delete e._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),e._f==n&&(e._f=r),e._l==n&&(e._l=o),e[v]--;}return!!n;},forEach:function t(e){s(this,f,"forEach");for(var n=a(e,arguments.length>1?arguments[1]:void 0,3),r;r=r?r.n:this._f;){for(n(r.v,r.k,this);r&&r.r;){r=r.p;}}},has:function t(e){return!!_(this,e);}}),h&&r(f.prototype,"size",{get:function get(){return u(this[v]);}}),f;},def:function def(t,e,n){var r=_(t,e),o,i;return r?r.v=n:(t._l=r={i:i=d(e,!0),k:e,v:n,p:o=t._l,n:void 0,r:!1},t._f||(t._f=r),o&&(o.n=r),t[v]++,"F"!==i&&(t._i[i]=r)),t;},getEntry:_,setStrong:function setStrong(t,e,n){c(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0;},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;){n=n.p;}return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?f(0,n.k):"values"==e?f(0,n.v):f(0,[n.k,n.v]):(t._t=void 0,f(1));},n?"entries":"values",!n,!0),p(e);}};},function(t,e,n){var r=n(61),o=n(147);t.exports=function(t){return function e(){if(r(this)!=t)throw TypeError(t+"#toJSON isn't generic");return o(this);};};},function(t,e,n){"use strict";var r=n(45),o=n(36).getWeak,i=n(4),a=n(7),s=n(40),u=n(53),l=n(26),c=n(13),f=l(5),p=l(6),h=0,d=function d(t){return t._l||(t._l=new v());},v=function v(){this.a=[];},_=function _(t,e){return f(t.a,function(t){return t[0]===e;});};v.prototype={get:function get(t){var e=_(this,t);if(e)return e[1];},has:function has(t){return!!_(this,t);},set:function set(t,e){var n=_(this,t);n?n[1]=e:this.a.push([t,e]);},delete:function _delete(t){var e=p(this.a,function(e){return e[0]===t;});return~e&&this.a.splice(e,1),!!~e;}},t.exports={getConstructor:function getConstructor(t,e,n,i){var l=t(function(t,r){s(t,l,e,"_i"),t._i=h++,t._l=void 0,void 0!=r&&u(r,n,t[i],t);});return r(l.prototype,{delete:function _delete(t){if(!a(t))return!1;var e=o(t);return!0===e?d(this).delete(t):e&&c(e,this._i)&&delete e[this._i];},has:function t(e){if(!a(e))return!1;var n=o(e);return!0===n?d(this).has(e):n&&c(n,this._i);}}),l;},def:function def(t,e,n){var r=o(i(e),!0);return!0===r?d(t).set(e,n):r[t._i]=n,t;},ufstore:d};},function(t,e,n){t.exports=!n(9)&&!n(6)(function(){return 7!=Object.defineProperty(n(99)("div"),"a",{get:function get(){return 7;}}).a;});},function(t,e,n){var r=n(7),o=Math.floor;t.exports=function t(e){return!r(e)&&isFinite(e)&&o(e)===e;};},function(t,e,n){var r=n(4);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n);}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e;}};},function(t,e){t.exports=function(t,e){return{value:e,done:!!t};};},function(t,e){t.exports=Math.log1p||function t(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e);};},function(t,e,n){"use strict";var r=n(44),o=n(77),i=n(63),a=n(12),s=n(62),u=Object.assign;t.exports=!u||n(6)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t;}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r;})?function t(e,n){for(var u=a(e),l=arguments.length,c=1,f=o.f,p=i.f;l>c;){for(var h=s(arguments[c++]),d=f?r(h).concat(f(h)):r(h),v=d.length,_=0,m;v>_;){p.call(h,m=d[_++])&&(u[m]=h[m]);}}return u;}:u;},function(t,e,n){var r=n(10),o=n(4),i=n(44);t.exports=n(9)?Object.defineProperties:function t(e,n){o(e);for(var a=i(n),s=a.length,u=0,l;s>u;){r.f(e,l=a[u++],n[l]);}return e;};},function(t,e,n){var r=n(18),o=n(43).f,i={}.toString,a="object"==(typeof window==="undefined"?"undefined":_typeof(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function s(t){try{return o(t);}catch(t){return a.slice();}};t.exports.f=function t(e){return a&&"[object Window]"==i.call(e)?s(e):o(r(e));};},function(t,e,n){var r=n(13),o=n(18),i=n(69)(!1),a=n(112)("IE_PROTO");t.exports=function(t,e){var n=o(t),s=0,u=[],l;for(l in n){l!=a&&r(n,l)&&u.push(l);}for(;e.length>s;){r(n,l=e[s++])&&(~i(u,l)||u.push(l));}return u;};},function(t,e,n){var r=n(44),o=n(18),i=n(63).f;t.exports=function(t){return function(e){for(var n=o(e),a=r(n),s=a.length,u=0,l=[],c;s>u;){i.call(n,c=a[u++])&&l.push(t?[c,n[c]]:n[c]);}return l;};};},function(t,e,n){var r=n(43),o=n(77),i=n(4),a=n(5).Reflect;t.exports=a&&a.ownKeys||function t(e){var n=r.f(i(e)),a=o.f;return a?n.concat(a(e)):n;};},function(t,e,n){var r=n(5).parseFloat,o=n(56).trim;t.exports=1/r(n(117)+"-0")!=-1/0?function t(e){var n=o(String(e),3),i=r(n);return 0===i&&"-"==n.charAt(0)?-0:i;}:r;},function(t,e,n){var r=n(5).parseInt,o=n(56).trim,i=n(117),a=/^[\-+]?0[xX]/;t.exports=8!==r(i+"08")||22!==r(i+"0x16")?function t(e,n){var i=o(String(e),3);return r(i,n>>>0||(a.test(i)?16:10));}:r;},function(t,e){t.exports=Object.is||function t(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n;};},function(t,e,n){var r=n(11),o=n(116),i=n(24);t.exports=function(t,e,n,a){var s=String(i(t)),u=s.length,l=void 0===n?" ":String(n),c=r(e);if(c<=u||""==l)return s;var f=c-u,p=o.call(l,Math.ceil(f/l.length));return p.length>f&&(p=p.slice(0,f)),a?p+s:s+p;};},function(t,e,n){e.f=n(8);},function(t,e,n){"use strict";var r=n(150);t.exports=n(70)("Map",function(t){return function e(){return t(this,arguments.length>0?arguments[0]:void 0);};},{get:function t(e){var n=r.getEntry(this,e);return n&&n.v;},set:function t(e,n){return r.def(this,0===e?0:e,n);}},r,!0);},function(t,e,n){n(9)&&"g"!=/./g.flags&&n(10).f(RegExp.prototype,"flags",{configurable:!0,get:n(72)});},function(t,e,n){"use strict";var r=n(150);t.exports=n(70)("Set",function(t){return function e(){return t(this,arguments.length>0?arguments[0]:void 0);};},{add:function t(e){return r.def(this,e=0===e?0:e,e);}},r);},function(t,e,n){"use strict";var r=n(26)(0),o=n(16),i=n(36),a=n(158),s=n(152),u=n(7),l=i.getWeak,c=Object.isExtensible,f=s.ufstore,p={},h,d=function d(t){return function e(){return t(this,arguments.length>0?arguments[0]:void 0);};},v={get:function t(e){if(u(e)){var n=l(e);return!0===n?f(this).get(e):n?n[this._i]:void 0;}},set:function t(e,n){return s.def(this,e,n);}},_=t.exports=n(70)("WeakMap",d,v,s,!0,!0);7!=new _().set((Object.freeze||Object)(p),7).get(p)&&(h=s.getConstructor(d),a(h.prototype,v),i.NEED=!0,r(["delete","has","get","set"],function(t){var e=_.prototype,n=e[t];o(e,t,function(e,r){if(u(e)&&!c(e)){this._f||(this._f=new h());var o=this._f[t](e,r);return"set"==t?this:o;}return n.call(this,e,r);});}));},function(t,e,n){"use strict";function r(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1;}function o(t){var e=new r();e.pre=t.pre,e.body=t.body,e.post=t.post;var n=t.args.slice(0);e.argTypes=n;for(var o=0;o<n.length;++o){var a=n[o];if("array"===a||"object"==(typeof a==="undefined"?"undefined":_typeof(a))&&a.blockIndices){if(e.argTypes[o]="array",e.arrayArgs.push(o),e.arrayBlockIndices.push(a.blockIndices?a.blockIndices:0),e.shimArgs.push("array"+o),o<e.pre.args.length&&e.pre.args[o].count>0)throw new Error("cwise: pre() block may not reference array args");if(o<e.post.args.length&&e.post.args[o].count>0)throw new Error("cwise: post() block may not reference array args");}else if("scalar"===a)e.scalarArgs.push(o),e.shimArgs.push("scalar"+o);else if("index"===a){if(e.indexArgs.push(o),o<e.pre.args.length&&e.pre.args[o].count>0)throw new Error("cwise: pre() block may not reference array index");if(o<e.body.args.length&&e.body.args[o].lvalue)throw new Error("cwise: body() block may not write to array index");if(o<e.post.args.length&&e.post.args[o].count>0)throw new Error("cwise: post() block may not reference array index");}else if("shape"===a){if(e.shapeArgs.push(o),o<e.pre.args.length&&e.pre.args[o].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(o<e.body.args.length&&e.body.args[o].lvalue)throw new Error("cwise: body() block may not write to array shape");if(o<e.post.args.length&&e.post.args[o].lvalue)throw new Error("cwise: post() block may not write to array shape");}else{if("object"!=(typeof a==="undefined"?"undefined":_typeof(a))||!a.offset)throw new Error("cwise: Unknown argument type "+n[o]);e.argTypes[o]="offset",e.offsetArgs.push({array:a.array,offset:a.offset}),e.offsetArgIndex.push(o);}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>n.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>n.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>n.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,i(e);}var i=n(481);t.exports=o;},function(t,e,n){"use strict";function r(t,e,n){var o=0|t[n];if(o<=0)return[];var i=new Array(o),a;if(n===t.length-1)for(a=0;a<o;++a){i[a]=e;}else for(a=0;a<o;++a){i[a]=r(t,e,n+1);}return i;}function o(t,e){var n,r;for(n=new Array(t),r=0;r<t;++r){n[r]=e;}return n;}function i(t,e){switch(void 0===e&&(e=0),typeof t==="undefined"?"undefined":_typeof(t)){case"number":if(t>0)return o(0|t,e);break;case"object":if("number"==typeof t.length)return r(t,e,0);}return[];}t.exports=i;},function(t,e,n){function r(t){var e=this.__data__=new o(t);this.size=e.size;}var o=n(80),i=n(575),a=n(576),s=n(577),u=n(578),l=n(579);r.prototype.clear=i,r.prototype.delete=a,r.prototype.get=s,r.prototype.has=u,r.prototype.set=l,t.exports=r;},function(t,e){function n(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;){t[o+n]=e[n];}return t;}t.exports=n;},function(t,e,n){function r(t,e,n){"__proto__"==e&&o?o(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n;}var o=n(180);t.exports=r;},function(t,e,n){function r(t,e,n,a,s){var u=-1,l=t.length;for(n||(n=i),s||(s=[]);++u<l;){var c=t[u];e>0&&n(c)?e>1?r(c,e-1,n,a,s):o(s,c):a||(s[s.length]=c);}return s;}var o=n(176),i=n(549);t.exports=r;},function(t,e,n){function r(t,e){return t&&o(t,e,i);}var o=n(504),i=n(50);t.exports=r;},function(t,e,n){var r=n(49),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t;}catch(t){}}();t.exports=o;},function(t,e,n){function r(t,e,n,r,l,c){var f=n&s,p=t.length,h=e.length;if(p!=h&&!(f&&h>p))return!1;var d=c.get(t);if(d&&c.get(e))return d==e;var v=-1,_=!0,m=n&u?new o():void 0;for(c.set(t,e),c.set(e,t);++v<p;){var g=t[v],y=e[v];if(r)var b=f?r(y,g,v,e,t,c):r(g,y,v,t,e,c);if(void 0!==b){if(b)continue;_=!1;break;}if(m){if(!i(e,function(t,e){if(!a(m,e)&&(g===t||l(g,t,n,r,c)))return m.push(e);})){_=!1;break;}}else if(g!==y&&!l(g,y,n,r,c)){_=!1;break;}}return c.delete(t),c.delete(e),_;}var o=n(492),i=n(499),a=n(528),s=1,u=2;t.exports=r;},function(t,e,n){(function(e){var n="object"==(typeof e==="undefined"?"undefined":_typeof(e))&&e&&e.Object===Object&&e;t.exports=n;}).call(e,n(39));},function(t,e,n){var r=n(488),o=n(123),i=n(490),a=n(491),s=n(494),u=n(65),l=n(188),c="[object Map]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",d="[object DataView]",v=l(r),_=l(o),m=l(i),g=l(a),y=l(s),b=u;(r&&b(new r(new ArrayBuffer(1)))!=d||o&&b(new o())!=c||i&&b(i.resolve())!=f||a&&b(new a())!=p||s&&b(new s())!=h)&&(b=function b(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?l(n):"";if(r)switch(r){case v:return d;case _:return c;case m:return f;case g:return p;case y:return h;}return e;}),t.exports=b;},function(t,e,n){function r(t,e,n){if(!s(n))return!1;var r=typeof e==="undefined"?"undefined":_typeof(e);return!!("number"==r?i(n)&&a(e,n.length):"string"==r&&e in n)&&o(n[e],t);}var o=n(87),i=n(88),a=n(85),s=n(57);t.exports=r;},function(t,e,n){function r(t){return t===t&&!o(t);}var o=n(57);t.exports=r;},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t];}),n;}t.exports=n;},function(t,e){function n(t,e){return function(n){return null!=n&&n[t]===e&&(void 0!==e||t in Object(n));};}t.exports=n;},function(t,e){function n(t){if(null!=t){try{return o.call(t);}catch(t){}try{return t+"";}catch(t){}}return"";}var r=Function.prototype,o=r.toString;t.exports=n;},function(t,e,n){function r(t){return(null==t?0:t.length)?o(t,i):[];}var o=n(178),i=1/0;t.exports=r;},function(t,e,n){function r(t,e){return null!=t&&i(t,e,o);}var o=n(506),i=n(543);t.exports=r;},function(t,e,n){(function(t){var r=n(29),o=n(593),i="object"==(typeof e==="undefined"?"undefined":_typeof(e))&&e&&!e.nodeType&&e,a=i&&"object"==(typeof t==="undefined"?"undefined":_typeof(t))&&t&&!t.nodeType&&t,s=a&&a.exports===i,u=s?r.Buffer:void 0,l=u?u.isBuffer:void 0,c=l||o;t.exports=c;}).call(e,n(94)(t));},function(t,e,n){function r(t){if(!i(t))return!1;var e=o(t);return e==s||e==u||e==a||e==l;}var o=n(65),i=n(57),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";t.exports=r;},function(t,e,n){var r=n(511),o=n(526),i=n(565),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s;},function(t,e,n){var r=n(533),o=r();t.exports=o;},function(t,e,n){function r(t){return t&&t.length?o(t,i):0;}var o=n(522),i=n(129);t.exports=r;},function(t,e,n){function r(t){if(!t)return 0===t?t:0;if((t=o(t))===i||t===-i){return(t<0?-1:1)*a;}return t===t?t:0;}var o=n(595),i=1/0,a=1.7976931348623157e308;t.exports=r;},function(t,e,n){"use strict";function r(){var t,e,n,r,u,l,c,f,p,h;if(r=o({},s),0===arguments.length)throw new Error("Array of ndarrays to concatenate must not be empty");if(Array.isArray(arguments[0])?(n=arguments[0],o(r,arguments[1]||{})):2===arguments.length&&(n=arguments[1],t=arguments[0],o(r,arguments[2]||{})),0===n.length)throw new Error("Array of ndarrays to concatenate must not be empty");for(u=0;u<n.length;u++){if(c){if(n[u].dimension!==c.length)throw new Error("all arrays must have the same dimensionality");for(l=1;l<n[u].shape.length;l++){if(n[u].shape[l]!==c[l])throw new Error("last n-1 dimensions of concatenated rows must have the same size");}c[0]+=n[u].shape[0];}else c=n[u].shape.slice(0);}if(t){if(c[0]!==t.shape[0])throw new Error("first dimension of output array must match the total number of concatenated rows");}else t=a.zeros(c,r.dtype);for(l=0,f=0;l<n.length;l++){e=n[l],p=e.shape[0],h=t.lo(f).hi(p),i.assign(h,e),f+=p;}return t;}t.exports=r;var o=n(639),i=n(3),a=n(198),s={dtype:"double"};},function(t,e,n){"use strict";function r(t){var e=t.dtype;"generic"!==e&&"array"!==e||(e="double");var n=f.malloc(t.size,e),r=l(n,t.shape);return c.assign(r,t),r;}function o(t,e){e||(e="double");for(var n=1,r=new Array(t.length),o=t.length-1;o>=0;--o){r[o]=n,n*=t[o];}return l(f.malloc(n,e),t,r,0);}function i(t){"generic"!==t.dtype&&"array"!==t.dtype&&f.free(t.data);}function a(t,e){e||(e="double");for(var n=1,r=new Array(t.length),o=t.length-1;o>=0;--o){r[o]=n,n*=t[o];}for(var i=f.malloc(n,e),o=0;o<n;++o){i[o]=0;}return l(i,t,r,0);}function s(t,e){e||(e="double");for(var n=1,r=new Array(t.length),o=t.length-1;o>=0;--o){r[o]=n,n*=t[o];}for(var i=f.malloc(n,e),o=0;o<n;++o){i[o]=1;}return l(i,t,r,0);}function u(t,e){var n,r;e||(e="double");var o=1,i=new Array(t.length);for(n=t.length-1;n>=0;--n){i[n]=o,o*=t[n];}var a=f.malloc(o,e);for(n=0;n<o;++n){a[n]=0;}var s=1/0,u=0;for(n=t.length-1;n>=0;n--){u+=i[n],s=Math.min(s,t[n]);}for(n=0,r=0;n<s;n++,r+=u){a[r]=1;}return l(a,t,i,0);}var l=n(93),c=n(3),f=n(638);e.clone=r,e.malloc=o,e.free=i,e.zeros=a,e.ones=s,e.eye=u;},function(t,e,n){"use strict";var r=n(174),o=n(35),i=o({args:["array","scalar","index"],body:function t(e,n,r){var o=n,i;for(i=0;i<r.length-1;++i){o=o[r[i]];}o[r[r.length-1]]=e;}});t.exports=function t(e){var n=r(e.shape);return i(e,n),n;};},function(t,e,n){"use strict";function r(t,e){for(var n=1,r=t.length,o=t[0],i=t[0],a=1;a<r;++a){if(i=o,o=t[a],e(o,i)){if(a===n){n++;continue;}t[n++]=o;}}return t.length=n,t;}function o(t){for(var e=1,n=t.length,r=t[0],o=t[0],i=1;i<n;++i,o=r){if(o=r,(r=t[i])!==o){if(i===e){e++;continue;}t[e++]=r;}}return t.length=e,t;}function i(t,e,n){return 0===t.length?t:e?(n||t.sort(e),r(t,e)):(n||t.sort(),o(t));}t.exports=i;},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function o(t){return t&&t.__esModule?t:{default:t};}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(e,"__esModule",{value:!0});var a=n(298),s=o(a),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(205),c=o(l),f=n(596),p=o(f),h=n(588),d=o(h),v=n(583),_=o(v),m=n(50),g=o(m),y=n(598),b=o(y),w=n(195),x=o(w),E=n(89),T=o(E),O=n(582),P=o(O),j=n(133),A=r(j),S=n(2),M=o(S),k=c.default.CancelToken.source(),C=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=e.filepaths,r=void 0===n?{}:n,o=e.headers,a=void 0===o?{}:o,s=e.filesystem,u=void 0!==s&&s,l=e.gpu,c=void 0!==l&&l,f=e.pipeline,p=void 0!==f&&f,h=e.layerCallPauses,d=void 0!==h&&h;if(!r.model||!r.weights||!r.metadata)throw new Error("File paths must be declared for model, weights, and metadata.");this.filepaths=r,this.filetypes={model:"json",weights:"arraybuffer",metadata:"json"},this.headers=a,this.filesystem="undefined"==typeof window&&u,this.gpu="undefined"!=typeof window&&c,this.pipeline=!!this.gpu&&p,this.layerCallPauses=d,this.data={model:{},weights:null,metadata:[]},this.dataRequestProgress={model:0,weights:0,metadata:0},this.modelLayersMap=new Map(),this.layersWithResults=[],this.modelDAG={},this.inputTensors={},this._ready=this._initialize(),this.isRunning=!1;}return u(t,[{key:"ready",value:function t(){return this._ready;}},{key:"_interrupt",value:function t(){k.cancel();}},{key:"_initialize",value:function t(){var e=this,n=["model","weights","metadata"];return s.default.all(n.map(function(t){return e.filesystem?e._dataRequestFS(t):e._dataRequestHTTP(t,e.headers);})).then(function(){return e._createLayers(),s.default.resolve();}).catch(function(t){console.log(t),e._interrupt();});}},{key:"_dataRequestFS",value:function t(e){var r=this,o=s.default.promisify(n(627).readFile),i=this.filetypes[e],a="json"===i?"utf8":void 0;return o(this.filepaths[e],a).then(function(t){if("json"===i)r.data[e]=JSON.parse(t);else{if("arraybuffer"!==i)throw new Error("Invalid file type: "+i);r.data[e]=t.buffer;}r.dataRequestProgress[e]=100;}).catch(function(t){throw t;});}},{key:"_dataRequestHTTP",value:function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c.default.get(this.filepaths[e],{responseType:this.filetypes[e],headers:r,onDownloadProgress:function t(r){if(r.lengthComputable){var o=Math.round(100*r.loaded/r.total);n.dataRequestProgress[e]=o;}},cancelToken:k.token}).then(function(t){n.data[e]=t.data,n.dataRequestProgress[e]=100;}).catch(function(t){if(!c.default.isCancel(t))throw t;console.log("Data request canceled",t.message);});}},{key:"getLoadingProgress",value:function t(){var e=(0,b.default)(this.dataRequestProgress);return Math.round((0,x.default)(e)/e.length);}},{key:"toggleGpu",value:function t(e){this.gpu=void 0===e?!this.gpu:e;var n=!0,r=!1,o=void 0;try{for(var i=this.modelLayersMap.values()[Symbol.iterator](),a;!(n=(a=i.next()).done);n=!0){a.value.toggleGpu(this.gpu);}}catch(t){r=!0,o=t;}finally{try{!n&&i.return&&i.return();}finally{if(r)throw o;}}}},{key:"_createLayers",value:function t(){var e=this,n=this.data.model.class_name,r=[];if("Sequential"===n?r=this.data.model.config:"Model"===n&&(r=this.data.model.config.layers),!Array.isArray(r)||!r.length)throw new Error("Model configuration does not contain any layers.");r.forEach(function(t,o){var i=t.class_name,a=t.config;if("Model"===n&&"Sequential"===i)a.forEach(function(n,r){var o=n.class_name,i=n.config,s=0===r?t.inbound_nodes[0].map(function(t){return t[0];}):[a[r-1].config.name];e._createLayer(o,i,s);});else{if(!(i in A))throw new Error("Layer "+i+" specified in model configuration is not implemented!");if("Sequential"===n&&0===o){var s="input",u=a.batch_input_shape.slice(1),l=new A.InputLayer({name:"input",shape:u});e.modelLayersMap.set("input",l),e.modelDAG.input={layerClass:"InputLayer",name:"input",inbound:[],outbound:[]},e.inputTensors.input=new M.default([],u);}else if("Model"===n&&"InputLayer"===i){var c=a.batch_input_shape.slice(1);e.inputTensors[a.name]=new M.default([],c);}var f=[];if("Sequential"===n)f=0===o?["input"]:[r[o-1].config.name];else if("Model"===n){var p=t.inbound_nodes;p&&p.length&&(f=p[0].map(function(t){return t[0];}));}e._createLayer(i,a,f);}});}},{key:"_createLayer",value:function t(e,n,r){var o=this,i=void 0;if("Bidirectional"===e||"TimeDistributed"===e){var a=n.layer.config,s=n.layer.class_name;a.gpu=this.gpu,i=new A[e](Object.assign({},n,{layer:new A[s](a)}));}else i=new A[e](Object.assign({gpu:this.gpu,pipeline:this.pipeline},n));var u=[];if("Bidirectional"===e){var l=i.forwardLayer.params.map(function(t){return n.name+"/forward_"+n.layer.config.name+"/"+t;}),c=i.backwardLayer.params.map(function(t){return n.name+"/backward_"+n.layer.config.name+"/"+t;});u=l.concat(c);}else u="TimeDistributed"===e?i.layer.params.map(function(t){return n.name+"/"+t;}):i.params.map(function(t){return n.name+"/"+t.replace('alphas','alpha');});if(u&&u.length){var f=u.map(function(t){var e=(0,_.default)(o.data.metadata,function(e){return new RegExp("^"+t).test(e.weight_name);});if(!e)throw new Error("[Model] error loading weights.");var n=e.offset,r=e.length,i=e.shape;return new M.default(new Float32Array(o.data.weights,n,r),i);});i.setWeights(f);}this.modelLayersMap.set(n.name,i),this.modelDAG[n.name]={layerClass:e,name:n.name,inbound:[],outbound:[]},r.forEach(function(t){o.modelDAG[n.name].inbound.push(t),o.modelDAG[t].outbound.push(n.name);});}},{key:"_mergeLayerCall",value:function t(e,n,r){var o=n.map(function(t){return t.result;});return o.every(function(t){return t._fromPipeline;})&&e._pipelineEnabled?r&&(o=o.map(function(t){var e=new M.default([],t.tensor.shape);return e.copyFromWeblasTensor(t.weblasTensor),e._fromPipeline=!0,e._actualShape=t._actualShape.slice(),e;})):o=o.map(function(t,e){return t._fromPipeline?n[e].transferFromPipeline(t):r?new M.default(t.tensor.data,t.tensor.shape):t;}),e.call(o);}},{key:"_regularLayerCall",value:function t(e,n,r){var o=n.result;if(o._fromPipeline&&e._pipelineEnabled){if(r){var i=new M.default([],o.tensor.shape);i.copyFromWeblasTensor(o.weblasTensor),i._fromPipeline=!0,i._actualShape=o._actualShape.slice(),o=i;}}else o._fromPipeline?o=n.transferFromPipeline(o):r&&(o=new M.default(o.tensor.data,o.tensor.shape));return e.call(o);}},{key:"_traverseDAG",value:function(){function t(t){return e.apply(this,arguments);}var e=(0,a.coroutine)(regeneratorRuntime.mark(function t(e){var n=this,r,o,i,a,u,l,c,f,p;return regeneratorRuntime.wrap(function t(h){for(;;){switch(h.prev=h.next){case 0:if(0!==e.length){h.next=4;break;}return h.abrupt("return",!0);case 4:if(1!==e.length){h.next=30;break;}if(r=e[0],o=this.modelDAG[r],i=o.layerClass,a=o.inbound,u=o.outbound,"InputLayer"===i){h.next=25;break;}if(l=this.modelLayersMap.get(r),!l.visited){h.next=11;break;}return h.abrupt("return",!1);case 11:if(c=a.map(function(t){return n.modelLayersMap.get(t);}),(0,P.default)(c.map(function(t){return t.hasResult;}))){h.next=14;break;}return h.abrupt("return",!1);case 14:if(f=a.map(function(t){return n.modelDAG[t].outbound;}).reduce(function(t,e){return t+e.length;},0),p=f>=1,["Merge","Add","Multiply","Average","Maximum","Concatenate","Dot"].includes(i)?l.result=this._mergeLayerCall(l,c,p):l.result=this._regularLayerCall(l,c[0],p),l.hasResult=!0,l.visited=!0,this.layersWithResults.push(l.name),!this.layerCallPauses){h.next=23;break;}return h.next=23,s.default.delay(0);case 23:h.next=26;break;case 25:this.layersWithResults.push(this.modelLayersMap.get(r).name);case 26:return h.next=28,this._traverseDAG(u);case 28:h.next=32;break;case 30:return h.next=32,s.default.all(e.map(function(t){return n._traverseDAG([t]);}));case 32:case"end":return h.stop();}}},t,this);}));return t;}()},{key:"predict",value:function(){function t(t){return e.apply(this,arguments);}var e=(0,a.coroutine)(regeneratorRuntime.mark(function t(e){var n=this,r,o,i,a,s,u,l,c,f,p,h,d,v,m;return regeneratorRuntime.wrap(function t(y){for(;;){switch(y.prev=y.next){case 0:if(this.isRunning=!0,r=(0,g.default)(this.inputTensors).sort(),(0,T.default)((0,g.default)(e).sort(),r)){y.next=5;break;}throw this.isRunning=!1,new Error("predict() must take an object where the keys are the named inputs of the model: "+r+".");case 5:if((0,P.default)(r,function(t){return e[t]instanceof Float32Array;})){y.next=8;break;}throw this.isRunning=!1,new Error("predict() must take an object where the values are the flattened data as Float32Array.");case 8:for(this.layersWithResults=[],o=!0,i=!1,a=void 0,y.prev=12,s=this.modelLayersMap.values()[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){l=u.value,l.hasResult=!1,l.visited=!1;}y.next=20;break;case 16:y.prev=16,y.t0=y.catch(12),i=!0,a=y.t0;case 20:y.prev=20,y.prev=21,!o&&s.return&&s.return();case 23:if(y.prev=23,!i){y.next=26;break;}throw a;case 26:return y.finish(23);case 27:return y.finish(20);case 28:return r.forEach(function(t){var r=n.modelLayersMap.get(t);n.inputTensors[t].replaceTensorData(e[t]),r.result=r.call(n.inputTensors[t]),r.hasResult=!0,r.visited=!0;}),y.next=31,this._traverseDAG(r);case 31:if("Sequential"!==(c=this.data.model.class_name)){y.next=40;break;}return f=(0,_.default)((0,b.default)(this.modelDAG),function(t){return!t.outbound.length;}),p=this.modelLayersMap.get(f.name),h=p.result,d={output:h.tensor.data},this.isRunning=!1,y.abrupt("return",d);case 40:if("Model"!==c){y.next=46;break;}return v=(0,b.default)(this.modelDAG).filter(function(t){return!t.outbound.length;}),m={},v.forEach(function(t){var e=n.modelLayersMap.get(t.name),r=e.result;m[t.name]=r.tensor.data;}),this.isRunning=!1,y.abrupt("return",m);case 46:case"end":return y.stop();}}},t,this,[[12,16,20,28],[21,,23,27]]);}));return t;}()}]),t;}();e.default=C;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-4,r=(0,u.default)((0,a.default)(t)),o=e;if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++){if(!(0,c.default)(r[i]))return!1;if(r[i]<o[i]-n||r[i]>o[i]+n)return!1;}return!0;}Object.defineProperty(e,"__esModule",{value:!0}),e.approxEquals=o;var i=n(199),a=r(i),s=n(189),u=r(s),l=n(587),c=r(l);},function(t,e,n){"use strict";(function(t){function e(t,e,n){t[e]||Object[r](t,e,{writable:!0,configurable:!0,value:n});}if(n(479),n(635),n(299),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;var r="defineProperty";e(String.prototype,"padLeft","".padStart),e(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(t){[][t]&&e(Array,t,Function.call.bind([][t]));});}).call(e,n(39));},function(t,e,n){var r,r;/**
	         * Modules in this bundle
	         * @license
	         *
	         * weblas:
	         *   license: MIT (http://opensource.org/licenses/MIT)
	         *   author: Waylon Flinn <waylonflinn@gmail.com>
	         *   homepage: https://github.com/waylonflinn/weblas
	         *   version: 0.9.0
	         *
	         * This header is generated by licensify (https://github.com/twada/licensify)
	         */!function(e){var n;t.exports=e();}(function(){var t,e,n;return function t(e,n,o){function i(s,u){if(!n[s]){if(!e[s]){var l="function"==typeof r&&r;if(!u&&l)return r(s,!0);if(a)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c;}var f=n[s]={exports:{}};e[s][0].call(f.exports,function(t){var n=e[s][1][t];return i(n||t);},f,f.exports,t,e,n,o);}return n[s].exports;}for(var a="function"==typeof r&&r,s=0;s<o.length;s++){i(o[s]);}return i;}({1:[function(t,e,n){function r(t){function e(e,n,r,o,i,a,s,u){if(null!=u&&u.length!=n)throw new Error("Only vector C with length matching rows in A is currently supported.");var l,c=i,f=u;l=v(r,n,a);var p=t.createDataTexture(e,r,c),h=t.createDataTexture(n,r,l),d=null;null!=f&&(d=t.createDataTexture(1,n,f));var m=t.createOutputTexture(e,n);return _.calculate(e,n,r,o,p,h,s,d,m),rawBuffer=t.readData(e,n),t.context.deleteTexture(p),t.context.deleteTexture(h),null!=d&&t.context.deleteTexture(d),t.context.deleteTexture(m),new Float32Array(rawBuffer);}function n(e,n,o,i){var a,s,u=o;r(i)?s=i:(s=new Float32Array(e),s.fill(i));var l=t.createDataTexture(1,e,u),c=t.createDataTexture(1,e,s),f=t.createOutputTexture(1,e);return m.calculate(e,n,l,c,f),a=t.readData(1,e),t.context.deleteTexture(l),t.context.deleteTexture(c),t.context.deleteTexture(f),new Float32Array(a);}function r(t){return"[object Float32Array]"===Object.prototype.toString.call(t);}function o(e,n,r,o,i){var a,s=i,u=t.createDataTexture(e,n,s),l=t.createOutputTexture(e,n);return g.calculate(e,n,r,o,u,l),a=t.readData(e,n),t.context.deleteTexture(u),t.context.deleteTexture(l),new Float32Array(a);}function f(e,n,r,o,i){var a,s=i,u=t.createDataTexture(e,n,s),l=t.createOutputTexture(e,n);return g.calculate(e,n,1/o,-1*r/o,u,l),a=t.readData(e,n),t.context.deleteTexture(u),t.context.deleteTexture(l),new Float32Array(a);}function p(e,n,r,o,i,a){var s=t.createDataTexture(e,n*r,a),u=Math.floor((n-o)/i)+1,l=Math.floor((e-o)/i)+1,c=t.createOutputTexture(l,u*r);return y.calculate(e,n,r,o,i,s,c),rawBuffer=t.readData(l,u*r),t.context.deleteTexture(s),t.context.deleteTexture(c),new Float32Array(rawBuffer);}function h(e,n,r,o,i){r=null!=r?r:Number.MIN_VALUE,o=null!=o?o:Number.MAX_VALUE;var a,s=i,u=t.createDataTexture(e,n,s),l=t.createOutputTexture(e,n);return b.calculate(e,n,r,o,u,l),a=t.readData(e,n),t.context.deleteTexture(u),t.context.deleteTexture(l),new Float32Array(a);}function d(t,e,n){var r,o,i=[];n?(i[1]=t.length,i[0]=t[0].length):(i[0]=t.length,i[1]=t[0].length),o=i[1],e=e||Float32Array,r=new e(i[0]*i[1]);for(var a=0;a<i[0];++a){for(var s=0;s<i[1];++s){r[a*o+s]=n?t[s][a]:t[a][s];}}return r;}function v(t,e,n){for(var r=new n.constructor(t*e),o=0;t>o;o++){for(var i=0;e>i;i++){r[i*t+o]=n[o*e+i];}}return r;}var _=new a(t),m=new s(t),g=new u(t),y=new l(t),b=new c(t);return{saxpy:n,sscal:o,sgemm:e,sstd:f,sdwns:p,sclmp:h,pipeline:i,gpu:{gl:t,sgemm:i.sgemmcalculator.calculate.bind(i.sgemmcalculator),sscal:i.sscalcalculator.calculate.bind(i.sscalcalculator),sclmp:i.sclmpcalculator.calculate.bind(i.sclmpcalculator),sdwns:i.sdwnscalculator.calculate.bind(i.sdwnscalculator),encode:t.encode.bind(t)},util:{fromArray:d,transpose:v}};}var o=t("./lib/globals"),i=t("./lib/pipeline"),a=t("./lib/sgemmcalculator"),s=t("./lib/saxpycalculator"),u=t("./lib/sscalcalculator"),l=t("./lib/sdwnscalculator"),c=t("./lib/sclmpcalculator");o.gl?e.exports=r(o.gl):e.exports=null;},{"./lib/globals":2,"./lib/pipeline":3,"./lib/saxpycalculator":4,"./lib/sclmpcalculator":5,"./lib/sdwnscalculator":6,"./lib/sgemmcalculator":7,"./lib/sscalcalculator":9}],2:[function(t,e,n){var r=t("./webgl"),o;try{o=new r();}catch(t){o=null,console.log("No support for WebGL!");}e.exports={gl:o};},{"./webgl":11}],3:[function(t,e,n){function r(t){function e(t,e,n){var r=n.shape[0],o=n.shape[1],i=new f([r,o],null);return v.calculate(r,o,t,e,n.texture,i.texture),i;}function n(t,e,n,r,o){if(n.shape[1]!==e.shape[1])throw new Error("Second dimension must be of same size for input Tensors (second Tensor is transposed).");var i,a=e.shape[0],s=n.shape[0],u=e.shape[1];i=o?o.texture:null;var l=new f([a,s],null);return h.calculate(a,s,u,t,e.texture,n.texture,r,i,l.texture),l;}function r(t,e,n,r){if(r.shape[1]%t!=0)throw new Error("Second dimension of tensor must be a multiple of channels");var o=r.shape[0],i=r.shape[1]/t,a=Math.floor((o-e)/n)+1,s=Math.floor((i-e)/n)+1,u=new f([a,s*t],null);return _.calculate(o,i,t,e,n,r.texture,u.texture),u;}function o(t,e,n){t=null!=t?t:Number.MIN_VALUE,e=null!=e?e:Number.MAX_VALUE;var r=n.shape[0],o=n.shape[1],i=new f([r,o],null);return m.calculate(r,o,t,e,n.texture,i.texture),i;}function p(t,e,n,r,o){if(o.shape[1]%t!=0)throw new Error("Second dimension of tensor must be a multiple of channels");var i,a,s=o.shape[0],u=o.shape[1]/t;r?(i=Math.ceil((u+2*r-e)/n)+1,a=Math.ceil((s+2*r-e)/n)+1):(r=0,i=Math.ceil((u-e)/n)+1,a=Math.ceil((s-e)/n)+1);var l=e*e*t,c=a*i,p=l,h=new f([c,p],null);return g.calculate(s,u,t,c,p,i,e,n,r,o.texture,h.texture),h;}var h=new i(t,!1),d=new a(t,!1),v=new s(t,!1),_=new u(t,!1),m=new l(t,!1),g=new c(t,!1);return{Tensor:f,sscal:e,sgemm:n,sdwns:r,sclmp:o,slokn:p,sgemmcalculator:h,saxpycalculator:d,sscalcalculator:v,sdwnscalculator:_,sclmpcalculator:m,slokncalculator:g};}var o=t("./globals"),i=t("./sgemmcalculator"),a=t("./saxpycalculator"),s=t("./sscalcalculator"),u=t("./sdwnscalculator"),l=t("./sclmpcalculator"),c=t("./slokncalculator"),f=t("./tensor");o.gl?e.exports=r(o.gl):e.exports=null;},{"./globals":2,"./saxpycalculator":4,"./sclmpcalculator":5,"./sdwnscalculator":6,"./sgemmcalculator":7,"./slokncalculator":8,"./sscalcalculator":9,"./tensor":10}],4:[function(t,e,n){function r(t,e){this.webgl=t,this.standalone=e||!0,this.standalone?this.program=this.webgl.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D X;\t\t// texture with data from padded A\nuniform sampler2D Y;\t\t// texture with data from padded transpose of B\nuniform int       N;\nuniform float     a; \t\t// coefficient to multiplication\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1540259130(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\n// select an element from a vector based on index\nfloat select_index_1604150559(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n \tfloat row = outTex.y;\n\tfloat col = outTex.x;\n\n\t// direct usage of col requires output be padded exactly like input\n\tvec4 x = texture2D( X, vec2(col, row));\n\tvec4 y = texture2D( Y, vec2(col, row));\n\tvec4 sum_v = (a * x) + y;\n\tint channel = int(mod(col * float(N), 4.0 ));\n\tfloat sum = select_index_1604150559(sum_v, channel);\n\n\tif (sum == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n \t// output vec4 with bytes for an IEEE754 32-bit floating point number\n\tgl_FragColor = encode_float_1540259130(sum);\n}\n"):this.program=this.webgl.createProgram(p);}var o=t("./webgl");e.exports=r,r.TEXTURE_UNIFORM_NAME_0="X",r.TEXTURE_UNIFORM_NAME_1="Y",r.LENGTH_UNIFORM_NAME="N",r.COEFFICIENT_UNIFORM_NAME="a",r.prototype.calculate=function(t,e,n,o,i){var a=this.webgl.context;this.webgl.selectProgram(this.program),this.bindInputTexture(n,a.TEXTURE0,r.TEXTURE_UNIFORM_NAME_0),this.bindInputTexture(o,a.TEXTURE1,r.TEXTURE_UNIFORM_NAME_1);var s=this.webgl.getPad(t);this.bindUniforms(t+s,e),this.webgl.bindOutputTexture(1,t+s,i),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0),this.webgl.unbindInputTexture(a.TEXTURE0),this.webgl.unbindInputTexture(a.TEXTURE1);},r.prototype.bindInputTexture=function(t,e,n){var r=this.webgl.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.bindUniforms=function(t,e){var n=this.webgl.context,o=n.getUniformLocation(this.program,r.LENGTH_UNIFORM_NAME),i=n.getUniformLocation(this.program,r.COEFFICIENT_UNIFORM_NAME);n.uniform1i(o,t),n.uniform1f(i,e);};},{"./webgl":11}],5:[function(t,e,n){function r(t,e){this.webgl=t,this.standalone=null==e||e,this.standalone?this.program=this.webgl.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D X;\t\t// texture with data from padded A\nuniform int       N;\t\t// number of columns\nuniform int       pad;\t\t// additional columns to nearest multiple of four\nuniform float     a; \t\t// lower bound\nuniform float     b; \t\t// upper bound\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1604150559(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\n// select an element from a vector based on index\nfloat select_index_1540259130(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row = outTex.y;\n\tfloat col = outTex.x;\n\n\t// return 0.0 if in padded region of output texture\n\tif(col * float(N + pad) > float(N) ) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n\t// direct usage of col requires output be padded exactly like input\n\tvec4 x = texture2D( X, vec2(col, row));\n\tvec4 val = clamp(x, a, b);\n\n\t// select and output channel (standalone version only)\n\tint channel = int(mod(col * float(N + pad), 4.0));\n\tfloat sum = select_index_1540259130(val, channel);\n\n\tif (sum == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n\t// output vec4 with bytes for an IEEE754 32-bit floating point number\n\tgl_FragColor = encode_float_1604150559(sum);\n}\n"):this.program=this.webgl.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D X;\t\t// texture with data from padded A\nuniform int       N;\t\t// number of columns\nuniform int       pad;\t\t// additional columns to nearest multiple of four\nuniform float     a; \t\t// lower bound\nuniform float     b; \t\t// upper bound\n\n// set pad values to 0.0, if in padded region of output texture\nvoid fix_pad_1540259130(inout vec4 v, int pad){\n\tv.a = 0.0;\n\tif(pad == 2){\n\t\tv.b = 0.0;\n\t} else if(pad == 3){\n\t\tv.b = 0.0;\n\t\tv.g = 0.0;\n\t}\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tfloat col = (col_t * float(N + pad) - 2.0); // index of first element in pixel (matrix space)\n\n\t// direct usage of col requires output be padded exactly like input\n\tvec4 x = texture2D( X, vec2(col_t, row_t));\n\tvec4 val_v = clamp(x, a, b);\n\n\t// is last element in pixel past row length?\n\tif(pad > 0 && (col + 4.0) > float(N) ) {\n\t\t// fix elements in padded region\n\t\tfix_pad_1540259130(val_v, pad);\n\t}\n\n\tgl_FragColor = val_v;\n}\n");}var o=t("./webgl");e.exports=r,r.TEXTURE_UNIFORM_NAME_0="X",r.LENGTH_UNIFORM_NAME="N",r.LOWER_UNIFORM_NAME="a",r.UPPER_UNIFORM_NAME="b",r.prototype.calculate=function(t,e,n,o,i,a){n=null!=n?n:Number.MIN_VALUE,o=null!=o?o:Number.MAX_VALUE;var s=this.webgl.context;this.webgl.selectProgram(this.program),this.bindInputTexture(i,s.TEXTURE0,r.TEXTURE_UNIFORM_NAME_0);var u=this.webgl.getPad(e);this.bindUniforms(e,u,n,o),this.standalone?this.webgl.bindOutputTexture(t,e+u,a):this.webgl.bindOutputTexture(t,(e+u)/4,a),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0),this.webgl.unbindInputTexture(s.TEXTURE0);},r.prototype.bindInputTexture=function(t,e,n){var r=this.webgl.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.bindUniforms=function(t,e,n,o){var i=this.webgl.context,a=i.getUniformLocation(this.program,r.LENGTH_UNIFORM_NAME),s=i.getUniformLocation(this.program,r.UPPER_UNIFORM_NAME),u=i.getUniformLocation(this.program,r.LOWER_UNIFORM_NAME),l=i.getUniformLocation(this.program,"pad");i.uniform1i(a,t),i.uniform1i(l,e),i.uniform1f(u,n),i.uniform1f(s,o);};},{"./webgl":11}],6:[function(t,e,n){function r(t,e){this.webgl=t,this.standalone=null==e||e,p="// TODO: unroll loop for stride == factor and small values (2, 3)\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;  // texture coords of row/column to calculate\nuniform sampler2D X;       // texture with data from padded A\nuniform int       factor;  // width of image patch\nuniform float     stride;  // width between image patches\nuniform float     C;       // number of channels\nuniform float     M;\nuniform float     N;\nuniform float     N_out;\nuniform float     M_out;\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate and translate to output pixel space.\n\tfloat row = floor(outTex.y * M_out);   // row on output texture (pixel space)\n\tfloat col = floor(outTex.x * N_out); // column on output texture (matrix space)\n\tfloat vcol = floor(col / C);   // virtual column on output texture (matrix space)\n\tfloat vchannel = floor(mod(col, C)); // virtual channel on output texture\n\n\tconst float min = -1.0e+08;\n\tvec4 currentMax = vec4(min, min, min, min);\n\n\tfloat deltaY = 1.0/M;\n\tfloat deltaX = 1.0/N;\n\tfloat y = ((row * stride) + 0.5)*deltaY; // texture position of input row\n\tfloat x;\n\tfloat z = vchannel * deltaX;\n\tfor (int i = 0; i < 100; i += 1) {\n\t\tif (i >= factor) {\n\t\t\tbreak;\n\t\t}\n\t\tx = ((vcol * stride * C) + 0.5) * deltaX; // texture position of input column\n\n\t\tfor (int j = 0; j < 100; j += 1) {\n\t\t\tif (j >= factor) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvec2 coords = vec2(x + z, y);\n\t\t\tvec4 x_v = texture2D(X, coords);\n\t\t\tcurrentMax = max(currentMax, x_v);\n\n\t\t\tx += (deltaX * C);\n\t\t}\n\t\ty += deltaY;\n\t}\n\n\tgl_FragColor = currentMax;\n}\n",this.standalone?this.program=this.webgl.createProgram("// TODO: unroll loop for stride == factor and small values (2, 3)\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;  // texture coords of row/column to calculate\nuniform sampler2D X;       // texture with data from padded A\nuniform int       factor;  // width of image patch\nuniform float     stride;  // width between image patches\nuniform float     C;       // number of channels\nuniform float     M;\nuniform float     N;\nuniform float     N_out;\nuniform float     M_out;\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1540259130(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\n// select an element from a vector based on index\nfloat select_index_1604150559(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate and translate to output pixel space.\n\tfloat row = floor(outTex.y * M_out);   // row on output texture (matrix space)\n\tfloat col = floor(outTex.x * N_out); // column on output texture (matrix space)\n\tfloat vcol = floor(col / C);   // virtual column on output texture (matrix space)\n\tfloat vchannel = floor(mod(col, C)); // virtual channel on output texture\n\n\tconst float min = -1.0e+08;\n\tvec4 currentMax = vec4(min, min, min, min);\n\n\tfloat deltaY = 1.0/M;\n\tfloat deltaX = 1.0/N;\n\tfloat y = ((row * stride) + 0.5)*deltaY; // texture position of input row\n\tfloat x;\n\tfloat z = vchannel * deltaX;\n\tfor (int i = 0; i < 100; i += 1) {\n\t\tif (i >= factor) {\n\t\t\tbreak;\n\t\t}\n\t\tx = ((vcol * stride * C) + 0.5) * deltaX; // texture position of input column\n\n\t\tfor (int j = 0; j < 100; j += 1) {\n\t\t\tif (j >= factor) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvec2 coords = vec2(x + z, y);\n\t\t\tvec4 x_v = texture2D(X, coords);\n\t\t\tcurrentMax = max(currentMax, x_v);\n\n\t\t\tx += (deltaX * C);\n\t\t}\n\t\ty += deltaY;\n\t}\n\tint chan = int(mod(outTex.x * N_out, 4.0 ));\n\tfloat val = select_index_1604150559(currentMax, int(chan));\n\tif (val == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n\tgl_FragColor = encode_float_1540259130(val);\n}\n"):this.program=this.webgl.createProgram(p);}var o=t("./webgl");e.exports=r,r.TEXTURE_UNIFORM_NAME_0="X",r.INPUT_ROW_COUNT_UNIFORM_NAME="M",r.INPUT_COLUMN_COUNT_UNIFORM_NAME="N",r.OUTPUT_ROW_COUNT_UNIFORM_NAME="M_out",r.OUTPUT_COLUMN_COUNT_UNIFORM_NAME="N_out",r.FACTOR_UNIFORM_NAME="factor",r.STRIDE_UNIFORM_NAME="stride",r.CHANNEL_COUNT_UNIFORM_NAME="C",r.prototype.calculate=function(t,e,n,i,a,s,u){if(n%o.COMPONENTS_PER_TEXEL!=0)throw new Error("Channel count must be a multiple of "+o.COMPONENTS_PER_TEXEL);var l=this.webgl.context,c=(Math.floor((e-i)/a)+1)*n,f=Math.floor((t-i)/a)+1;this.webgl.selectProgram(this.program),this.bindInputTexture(s,l.TEXTURE0,r.TEXTURE_UNIFORM_NAME_0),this.bindUniforms(t,e*n,f,c,i,a,n),this.standalone?this.webgl.bindOutputTexture(f,c,u):this.webgl.bindOutputTexture(f,c/o.COMPONENTS_PER_TEXEL,u),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0),this.webgl.unbindInputTexture(l.TEXTURE0);},r.prototype.bindInputTexture=function(t,e,n){var r=this.webgl.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.bindUniforms=function(t,e,n,o,i,a,s){var u=this.webgl.context,l=u.getUniformLocation(this.program,r.INPUT_ROW_COUNT_UNIFORM_NAME),c=u.getUniformLocation(this.program,r.INPUT_COLUMN_COUNT_UNIFORM_NAME),f=u.getUniformLocation(this.program,r.OUTPUT_ROW_COUNT_UNIFORM_NAME),p=u.getUniformLocation(this.program,r.OUTPUT_COLUMN_COUNT_UNIFORM_NAME),h=u.getUniformLocation(this.program,r.FACTOR_UNIFORM_NAME),d=u.getUniformLocation(this.program,r.STRIDE_UNIFORM_NAME),v=u.getUniformLocation(this.program,r.CHANNEL_COUNT_UNIFORM_NAME);u.uniform1f(l,t),u.uniform1f(c,e),u.uniform1f(f,n),u.uniform1f(p,o),u.uniform1i(h,i),u.uniform1f(d,a),u.uniform1f(v,s);};},{"./webgl":11}],7:[function(t,e,n){function r(t,e){this.webgl=t,this.standalone=null==e||e,this.standalone?(this.program_=this.webgl.createProgram("// fragment shader that calculates the matrix product and renders each\n// element to the bytes representing a 32-bit IEEE754 floating point in\n// the output RGBA canvas.\n// readPixel is used to read the bytes.\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform sampler2D B_t;\t\t// texture with data from padded transpose of B\nuniform int       K;\t\t// number of elements in shared dimension\nuniform int       N;\t\t// number of columns in output\nuniform int       pad;\t\t//\nuniform float     alpha; \t// coefficient to multiplication\n\n// sum of products between elements in row i (from A) x col j (from B)\n\n// Calculate the dot product between the row (from A) and column (from B)\n// identified by the passed indeces (output texture coordinate space).\n// We loop over elements in the row and column and sum the product\n// using the glsl `dot` function to process four elements at a time.\n// This four element optimization requires that the matrix B be\n// transposed before texel packing and that both matrices be padded\n// (with zeros) to a multiple of four (4) in their shared dimension.\nfloat dot_rowcol_1540259130(float y, float x, sampler2D A, sampler2D B_t, int K) {\n\tfloat delta_t = 1./float(K);// space (on texture) between elements\n\tfloat sum = 0.;\t\t\t// sum for this row/column pair\n\tfloat z = 0.5 * (4.0 * delta_t);// position for shared dimension on source textures\n\n\tfor (int l=0 ; l<4096 ; ++l) {\n\t\tif(l >= K / 4) break;    // stop when we finish the row/column\n\t\t// l is in pixel space, so we divide by four\n\n\t\t// retrieve next four elements from each texture\n\t\tvec4 a_ik = texture2D(  A, vec2(z, y));\n\t\tvec4 b_kj = texture2D(B_t, vec2(z, x));\n\n\t// use `dot` to process four elements at a time\n\t\tsum +=  dot(a_ik, b_kj);\n\t\tz += (4.0 * delta_t);      // (z + 0.5)*delta\n\t}\n\treturn sum;\n}\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1604150559(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\n\t// sum row x col for the passed pixel\n\tfloat sum = alpha * dot_rowcol_1540259130(row_t, col_t * float(N + pad)/float(N), A, B_t, K);\n\n\tif (sum == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n\t// output vec4 with bytes for an IEEE754 32-bit floating point number\n\tgl_FragColor = encode_float_1604150559(sum);\n}\n"),this.program_c=this.webgl.createProgram("// fragment shader that calculates the matrix product (with additive 'C' term)\n// and renders each element to the bytes representing a 32-bit IEEE754 floating\n// point in the output RGBA canvas.\n// readPixel is used to read the bytes.\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform sampler2D B_t;\t\t// texture with data from padded transpose of B\nuniform sampler2D C;\t\t// texture with data from C\nuniform int       K;\t\t// number of elements in shared dimension\nuniform int       N;\t\t// number of columns in output\nuniform int       pad;\t\t//\nuniform float     alpha; \t// coefficient to multiplication\nuniform float     beta; \t// coefficient to additive term\n\n// sum of products between elements in row i (from A) x col j (from B)\n\n// Calculate the dot product between the row (from A) and column (from B)\n// identified by the passed indeces (output texture coordinate space).\n// We loop over elements in the row and column and sum the product\n// using the glsl `dot` function to process four elements at a time.\n// This four element optimization requires that the matrix B be\n// transposed before texel packing and that both matrices be padded\n// (with zeros) to a multiple of four (4) in their shared dimension.\nfloat dot_rowcol_1540259130(float y, float x, sampler2D A, sampler2D B_t, int K) {\n\tfloat delta_t = 1./float(K);// space (on texture) between elements\n\tfloat sum = 0.;\t\t\t// sum for this row/column pair\n\tfloat z = 0.5 * (4.0 * delta_t);// position for shared dimension on source textures\n\n\tfor (int l=0 ; l<4096 ; ++l) {\n\t\tif(l >= K / 4) break;    // stop when we finish the row/column\n\t\t// l is in pixel space, so we divide by four\n\n\t\t// retrieve next four elements from each texture\n\t\tvec4 a_ik = texture2D(  A, vec2(z, y));\n\t\tvec4 b_kj = texture2D(B_t, vec2(z, x));\n\n\t// use `dot` to process four elements at a time\n\t\tsum +=  dot(a_ik, b_kj);\n\t\tz += (4.0 * delta_t);      // (z + 0.5)*delta\n\t}\n\treturn sum;\n}\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1117569599(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\n// select an element from a vector based on index\nfloat select_index_1604150559(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tvec4 c_vec = texture2D(C, vec2(col_t, 0.5));\n\n\t// should be -0.5, but that subtly breaks at zero\n\tfloat col = col_t * float(N + pad); // index of first element in pixel (matrix space)\n\tint channel = int(mod(col, 4.0 ));\n\tfloat c = select_index_1604150559(c_vec, channel);\n\n\t// sum row x col for the passed pixel\n\tfloat sum = alpha * dot_rowcol_1540259130(row_t, col_t * float(N + pad)/float(N), A, B_t, K);\n\tsum += beta * c;\n\n\tif (sum == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n\t// output vec4 with bytes for an IEEE754 32-bit floating point number\n\tgl_FragColor = encode_float_1117569599(sum);\n}\n")):(this.program_=this.webgl.createProgram("// fragment shader that calculates the matrix product and writes each\n// element to a pixel component in a floating point texture.\n// the output RGBA canvas.\n// readPixel is used to read the bytes.\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform sampler2D B_t;\t\t// texture with data from padded transpose of B\nuniform int       K;\t\t// number of elements in shared dimension\nuniform int       N;\t\t// number of columns in output\nuniform int       pad;\t\t//\nuniform float     alpha; \t// coefficient to multiplication\n\n// sum of products between elements in row i (from A) x col j (from B)\n\n// Calculate the dot product between the row (from A) and column (from B)\n// identified by the passed indeces (output texture coordinate space).\n// We loop over elements in the row and column and sum the product\n// using the glsl `dot` function to process four elements at a time.\n// This four element optimization requires that the matrix B be\n// transposed before texel packing and that both matrices be padded\n// (with zeros) to a multiple of four (4) in their shared dimension.\nfloat dot_rowcol_1540259130(float y, float x, sampler2D A, sampler2D B_t, int K) {\n\tfloat delta_t = 1./float(K);// space (on texture) between elements\n\tfloat sum = 0.;\t\t\t// sum for this row/column pair\n\tfloat z = 0.5 * (4.0 * delta_t);// position for shared dimension on source textures\n\n\tfor (int l=0 ; l<4096 ; ++l) {\n\t\tif(l >= K / 4) break;    // stop when we finish the row/column\n\t\t// l is in pixel space, so we divide by four\n\n\t\t// retrieve next four elements from each texture\n\t\tvec4 a_ik = texture2D(  A, vec2(z, y));\n\t\tvec4 b_kj = texture2D(B_t, vec2(z, x));\n\n\t// use `dot` to process four elements at a time\n\t\tsum +=  dot(a_ik, b_kj);\n\t\tz += (4.0 * delta_t);      // (z + 0.5)*delta\n\t}\n\treturn sum;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\n\tvec4 sum_v = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat col = (col_t * float(N + pad) - 2.0); // index of first element in pixel (matrix space)\n\tsum_v.r = alpha * dot_rowcol_1540259130(row_t, (col + 0.5)/float(N), A, B_t, K);\n\t// is last element in pixel past row length?\n\tif(pad > 0 && (col + 4.0) > float(N) ) {\n\t\t// compute elements in padded region\n\t\tif(pad < 3){\n\t\t\tsum_v.g = alpha * dot_rowcol_1540259130(row_t, (col + 1.5)/float(N), A, B_t, K);\n\t\t}\n\t\tif(pad < 2){\n\t\t\tsum_v.b = alpha * dot_rowcol_1540259130(row_t, (col + 2.5)/float(N), A, B_t, K);\n\t\t}\n\t} else {\n\t\tsum_v.g = alpha * dot_rowcol_1540259130(row_t, (col + 1.5)/float(N), A, B_t, K);\n\t\tsum_v.b = alpha * dot_rowcol_1540259130(row_t, (col + 2.5)/float(N), A, B_t, K);\n\t\tsum_v.a = alpha * dot_rowcol_1540259130(row_t, (col + 3.5)/float(N), A, B_t, K);\n\t}\n\n\tgl_FragColor = sum_v;\n}\n"),this.program_c=this.webgl.createProgram("// fragment shader that calculates the matrix product and writes each\n// element to a pixel component in a floating point texture.\n// the output RGBA canvas.\n// readPixel is used to read the bytes.\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform sampler2D B_t;\t\t// texture with data from padded transpose of B\nuniform sampler2D C;\t\t// texture with data from C\nuniform int       K;\t\t// number of elements in shared dimension\nuniform int       N;\t\t// number of columns in output\nuniform int       pad;\t\t//\nuniform float     alpha; \t// coefficient to multiplication\nuniform float     beta; \t// coefficient to addition\n\n// sum of products between elements in row i (from A) x col j (from B)\n\n// Calculate the dot product between the row (from A) and column (from B)\n// identified by the passed indeces (output texture coordinate space).\n// We loop over elements in the row and column and sum the product\n// using the glsl `dot` function to process four elements at a time.\n// This four element optimization requires that the matrix B be\n// transposed before texel packing and that both matrices be padded\n// (with zeros) to a multiple of four (4) in their shared dimension.\nfloat dot_rowcol_1540259130(float y, float x, sampler2D A, sampler2D B_t, int K) {\n\tfloat delta_t = 1./float(K);// space (on texture) between elements\n\tfloat sum = 0.;\t\t\t// sum for this row/column pair\n\tfloat z = 0.5 * (4.0 * delta_t);// position for shared dimension on source textures\n\n\tfor (int l=0 ; l<4096 ; ++l) {\n\t\tif(l >= K / 4) break;    // stop when we finish the row/column\n\t\t// l is in pixel space, so we divide by four\n\n\t\t// retrieve next four elements from each texture\n\t\tvec4 a_ik = texture2D(  A, vec2(z, y));\n\t\tvec4 b_kj = texture2D(B_t, vec2(z, x));\n\n\t// use `dot` to process four elements at a time\n\t\tsum +=  dot(a_ik, b_kj);\n\t\tz += (4.0 * delta_t);      // (z + 0.5)*delta\n\t}\n\treturn sum;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tvec4 c_v = texture2D(C, vec2(col_t, 0.5));\n\n\tvec4 sum_v = vec4(0.0, 0.0, 0.0, 0.0);\n\tfloat col = (col_t * float(N + pad) - 2.0); // index of first element in pixel (matrix space)\n\tsum_v.r = alpha * dot_rowcol_1540259130(row_t, (col + 0.5)/float(N), A, B_t, K);\n\t// in the padding region?\n\tif(pad > 0 && (col + 4.0) > float(N) ) {\n\t\t// pad\n\t\tif(pad < 3){\n\t\t\tsum_v.g = alpha * dot_rowcol_1540259130(row_t, (col + 1.5)/float(N), A, B_t, K);\n\t\t}\n\t\tif(pad < 2){\n\t\t\tsum_v.b = alpha * dot_rowcol_1540259130(row_t, (col + 2.5)/float(N), A, B_t, K);\n\t\t}\n\t} else {\n\t\tsum_v.g = alpha * dot_rowcol_1540259130(row_t, (col + 1.5)/float(N), A, B_t, K);\n\t\tsum_v.b = alpha * dot_rowcol_1540259130(row_t, (col + 2.5)/float(N), A, B_t, K);\n\t\tsum_v.a = alpha * dot_rowcol_1540259130(row_t, (col + 3.5)/float(N), A, B_t, K);\n\t}\n\n\tgl_FragColor = sum_v + beta*c_v;\n}\n"));}var o=t("./webgl");e.exports=r,r.TEXTURE_UNIFORM_NAME_0="A",r.TEXTURE_UNIFORM_NAME_1="B_t",r.TEXTURE_UNIFORM_NAME_2="C",r.SHARED_LENGTH_UNIFORM_NAME="K",r.COLUMN_COUNT_UNIFORM_NAME="N",r.PAD_UNIFORM_NAME="pad",r.ALPHA_UNIFORM_NAME="alpha",r.BETA_UNIFORM_NAME="beta",r.prototype.calculate=function(t,e,n,o,i,a,s,u,l){var c=this.webgl.context;null!=u?this.program=this.program_c:(s=null,this.program=this.program_),this.webgl.selectProgram(this.program),this.bindInputTexture(i,c.TEXTURE0,r.TEXTURE_UNIFORM_NAME_0),this.bindInputTexture(a,c.TEXTURE1,r.TEXTURE_UNIFORM_NAME_1),null!=u&&this.bindInputTexture(u,c.TEXTURE2,r.TEXTURE_UNIFORM_NAME_2);var f=this.webgl.getPad(n),p=this.webgl.getPad(e);this.bindUniforms(e,n+f,p,o,s),this.standalone?this.webgl.bindOutputTexture(t,e+p,l):this.webgl.bindOutputTexture(t,(e+p)/4,l),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0),this.webgl.unbindInputTexture(c.TEXTURE0),this.webgl.unbindInputTexture(c.TEXTURE1),this.webgl.unbindInputTexture(c.TEXTURE2);},r.prototype.bindInputTexture=function(t,e,n){var r=this.webgl.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.bindUniforms=function(t,e,n,o,i){var a=this.webgl.context,s=a.getUniformLocation(this.program,r.SHARED_LENGTH_UNIFORM_NAME),u=a.getUniformLocation(this.program,r.ALPHA_UNIFORM_NAME),l=a.getUniformLocation(this.program,r.BETA_UNIFORM_NAME),c=a.getUniformLocation(this.program,r.COLUMN_COUNT_UNIFORM_NAME),f=f=a.getUniformLocation(this.program,r.PAD_UNIFORM_NAME);a.uniform1f(l,i),a.uniform1i(c,t),a.uniform1i(f,n),a.uniform1i(s,e),a.uniform1f(u,o);};},{"./webgl":11}],8:[function(t,e,n){function r(t,e){this.webgl=t,this.standalone=null==e||e,this.standalone?this.program=this.webgl.createProgram(s):this.program=this.webgl.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;  // texture coords of row/column to calculate\nuniform sampler2D X;       // texture with data from padded A\nuniform float     factor;  // width of image patch\nuniform float     stride;  // width between image patches\nuniform float     margin;\nuniform float     N_p;     // patches across\nuniform float     M;\nuniform float     N;\nuniform float     pad;\nuniform float     M_in;\nuniform float     N_in;\nuniform float     C;       // number of channels in input\nuniform float     pad_in;\n\n// select an element from a vector based on index\nfloat select_index_1540259130(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\n// translate a linear index into x, y coordinates for a matrix\nvec2 linear_index_coords_1604150559(float linear_index, float row_length){\n\tvec2 coords;\n\n\tcoords.x = floor(mod(linear_index + 0.5, row_length)); // column\n\tcoords.y = floor((linear_index + 0.5) / row_length); // row\n\n\treturn coords;\n}\n\n// set pad values to 0.0, if in padded region of output texture\nvoid fix_pad_1117569599(inout vec4 v, int pad){\n\tv.a = 0.0;\n\tif(pad == 2){\n\t\tv.b = 0.0;\n\t} else if(pad == 3){\n\t\tv.b = 0.0;\n\t\tv.g = 0.0;\n\t}\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\n\t// row corresponds to patch\n\tfloat row = floor(row_t * M) + 0.5;\n\t// column corresponds to placement in patch\n\tfloat col_0 = floor(col_t * (N + pad) - 1.5); // index of first element in output pixel (matrix space)\n\n\t// N_p = patches across\n\tfloat col_patch = floor(mod(row, N_p)); // column index in grid of patches\n\tfloat row_patch = floor(row / N_p); // row index in grid of patches\n\tfloat col_in_0 = (col_patch * stride - margin) * C; // input column index of left element in patch\n\tfloat row_in_0 = row_patch * stride - margin; // input row index of top element in patch\n\n\tvec4 pixel_in;\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec2 coords = linear_index_coords_1604150559(col_0, factor * C); // coords inside patch\n\tvec2 ncoords;\n\tint channel_in = int(mod(col_in_0 + coords.x, 4.0));\n\tvec2 scale_in = vec2(1.0/(N_in + pad_in), 1.0/M_in); // scale from matrix to input texture coords\n\tvec2 offset_in = vec2(col_in_0 + 2.0 - float(channel_in), row_in_0 + 0.5); // offset into patch (and pixel)\n\n\tconst vec2 pixel_scale = vec2(1.0/4.0, 1.0); // scale from matrix to pixel coords\n\n\tpixel_in = texture2D(X, (coords + offset_in) * scale_in);\n\n\t// go through channels for current output pixel\n\tfor(int channel = 0; channel < 4; channel++){\n\n\t\t// are we on a new input pixel?\n\t\tncoords = linear_index_coords_1604150559(col_0 + float(channel), factor * C);\n\n\t\t// are we in the margin or outside the input texture?\n\t\tif((col_in_0 + ncoords.x + 0.5 < 0.0) || (row_in_0 + ncoords.y + 0.5 < 0.0) ||\n\t\t   (col_in_0 + ncoords.x + 0.5) > (N_in) || row_in_0 + ncoords.y + 0.5 > M_in){\n\t\t\t// yes, create a virtual pixel\n\t\t\tpixel_in = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t} else if(floor(ncoords * pixel_scale) != floor(coords * pixel_scale)){\n\t\t\t// no, get the get the next real pixel\n\t\t\tcoords = ncoords;\n\t\t\toffset_in.x += float(channel_in);\n\t\t\tchannel_in = 0;\n\t\t\tpixel_in = texture2D(X, (coords + offset_in) * scale_in);\n\t\t}\n\n\t\tif(channel == 0){\n\t\t\tresult.r = select_index_1540259130(pixel_in, channel_in);\n\t\t} else if(channel == 1){\n\t\t\tresult.g = select_index_1540259130(pixel_in, channel_in);\n\t\t} else if(channel == 2){\n\t\t\tresult.b = select_index_1540259130(pixel_in, channel_in);\n\t\t} else {\n\t\t\tresult.a = select_index_1540259130(pixel_in, channel_in);\n\t\t}\n\n\t\tchannel_in++;\n\t\toffset_in.x -= 1.0;\n\t}\n\n\t// fix padded region\n\tif(pad > 0.0 && col_0 + 4.0 > N ) {\n\t\tfix_pad_1117569599(result, int(pad));\n\t}\n\n\t//gl_FragColor = vec4(row_in_0, col_in_0, channel_in, N_p);\n\tgl_FragColor = result;\n}\n");}var o=t("./webgl");e.exports=r,r.TEXTURE_UNIFORM_NAME_0="X",r.STRIDE_UNIFORM_NAME="stride",r.KERNEL_WIDTH_UNIFORM_NAME="factor",r.prototype.calculate=function(t,e,n,o,i,a,s,u,l,c,f){var p=this.webgl.context,h=this.webgl.getPad(e*n),d=this.webgl.getPad(i);this.webgl.selectProgram(this.program),this.bindInputTexture(c,p.TEXTURE0,r.TEXTURE_UNIFORM_NAME_0),this.bindUniforms(o,i,d,t,e*n,n,h,a,s,u,l),this.standalone?this.webgl.bindOutputTexture(o,i+d,f):this.webgl.bindOutputTexture(o,(i+d)/4,f),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),this.webgl.unbindInputTexture(p.TEXTURE0);},r.prototype.bindInputTexture=function(t,e,n){var r=this.webgl.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.bindUniforms=function(t,e,n,o,i,a,s,u,l,c,f){var p=this.webgl.context,h=p.getUniformLocation(this.program,"M"),d=p.getUniformLocation(this.program,"N"),v=p.getUniformLocation(this.program,"C"),_=p.getUniformLocation(this.program,"M_in"),m=p.getUniformLocation(this.program,"N_in"),g=p.getUniformLocation(this.program,r.STRIDE_UNIFORM_NAME),y=p.getUniformLocation(this.program,r.KERNEL_WIDTH_UNIFORM_NAME),b=p.getUniformLocation(this.program,"pad"),w=p.getUniformLocation(this.program,"pad_in"),x=p.getUniformLocation(this.program,"N_p");margin_gl=p.getUniformLocation(this.program,"margin"),p.uniform1f(h,t),p.uniform1f(d,e),p.uniform1f(b,n),p.uniform1f(_,o),p.uniform1f(m,i),p.uniform1f(v,a),p.uniform1f(w,s),p.uniform1f(x,u),p.uniform1f(y,l),p.uniform1f(g,c),p.uniform1f(margin_gl,f);};},{"./webgl":11}],9:[function(t,e,n){function r(t,e){this.webgl=t,this.standalone=null==e||e,this.standalone?this.program=this.webgl.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D X;\t\t// texture with data from padded X\nuniform int       N;\t\t// number of columns\nuniform int       pad;\t\t// additional columns to nearest multiple of four\nuniform float     b; \t\t// additive term\nuniform float     a; \t\t// multiplicative term\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1540259130(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\n// select an element from a vector based on index\nfloat select_index_1604150559(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n \tfloat row = outTex.y;\n\tfloat col = outTex.x;\n\n\t// direct usage of col requires output be padded exactly like input\n\tvec4 x = texture2D( X, vec2(col, row));\n\tvec4 sum_v = (a * x) + b;\n\tint channel = int(mod(col * float(N + pad), 4.0 ));\n\tfloat sum = select_index_1604150559(sum_v, channel);\n\n\tif (sum == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n \t// output vec4 with bytes for an IEEE754 32-bit floating point number\n\tgl_FragColor = encode_float_1540259130(sum);\n}\n"):this.program=this.webgl.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D X;\t\t// texture with data from padded X\nuniform int       N;\t\t// number of columns\nuniform int       pad;\t\t// additional columns to nearest multiple of four\nuniform float     b; \t\t// additive term\nuniform float     a; \t\t// multiplicative term\n\n// set pad values to 0.0, if in padded region of output texture\nvoid fix_pad_1540259130(inout vec4 v, int pad){\n\tv.a = 0.0;\n\tif(pad == 2){\n\t\tv.b = 0.0;\n\t} else if(pad == 3){\n\t\tv.b = 0.0;\n\t\tv.g = 0.0;\n\t}\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tfloat col = (col_t * float(N + pad) - 2.0); // index of first element in pixel (matrix space)\n\n\t// direct usage of col requires output be padded exactly like input\n\tvec4 x = texture2D( X, vec2(col_t, row_t));\n\tvec4 sum_v = (a * x) + b;\n\n\t// fix padded region\n\tif(pad > 0 && col + 4.0 > float(N) ) {\n\t\tfix_pad_1540259130(sum_v, pad);\n\t}\n\n\tgl_FragColor = sum_v;\n}\n");}var o=t("./webgl");e.exports=r,r.TEXTURE_UNIFORM_NAME_0="X",r.LENGTH_UNIFORM_NAME="N",r.ADD_UNIFORM_NAME="b",r.MUL_UNIFORM_NAME="a",r.prototype.calculate=function(t,e,n,o,i,a){var s=this.webgl.context,u=this.webgl.getPad(e);this.webgl.selectProgram(this.program),this.bindInputTexture(i,s.TEXTURE0,r.TEXTURE_UNIFORM_NAME_0),this.bindUniforms(e,u,n,o),this.standalone?this.webgl.bindOutputTexture(t,e+u,a):this.webgl.bindOutputTexture(t,(e+u)/4,a),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0),this.webgl.unbindInputTexture(s.TEXTURE0);},r.prototype.bindInputTexture=function(t,e,n){var r=this.webgl.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.bindUniforms=function(t,e,n,o){var i=this.webgl.context,a=i.getUniformLocation(this.program,r.LENGTH_UNIFORM_NAME),s=i.getUniformLocation(this.program,r.ADD_UNIFORM_NAME),u=i.getUniformLocation(this.program,r.MUL_UNIFORM_NAME),l=i.getUniformLocation(this.program,"pad");i.uniform1i(a,t),i.uniform1i(l,e),i.uniform1f(u,n),i.uniform1f(s,o);};},{"./webgl":11}],10:[function(t,e,n){function r(t,e){if(2!=t.length)throw new Error("Only Tensor of order two (matrix) is supported right now.");var n=t[0],r=t[1];this.texture=i.createDataTexture(n,r,e),this.shape=[n,r],this[Symbol.toStringTag]="Tensor";}var o=t("./globals"),i=o.gl;e.exports=r,r.prototype.delete=function(){i.context.deleteTexture(this.texture),this.texture=null,this.shape=null;},r.prototype.transfer=function(t){var e,n,r=this.shape[0],o=this.shape[1];return e=i.createOutputTexture(r,o),i.encode(r,o,this.texture,e),n=new Float32Array(i.readData(r,o)),i.context.deleteTexture(e),t||this.delete(),n;},r.prototype.reshape=function(t,e){var n=this.shape[0],o=this.shape[1],a=t[0],s=t[1],u=new r(t,null);return i.reshape(n,o,a,s,this.texture,u.texture),e||this.delete(),u;},r.prototype.transpose=function(t){var e=this.shape[0],n=this.shape[1],o=new r([n,e],null);return i.transpose(e,n,this.texture,o.texture),t||this.delete(),o;},r.prototype.split=function(t,e){var n=this.shape[0],o=this.shape[1];if(o%2!=0)throw new Error("row count must be multiple of two.");var a=new r([n,o/2],null),s=new r([n,o/2],null);return i.submatrix(o,n,o/2,t,0,this.texture,a.texture),i.submatrix(o,n,o/2,t,1,this.texture,s.texture),e||this.delete(),[a,s];},r.combine=function(t,e,n,o){var a=t.shape[0],s=t.shape[1];if(t.shape[1]!==e.shape[1]||t.shape[0]!==e.shape[0])throw new Error("row and column counts must be equal.");if(n%4!=0)throw new Error("stride must be a multiple of four");var u=new r([a,2*s],null);return i.combine(a,s,n,t.texture,e.texture,u.texture),o||(t.delete(),e.delete()),u;};},{"./globals":2}],11:[function(t,e,n){function r(t){var e,n;if(t=t||{},void 0===t.canvas?this.canvas=document.createElement("canvas"):this.canvas=t.canvas,e={premultipliedAlpha:!1,preserveDrawingBuffer:!1},this.context=this.canvas.getContext("experimental-webgl",e),null==this.context)throw new Error("No support for Webgl.");try{n=this.context.getExtension("OES_texture_float");}catch(t){}null==n?(console.log("No support for OES_texture_float extension!"),this.hasFloat=!1):this.hasFloat=!0;var r=this.context.getShaderPrecisionFormat(this.context.FRAGMENT_SHADER,this.context.HIGH_FLOAT);this.hasHighPrecision=0!=r.precision,this.hasHighPrecision&&(this.highp=r),this.vertexShader=this.context.createShader(this.context.VERTEX_SHADER),this.context.shaderSource(this.vertexShader,"// vertex shader for a single quad\n// work is performed in the operation specific texture shader\n\nprecision highp float;\n#define GLSLIFY 1\n\nattribute vec3 pos;\nattribute vec2 tex;\nvarying vec2   outTex;\nvoid main(void)\n{\n\t// just pass the position and texture coords\n\tgl_Position = vec4(pos, 1.0);\n\toutTex = tex;\n}\n"),this.context.compileShader(this.vertexShader),this.encode_program=this.createProgram("\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform int       N;\t\t// number of columns in output\nuniform int       pad;\t\t//\n\n// Render float to bytes according to IEEE 754 Floating Point\nvec4 encode_float_1540259130(float val) {\n\n\t// TODO: correctly handle denormal numbers\n\t// http://www.2ality.com/2012/04/number-encoding.html\n\tfloat a = abs(val);                           // encode absolute value + sign\n\tfloat exp = floor(log2(a));                 // number of powers of 2\n\tfloat mant = pow(2.,log2(a)-exp) * pow(2.,23.);  // multiply to fill 24 bits (implied leading 1)\n\tfloat mant1 = floor(mant / 256. / 256.);    // first 8 bits of mantissa\n\tfloat mant2 = mod(floor(mant / 256.),256.); // second 8 bits\n\tfloat mant3 = mod(mant,256.);               // third 8 bits\n\n\thighp float sign = 128.-128.*(a/val);\t\t\t// sign bit is 256 or 0\n\thighp float e = (sign+exp+127.)/510.;\t\t// exponent and sign\n\thighp float m1 = (mant1-(128.*(1.-mod(exp+127.,2.))))/255.; // handle leading bit\n\thighp float m2 = (mant2)/255.;\t\t\t\t// middle part\n\thighp float m3 = (mant3+.5)/255.;\t\t\t// scale to 0 - 255\n\n\treturn vec4(m3,m2,m1,e);\n}\n\n// select an element from a vector based on index\nfloat select_index_1604150559(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\n\tvec4 val_v = texture2D(A, vec2(col_t * float(N)/float(N + pad), row_t));\n\tint channel = int(mod(col_t * float(N), 4.0 ));\n\tfloat val = select_index_1604150559(val_v, channel);\n\n\tif (val == 0.) {\n\t\tgl_FragColor = vec4(0.,0.,0.,0.);\n\t\treturn;\n\t}\n\n \t// output vec4 with bytes for an IEEE754 32-bit floating point number\n\tgl_FragColor = encode_float_1540259130(val);\n}\n"),this.transpose_program=this.createProgram("\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform int       M;\t\t// number of rows in output\nuniform int       N;\t\t// number of columns in output\nuniform int       mpad;\t\t//\nuniform int       npad;\t\t//\n\n// select an element from a vector based on index\nfloat select_index_1540259130(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tfloat col = (col_t * float(N + npad) - 2.0); // index of first element in pixel (matrix space)\n\n\t// get rows in the input, each containing one element in the output\n\tvec4 row_1 = texture2D(A, vec2((row_t * float(M))/float(M + mpad), (col + 0.5)/float(N)));\n\tvec4 row_2 = texture2D(A, vec2((row_t * float(M))/float(M + mpad), (col + 1.5)/float(N)));\n\tvec4 row_3 = texture2D(A, vec2((row_t * float(M))/float(M + mpad), (col + 2.5)/float(N)));\n\tvec4 row_4 = texture2D(A, vec2((row_t * float(M))/float(M + mpad), (col + 3.5)/float(N)));\n\n\t// package into output vector\n\tint channel = int(mod(row_t * float(M), 4.0 ));\n\n\tvec4 col_v = vec4(0.0, 0.0, 0.0, 0.0); // vec4 representing four elements in a column in the input\n\n\t// extract relevent element from each input row\n\tcol_v.r = select_index_1540259130(row_1, channel);\n\tif(npad > 0 && (col + 4.0) > float(N) ) {\n\t\t// compute elements in padded region\n\t\tif(npad < 3){\n\t\t\tcol_v.g = select_index_1540259130(row_2, channel);\n\t\t}\n\t\tif(npad < 2){\n\t\t\tcol_v.b = select_index_1540259130(row_3, channel);\n\t\t}\n\t} else {\n\t\tcol_v.g = select_index_1540259130(row_2, channel);\n\t\tcol_v.b = select_index_1540259130(row_3, channel);\n\t\tcol_v.a = select_index_1540259130(row_4, channel);\n\t}\n\n\tgl_FragColor = col_v;\n}\n"),this.reshape_program=this.createProgram("\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform float     M;\t\t// number of rows in output\nuniform float     N;\t\t// number of columns in output\nuniform float     pad;\t\t// column padding in output\nuniform float     M_in;\t\t// number of rows in input\nuniform float     N_in;\t\t// number of columns in input\nuniform float     pad_in;\t// column padding in input\n\n/* number of input pixels\n   origin index (channel) for each\n   termination index (channel) for each\n   destination origin index (channel) for each\n */\n// select an element from a vector based on index\nfloat select_index_1540259130(vec4 v, int index){\n\tfloat val;\n\tif (index == 0) {\n\t\tval = v.r;\n\t} else if(index == 1) {\n\t\tval = v.g;\n\t} else if(index == 2) {\n\t\tval = v.b;\n\t} else if(index == 3){\n\t\tval = v.a;\n\t} else {\n\t\t// should never be here\n\t\tval = 0.0;\n\t}\n\n\treturn val;\n}\n\n// set pad values to 0.0, if in padded region of output texture\nvoid fix_pad_1604150559(inout vec4 v, int pad){\n\tv.a = 0.0;\n\tif(pad == 2){\n\t\tv.b = 0.0;\n\t} else if(pad == 3){\n\t\tv.b = 0.0;\n\t\tv.g = 0.0;\n\t}\n}\n\n// translate a linear index into x, y coordinates for a matrix\nvec2 linear_index_coords_1117569599(float linear_index, float row_length){\n\tvec2 coords;\n\n\tcoords.x = floor(mod(linear_index + 0.5, row_length)); // column\n\tcoords.y = floor((linear_index + 0.5) / row_length); // row\n\n\treturn coords;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\n\tfloat row = floor(row_t * M);\n\tfloat col_0 = (col_t * (N + pad) - 2.0); // index of first element in pixel (matrix space)\n\t//float col_0 = floor(col_t * (N + pad)/4.0)*4.0; // index of first element in pixel (matrix space)\n\tfloat lin_index_0 = row * N + col_0; // linearized index of first element in pixel in output\n\n\tvec4 pixel_in = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec4 result = vec4(0.0, 0.0, 0.0, 0.0);\n\tvec2 coords = linear_index_coords_1117569599(lin_index_0, N_in);\n\tvec2 ncoords;\n\tint channel_in = int(mod(coords.x, 4.0));\n\n\tvec2 scale_in = vec2(1.0/(N_in + pad_in), 1.0/M_in); // scale from matrix to input texture coords\n\tvec2 offset_in = vec2(0.5, 0.5); // move away from edge of pixel\n\tconst vec2 pixel_scale = vec2(1.0/4.0, 1.0); // scale from matrix to pixel coords\n\n\tpixel_in = texture2D(A, (coords + offset_in) * scale_in);\n\n\t// go through channels for current output pixel\n\tfor(int channel = 0; channel < 4; channel++){\n\n\t\t// are we on a new input pixel?\n\t\tncoords = linear_index_coords_1117569599(lin_index_0 + float(channel), N_in);\n\t\tif(floor(ncoords * pixel_scale) != floor(coords * pixel_scale)){\n\t\t\tcoords = ncoords;\n\t\t\tpixel_in = texture2D(A, (coords + offset_in) * scale_in);\n\t\t\tchannel_in = 0;\n\t\t}\n\n\t\tif(channel == 0){\n\t\t\tresult.r = select_index_1540259130(pixel_in, channel_in);\n\t\t} else if(channel == 1){\n\t\t\tresult.g = select_index_1540259130(pixel_in, channel_in);\n\t\t} else if(channel == 2){\n\t\t\tresult.b = select_index_1540259130(pixel_in, channel_in);\n\t\t} else {\n\t\t\tresult.a = select_index_1540259130(pixel_in, channel_in);\n\t\t}\n\n\t\tchannel_in++;\n\t}\n\n\t// are we in the padded (output) region?\n\tif(pad > 0.0 && col_0 + 3.5 > N ) {\n\t\tfix_pad_1604150559(result, int(pad));\n\t}\n\n\tgl_FragColor = result;\n}\n"),this.reshape_simple_program=this.createProgram("\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform float     M;\t\t// number of rows in output\nuniform float     N;\t\t// number of columns in output\nuniform float     M_in;\t\t// number of rows in input\nuniform float     N_in;\t\t// number of columns in input\n\n// translate a linear index into x, y coordinates for a matrix\nvec2 linear_index_coords_1540259130(float linear_index, float row_length){\n\tvec2 coords;\n\n\tcoords.x = floor(mod(linear_index + 0.5, row_length)); // column\n\tcoords.y = floor((linear_index + 0.5) / row_length); // row\n\n\treturn coords;\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\n\tfloat row = floor(row_t * M);\n\tfloat col_0 = floor(col_t * N - 1.5); // index of first element in pixel (matrix space)\n\tfloat lin_index_0 = row * N + col_0; // linearized index of first element in pixel in output\n\n\tvec4 result;\n\tvec2 coords = linear_index_coords_1540259130(lin_index_0, N_in);\n\n\tvec2 scale_in = vec2(1.0/N_in, 1.0/M_in); // scale from matrix to input texture coords\n\tvec2 offset_in = vec2(0.5, 0.5); // move away from edge of pixel\n\n\tresult = texture2D(A, (coords + offset_in) * scale_in);\n\n\tgl_FragColor = result;\n}\n"),this.submatrix_program=this.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D X;\t\t// texture with data from padded X\nuniform float     N;\t\t// number of columns\nuniform float     pad;\t\t// additional columns to nearest multiple of four\nuniform float     N_in;\t\t// number of columns (input)\nuniform float     pad_in;\t// additional columns to nearest multiple of four (input)\nuniform float     stride;\nuniform float     offset;   // zero or one\n\n// set pad values to 0.0, if in padded region of output texture\nvoid fix_pad_1540259130(inout vec4 v, int pad){\n\tv.a = 0.0;\n\tif(pad == 2){\n\t\tv.b = 0.0;\n\t} else if(pad == 3){\n\t\tv.b = 0.0;\n\t\tv.g = 0.0;\n\t}\n}\n\n/* join parts of two pixels into one, selecting four continguous elements\n  starting at channel.\n*/\nvoid join_pixels_1604150559(inout vec4 x, vec4 x0, vec4 x1, float channel){\n\tif(channel == 1.0){\n\t\tx.rgb = x0.gba;\n\t\tx.a = x1.r;\n\t} else if(channel == 2.0){\n\t\tx.rg = x0.ba;\n\t\tx.ba = x1.rg;\n\t} else if(channel == 3.0){\n\t\tx.r = x0.a;\n\t\tx.gba = x1.rgb;\n\t}\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tfloat col = floor(col_t * (N + pad) - 1.5); // index of first element in pixel (output matrix space)\n\n\tfloat stripe = floor(col / stride);\n\tfloat sub_col = floor(mod(col, stride));\n\n\tfloat col_in = (offset + (2.0 * stripe)) * stride + sub_col;\n\n\tvec4 x;\n\tfloat channel = mod(col_in, 4.0); // channel in the input of first element in output\n\n\t// are we at the beggining of an input pixel?\n\tif(channel == 0.0){\n\t\t// yes, select the whole thing\n\t\tx = texture2D( X, vec2((col_in + 2.0 - channel) / (N_in + pad_in) , row_t));\n\t} else {\n\t\t// no, select parts from two pixels\n\t\tvec4 x0, x1;\n\t\tx0 = texture2D( X, vec2((col_in + 2.0 - channel) / (N_in + pad_in) , row_t));\n\t\tx1 = texture2D( X, vec2((col_in + 6.0 - channel) / (N_in + pad_in) , row_t));\n\n\t\tjoin_pixels_1604150559(x, x0, x1, channel);\n\n\t}\n\n\t// fix padded region\n\tif(pad > 0.0 && col + 4.0 > N ) {\n\t\tfix_pad_1540259130(x, int(pad));\n\t}\n\n\tgl_FragColor = x;\n}\n"),this.combine_program=this.createProgram("precision highp float;\n#define GLSLIFY 1\n\nvarying vec2      outTex;\t// texture coords of row/column to calculate\nuniform sampler2D A;\t\t// texture with data from padded A\nuniform sampler2D B;\t\t// texture with data from padded B\nuniform float     N_in;\t\t// number of columns\nuniform float     pad_in;\t// additional columns to nearest multiple of four\nuniform float     stride;\n\n// set pad values to 0.0, if in padded region of output texture\nvoid fix_pad_1540259130(inout vec4 v, int pad){\n\tv.a = 0.0;\n\tif(pad == 2){\n\t\tv.b = 0.0;\n\t} else if(pad == 3){\n\t\tv.b = 0.0;\n\t\tv.g = 0.0;\n\t}\n}\n\nvoid main(void) {\n\n\t// get the implied row and column from .y and .x of passed (output)\n\t// texture coordinate. These map directly to input texture space when\n\t// the relevant dimensions are the same.\n\tfloat row_t = outTex.y;\n\tfloat col_t = outTex.x;\n\tfloat N = N_in * 2.0;\n\tfloat pad = mod(N, 4.0);\n\tfloat col = floor(col_t * (N + pad) - 1.5); // index of first element in pixel (output matrix space)\n\n\tfloat stripe = floor(col / stride);\n\tfloat sub_col = floor(mod(col, stride));\n\n\tfloat tex_select = mod(stripe, 2.0);\n\tfloat col_in = floor(stripe / 2.0) * stride + sub_col;\n\n\tvec4 x;\n\tfloat channel = mod(col_in, 4.0); // channel in the input of first element in output\n\n\t// which input texture are we getting this pixel from?\n\tif(tex_select == 0.0){\n\t\tx = texture2D( A, vec2((col_in + 2.0) / (N_in + pad_in) , row_t));\n\t} else {\n\t\tx = texture2D( B, vec2((col_in + 2.0) / (N_in + pad_in) , row_t));\n\t}\n\n\t// fix padded region\n\tif(pad > 0.0 && col + 4.0 > N ) {\n\t\tfix_pad_1540259130(x, int(pad));\n\t}\n\n\tgl_FragColor = x;\n}\n");}e.exports=r,r.COMPONENTS_PER_TEXEL=4,r.POSITION_UNIFORM_NAME="pos",r.TEXTURE_UNIFORM_NAME="tex",r.prototype.encode=function(t,e,n,r){this.program=this.encode_program,this.selectProgram(this.program);var o=this.getPad(e),i=this.context.getUniformLocation(this.program,"N"),a=this.context.getUniformLocation(this.program,"pad");this.context.uniform1i(i,e),this.context.uniform1i(a,o),this.bindInputTexture(n,this.context.TEXTURE0,"A"),this.bindOutputTexture(t,e,r),this.context.drawElements(this.context.TRIANGLES,6,this.context.UNSIGNED_SHORT,0),this.unbindInputTexture(this.context.TEXTURE0);},r.prototype.transpose=function(t,e,n,r){this.program=this.transpose_program,this.selectProgram(this.program);var o=this.getPad(e),i=this.getPad(t),a=this.context.getUniformLocation(this.program,"N"),s=this.context.getUniformLocation(this.program,"npad"),u=this.context.getUniformLocation(this.program,"M"),l=this.context.getUniformLocation(this.program,"mpad");this.context.uniform1i(a,t),this.context.uniform1i(s,i),this.context.uniform1i(u,e),this.context.uniform1i(l,o),this.bindInputTexture(n,this.context.TEXTURE0,"A"),this.bindOutputTexture(e,(t+i)/4,r),this.context.drawElements(this.context.TRIANGLES,6,this.context.UNSIGNED_SHORT,0),this.unbindInputTexture(this.context.TEXTURE0);},r.prototype.reshape=function(t,e,n,r,o,i){var a=this.getPad(e),s=this.getPad(r);0==a&&0==s?this.program=this.reshape_simple_program:(this.program=this.reshape_program,console.log("# WARNING: using slow reshape shader.")),this.selectProgram(this.program);var u=this.context.getUniformLocation(this.program,"M"),l=this.context.getUniformLocation(this.program,"N"),c=this.context.getUniformLocation(this.program,"pad"),f=this.context.getUniformLocation(this.program,"M_in"),p=this.context.getUniformLocation(this.program,"N_in"),h=this.context.getUniformLocation(this.program,"pad_in");this.context.uniform1f(u,n),this.context.uniform1f(l,r),this.context.uniform1f(c,s),this.context.uniform1f(f,t),this.context.uniform1f(p,e),this.context.uniform1f(h,a),this.bindInputTexture(o,this.context.TEXTURE0,"A"),this.bindOutputTexture(n,(r+s)/4,i),this.context.drawElements(this.context.TRIANGLES,6,this.context.UNSIGNED_SHORT,0),this.unbindInputTexture(this.context.TEXTURE0);},r.prototype.submatrix=function(t,e,n,r,o,i,a){this.program=this.submatrix_program,this.selectProgram(this.program);var s=this.getPad(t),u=this.getPad(n),l=this.context.getUniformLocation(this.program,"N"),c=this.context.getUniformLocation(this.program,"pad"),f=this.context.getUniformLocation(this.program,"N_in"),p=this.context.getUniformLocation(this.program,"pad_in"),h=this.context.getUniformLocation(this.program,"offset");stride_gl=this.context.getUniformLocation(this.program,"stride"),this.context.uniform1f(l,n),this.context.uniform1f(c,u),this.context.uniform1f(f,t),this.context.uniform1f(p,s),this.context.uniform1f(stride_gl,r),this.context.uniform1f(h,o),this.bindInputTexture(i,this.context.TEXTURE0,"X"),this.bindOutputTexture(e,(n+u)/4,a),this.context.drawElements(this.context.TRIANGLES,6,this.context.UNSIGNED_SHORT,0),this.unbindInputTexture(this.context.TEXTURE0);},r.prototype.combine=function(t,e,n,r,o,i){this.program=this.combine_program,this.selectProgram(this.program);var a=2*e,s=this.getPad(e),u=this.getPad(a),l=this.context.getUniformLocation(this.program,"N_in"),c=this.context.getUniformLocation(this.program,"pad_in"),f=this.context.getUniformLocation(this.program,"stride");this.context.uniform1f(l,e),this.context.uniform1f(c,s),this.context.uniform1f(f,n),this.bindInputTexture(r,this.context.TEXTURE0,"A"),this.bindInputTexture(o,this.context.TEXTURE1,"B"),this.bindOutputTexture(t,(a+u)/4,i),this.context.drawElements(this.context.TRIANGLES,6,this.context.UNSIGNED_SHORT,0),this.unbindInputTexture(this.context.TEXTURE0);},r.prototype.bindInputTexture=function(t,e,n){var r=this.context,o=this.program;r.activeTexture(e),r.bindTexture(r.TEXTURE_2D,t);var i=r.getUniformLocation(o,n);r.uniform1i(i,e-r.TEXTURE0);},r.prototype.createProgram=function(t){var e,n=this.context;if(e=n.createShader(n.FRAGMENT_SHADER),n.shaderSource(e,t),n.compileShader(e),0==n.getShaderParameter(e,n.COMPILE_STATUS))throw new Error(n.getShaderInfoLog(e));var r=n.createProgram();return n.attachShader(r,this.vertexShader),n.attachShader(r,e),n.linkProgram(r),r;},r.prototype.selectProgram=function(t){this.context.useProgram(t),this.bindVertices(t);},r.prototype.bindVertices=function(t){var e=this.context,n=t,o=e.getAttribLocation(n,r.POSITION_UNIFORM_NAME),i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i);var a=[-1,-1,0,1,-1,0,1,1,0,-1,1,0];e.bufferData(e.ARRAY_BUFFER,new Float32Array(a),e.STATIC_DRAW),e.vertexAttribPointer(o,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o);var s=e.getAttribLocation(n,r.TEXTURE_UNIFORM_NAME),u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u);var l=[0,0,1,0,1,1,0,1];e.bufferData(e.ARRAY_BUFFER,new Float32Array(l),e.STATIC_DRAW),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s);var c=e.createBuffer();e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,c);var f=[0,1,2,0,2,3];e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array(f),e.STATIC_DRAW);},r.prototype.createDataTexture=function(t,e,n){var o=this.context,i=[0,0,0,0],a=e%r.COMPONENTS_PER_TEXEL,s=0==a?0:r.COMPONENTS_PER_TEXEL-a,u=o.createTexture();if(o.bindTexture(o.TEXTURE_2D,u),0==s||null==n||void 0===n)o.texImage2D(o.TEXTURE_2D,0,o.RGBA,(e+s)/r.COMPONENTS_PER_TEXEL,t,0,o.RGBA,o.FLOAT,n);else{o.texImage2D(o.TEXTURE_2D,0,o.RGBA,(e+s)/r.COMPONENTS_PER_TEXEL,t,0,o.RGBA,o.FLOAT,null);for(var l,c,f=e-a,p=f/r.COMPONENTS_PER_TEXEL,h=0,d=new Float32Array(i),v=0;t>v;v++){h=v*e,full_texel_row_end=h+f,l=new Float32Array(n.buffer,h*n.BYTES_PER_ELEMENT,f),f>0&&o.texSubImage2D(o.TEXTURE_2D,0,0,v,p,1,o.RGBA,o.FLOAT,l),c=new Float32Array(n.buffer,full_texel_row_end*n.BYTES_PER_ELEMENT,a),d.set(c),o.texSubImage2D(o.TEXTURE_2D,0,p,v,1,1,o.RGBA,o.FLOAT,d);}}return o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),o.bindTexture(o.TEXTURE_2D,null),u;},r.prototype.createOutputTexture=function(t,e){var n=this.context,r=this.getPad(e),o=n.createTexture();return n.bindTexture(n.TEXTURE_2D,o),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e+r,t,0,n.RGBA,n.UNSIGNED_BYTE,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null),o;},r.prototype.bindOutputTexture=function(t,e,n){var r=this.context;if(this.canvas.height=t,this.canvas.width=e,r.viewport(0,0,e,t),this.framebuffer=this.framebuffer||r.createFramebuffer(),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,n,0),r.checkFramebufferStatus(r.FRAMEBUFFER)!=r.FRAMEBUFFER_COMPLETE)throw new Error("Bound framebuffer is not complete.");return this.framebuffer;},r.prototype.unbindInputTexture=function(t){var e=this.context;e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null);},r.prototype.readData=function(t,e){var n=this.context;return rawbuffer=new ArrayBuffer(t*e*Float32Array.BYTES_PER_ELEMENT),prod=new Uint8Array(rawbuffer),n.readPixels(0,0,e,t,n.RGBA,n.UNSIGNED_BYTE,prod),rawbuffer;},r.prototype.getPad=function(t){var e=t%r.COMPONENTS_PER_TEXEL;return 0==e?0:r.COMPONENTS_PER_TEXEL-e;};},{}]},{},[1])(1);});},function(t,e,n){t.exports=n(206);},function(t,e,n){"use strict";function r(t){var e=new a(t),n=i(a.prototype.request,e);return o.extend(n,a.prototype,e),o.extend(n,e),n;}var o=n(20),i=n(138),a=n(208),s=n(95),u=r(s);u.Axios=a,u.create=function t(e){return r(o.merge(s,e));},u.Cancel=n(135),u.CancelToken=n(207),u.isCancel=n(136),u.all=function t(e){return Promise.all(e);},u.spread=n(222),t.exports=u,t.exports.default=u;},function(t,e,n){"use strict";function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function t(n){e=n;});var n=this;t(function t(r){n.reason||(n.reason=new o(r),e(n.reason));});}var o=n(135);r.prototype.throwIfRequested=function t(){if(this.reason)throw this.reason;},r.source=function t(){var e;return{token:new r(function t(n){e=n;}),cancel:e};},t.exports=r;},function(t,e,n){"use strict";function r(t){this.defaults=t,this.interceptors={request:new a(),response:new a()};}var o=n(95),i=n(20),a=n(209),s=n(210),u=n(218),l=n(216);r.prototype.request=function t(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),e=i.merge(o,this.defaults,{method:"get"},e),e.baseURL&&!u(e.url)&&(e.url=l(e.baseURL,e.url));var n=[s,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function t(e){n.unshift(e.fulfilled,e.rejected);}),this.interceptors.response.forEach(function t(e){n.push(e.fulfilled,e.rejected);});n.length;){r=r.then(n.shift(),n.shift());}return r;},i.forEach(["delete","get","head","options"],function t(e){r.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}));};}),i.forEach(["post","put","patch"],function t(e){r.prototype[e]=function(t,n,r){return this.request(i.merge(r||{},{method:e,url:t,data:n}));};}),t.exports=r;},function(t,e,n){"use strict";function r(){this.handlers=[];}var o=n(20);r.prototype.use=function t(e,n){return this.handlers.push({fulfilled:e,rejected:n}),this.handlers.length-1;},r.prototype.eject=function t(e){this.handlers[e]&&(this.handlers[e]=null);},r.prototype.forEach=function t(e){o.forEach(this.handlers,function t(n){null!==n&&e(n);});},t.exports=r;},function(t,e,n){"use strict";function r(t){t.cancelToken&&t.cancelToken.throwIfRequested();}var o=n(20),i=n(213),a=n(136),s=n(95);t.exports=function t(e){return r(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function t(n){delete e.headers[n];}),(e.adapter||s.adapter)(e).then(function t(n){return r(e),n.data=i(n.data,n.headers,e.transformResponse),n;},function t(n){return a(n)||(r(e),n&&n.response&&(n.response.data=i(n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n);});};},function(t,e,n){"use strict";t.exports=function t(e,n,r,o){return e.config=n,r&&(e.code=r),e.response=o,e;};},function(t,e,n){"use strict";var r=n(137);t.exports=function t(e,n,o){var i=o.config.validateStatus;o.status&&i&&!i(o.status)?n(r("Request failed with status code "+o.status,o.config,null,o)):e(o);};},function(t,e,n){"use strict";var r=n(20);t.exports=function t(e,n,o){return r.forEach(o,function t(r){e=r(e,n);}),e;};},function(t,e,n){"use strict";function r(){this.message="String contains an invalid character";}function o(t){for(var e=String(t),n="",o,a,s=0,u=i;e.charAt(0|s)||(u="=",s%1);n+=u.charAt(63&o>>8-s%1*8)){if((a=e.charCodeAt(s+=.75))>255)throw new r();o=o<<8|a;}return n;}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error(),r.prototype.code=5,r.prototype.name="InvalidCharacterError",t.exports=o;},function(t,e,n){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]");}var o=n(20);t.exports=function t(e,n,i){if(!n)return e;var a;if(i)a=i(n);else if(o.isURLSearchParams(n))a=n.toString();else{var s=[];o.forEach(n,function t(e,n){null!==e&&void 0!==e&&(o.isArray(e)&&(n+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function t(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),s.push(r(n)+"="+r(e));}));}),a=s.join("&");}return a&&(e+=(-1===e.indexOf("?")?"?":"&")+a),e;};},function(t,e,n){"use strict";t.exports=function t(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e;};},function(t,e,n){"use strict";var r=n(20);t.exports=r.isStandardBrowserEnv()?function t(){return{write:function t(e,n,o,i,a,s){var u=[];u.push(e+"="+encodeURIComponent(n)),r.isNumber(o)&&u.push("expires="+new Date(o).toGMTString()),r.isString(i)&&u.push("path="+i),r.isString(a)&&u.push("domain="+a),!0===s&&u.push("secure"),document.cookie=u.join("; ");},read:function t(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null;},remove:function t(e){this.write(e,"",Date.now()-864e5);}};}():function t(){return{write:function t(){},read:function t(){return null;},remove:function t(){}};}();},function(t,e,n){"use strict";t.exports=function t(e){return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e);};},function(t,e,n){"use strict";var r=n(20);t.exports=r.isStandardBrowserEnv()?function t(){function e(t){var e=t;return n&&(o.setAttribute("href",e),e=o.href),o.setAttribute("href",e),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname};}var n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a"),i;return i=e(window.location.href),function t(n){var o=r.isString(n)?e(n):n;return o.protocol===i.protocol&&o.host===i.host;};}():function t(){return function t(){return!0;};}();},function(t,e,n){"use strict";var r=n(20);t.exports=function t(e,n){r.forEach(e,function t(r,o){o!==n&&o.toUpperCase()===n.toUpperCase()&&(e[n]=r,delete e[o]);});};},function(t,e,n){"use strict";var r=n(20);t.exports=function t(e){var n={},o,i,a;return e?(r.forEach(e.split("\n"),function t(e){a=e.indexOf(":"),o=r.trim(e.substr(0,a)).toLowerCase(),i=r.trim(e.substr(a+1)),o&&(n[o]=n[o]?n[o]+", "+i:i);}),n):n;};},function(t,e,n){"use strict";t.exports=function t(e){return function t(n){return e.apply(null,n);};};},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=16384;if("undefined"!=typeof window){var o=document.createElement("canvas"),i=o.getContext("webgl")||o.getContext("experimental-webgl");i?e.MAX_TEXTURE_SIZE=r=i.getParameter(i.MAX_TEXTURE_SIZE):console.log("Unable to initialize WebGL. Your browser may not support it.");}e.MAX_TEXTURE_SIZE=r;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(68),l=r(u),c=function(t){function e(){o(this,e);var t=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.inputTransformProgram=t.webgl.createProgram(n(629)),t.mainProgram=t.webgl.createProgram(n(628)),t;}return a(e,t),s(e,[{key:"_bindInputTexturesInputTransform",value:function t(n,r,o){var i=this.webgl.context;this.numTextures=3,this._bindInputTexture(this.inputTransformProgram,n.texture,i.TEXTURE0,e.INPUT_TEXTURE_NAME),this._bindInputTexture(this.inputTransformProgram,r.texture,i.TEXTURE1,e.IMAP_ROW_TEXTURE_NAME),this._bindInputTexture(this.inputTransformProgram,o.texture,i.TEXTURE2,e.IMAP_COL_TEXTURE_NAME);}},{key:"_bindInputTexturesMain",value:function t(n,r,o){var i=this.webgl.context;this.numTextures=3,this._bindInputTexture(this.mainProgram,n.texture,i.TEXTURE0,e.INPUT_TEXTURE_NAME),this._bindInputTexture(this.mainProgram,r.texture,i.TEXTURE1,e.WEIGHTS_TEXTURE_NAME),this._bindInputTexture(this.mainProgram,o.texture,i.TEXTURE2,e.BIAS_TEXTURE_NAME);}},{key:"_bindUniformsInputTransform",value:function t(n,r){var o=this.webgl.context,i=n.shape[0],a=n.shape[1],s=r.shape[1],u=this.webgl.getPad(a),l=this.webgl.getPad(s);o.uniform1i(o.getUniformLocation(this.inputTransformProgram,e.INPUT_ROWS_UNIFORM_NAME),i),o.uniform1i(o.getUniformLocation(this.inputTransformProgram,e.INPUT_COLS_UNIFORM_NAME),a),o.uniform1i(o.getUniformLocation(this.inputTransformProgram,e.OUTPUT_COLS_UNIFORM_NAME),s),o.uniform1i(o.getUniformLocation(this.inputTransformProgram,e.INPUT_COL_PAD_UNIFORM_NAME),u),o.uniform1i(o.getUniformLocation(this.inputTransformProgram,e.OUTPUT_COL_PAD_UNIFORM_NAME),l);}},{key:"_bindUniformsMain",value:function t(n,r,o){var i=this.webgl.context,a=r.shape[0],s=n.shape[1],u=this.webgl.getPad(s),l=this.webgl.getPad(a);i.uniform1i(i.getUniformLocation(this.mainProgram,e.INPUT_COLS_UNIFORM_NAME),s),i.uniform1i(i.getUniformLocation(this.mainProgram,e.OUTPUT_COLS_UNIFORM_NAME),a),i.uniform1i(i.getUniformLocation(this.mainProgram,e.INPUT_COL_PAD_UNIFORM_NAME),u),i.uniform1i(i.getUniformLocation(this.mainProgram,e.OUTPUT_COL_PAD_UNIFORM_NAME),l),"relu"===o&&i.uniform1i(i.getUniformLocation(this.mainProgram,e.RELU_ACTIVATION_UNIFORM_NAME),1);}},{key:"_bindOutputTextureInputTransform",value:function t(e,n){var r=e.shape[1],o=this.webgl.getPad(r);this.webgl.bindOutputTexture(e.shape[0],(r+o)/4,n.texture);}},{key:"_bindOutputTextureMain",value:function t(e,n,r){var o=e.shape[0],i=n.shape[0],a=this.webgl.getPad(i);this.webgl.bindOutputTexture(o,(i+a)/4,r.texture);}},{key:"transformInput",value:function t(e,n,r){if(n.shape[0]!==r.shape[0]||n.shape[1]!==r.shape[1])throw new Error("Invalid indexMappingRow or indexMappingCol weblas tensor shapes.");this.webgl.selectProgram(this.inputTransformProgram);var o=new weblas.pipeline.Tensor(n.shape,null);return this._bindInputTexturesInputTransform(e,n,r),this._bindUniformsInputTransform(e,n),this._bindOutputTextureInputTransform(n,o),this._compute(),this._unbindInputTextures(),o;}},{key:"call",value:function t(e,n,r,o,i,a){if(i&&a&&(e=this.transformInput(e,i,a)),e.shape[1]!==n.shape[1])throw new Error("Invalid input or weights weblas tensor shapes.");this.webgl.selectProgram(this.mainProgram);var s=e.shape[0],u=n.shape[0],l=new weblas.pipeline.Tensor([s,u],null);return this._bindInputTexturesMain(e,n,r),this._bindUniformsMain(e,n,o),this._bindOutputTextureMain(e,n,l),this._compute(),this._unbindInputTextures(),l;}}]),e;}(l.default);c.INPUT_TEXTURE_NAME="X",c.WEIGHTS_TEXTURE_NAME="W",c.BIAS_TEXTURE_NAME="b",c.INPUT_ROWS_UNIFORM_NAME="inputRows",c.INPUT_COLS_UNIFORM_NAME="inputCols",c.OUTPUT_COLS_UNIFORM_NAME="outputCols",c.INPUT_COL_PAD_UNIFORM_NAME="inputColPad",c.OUTPUT_COL_PAD_UNIFORM_NAME="outputColPad",c.RELU_ACTIVATION_UNIFORM_NAME="relu",c.IMAP_ROW_TEXTURE_NAME="indexMappingRow",c.IMAP_COL_TEXTURE_NAME="indexMappingCol",e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(68),l=r(u),c=function(t){function e(){o(this,e);var t=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.program=t.webgl.createProgram(n(630)),t;}return a(e,t),s(e,[{key:"_bindInputTextures",value:function t(n){var r=this.webgl.context;this.numTextures=1,this._bindInputTexture(this.program,n.texture,r.TEXTURE0,e.INPUT_TEXTURE_NAME);}},{key:"_bindUniforms",value:function t(n){var r=this.webgl.context;"relu"===n&&r.uniform1i(r.getUniformLocation(this.program,e.RELU_ACTIVATION_UNIFORM_NAME),1);}},{key:"_bindOutputTexture",value:function t(e,n){var r=this.webgl.getPad(e.shape[1]);this.webgl.bindOutputTexture(e.shape[0],(e.shape[1]+r)/4,n.texture);}},{key:"call",value:function t(e,n){this.webgl.selectProgram(this.program);var r=new weblas.pipeline.Tensor(e.shape,null);return this._bindInputTextures(e),this._bindUniforms(n),this._bindOutputTexture(e,r),this._compute(),this._unbindInputTextures(),r;}}]),e;}(l.default);c.INPUT_TEXTURE_NAME="X",c.RELU_ACTIVATION_UNIFORM_NAME="relu",e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(68),l=r(u),c=function(t){function e(){o(this,e);var t=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.program=t.webgl.createProgram(n(631)),t;}return a(e,t),s(e,[{key:"_bindInputTextures",value:function t(n,r,o,i,a){var s=this.webgl.context;this.numTextures=5,this._bindInputTexture(this.program,n.texture,s.TEXTURE0,e.INPUT_TEXTURE_NAME),this._bindInputTexture(this.program,i.texture,s.TEXTURE1,e.MEAN_TEXTURE_NAME),this._bindInputTexture(this.program,a.texture,s.TEXTURE2,e.STD_TEXTURE_NAME),this._bindInputTexture(this.program,r.texture,s.TEXTURE3,e.GAMMA_TEXTURE_NAME),this._bindInputTexture(this.program,o.texture,s.TEXTURE4,e.BETA_TEXTURE_NAME);}},{key:"_bindUniforms",value:function t(n,r){var o=this.webgl.context,i=this.webgl.getPad(n.shape[1]);o.uniform1f(o.getUniformLocation(this.program,e.EPSILON_UNIFORM_NAME),r),o.uniform1i(o.getUniformLocation(this.program,e.OUTPUT_COLS_UNIFORM_NAME),n.shape[1]),o.uniform1i(o.getUniformLocation(this.program,e.OUTPUT_COL_PAD_UNIFORM_NAME),i);}},{key:"_bindOutputTexture",value:function t(e,n){var r=this.webgl.getPad(e.shape[1]);this.webgl.bindOutputTexture(e.shape[0],(e.shape[1]+r)/4,n.texture);}},{key:"call",value:function t(e,n,r,o,i,a){this.webgl.selectProgram(this.program);var s=new weblas.pipeline.Tensor(e.shape,null);return this._bindInputTextures(e,r,o,i,a),this._bindUniforms(e,n),this._bindOutputTexture(e,s),this._compute(),this._unbindInputTextures(),s;}}]),e;}(l.default);c.INPUT_TEXTURE_NAME="X",c.MEAN_TEXTURE_NAME="mean",c.STD_TEXTURE_NAME="std",c.GAMMA_TEXTURE_NAME="gamma",c.BETA_TEXTURE_NAME="beta",c.EPSILON_UNIFORM_NAME="epsilon",c.OUTPUT_COLS_UNIFORM_NAME="outputCols",c.OUTPUT_COL_PAD_UNIFORM_NAME="outputColPad",e.default=c;},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function o(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.testUtils=e.layers=e.activations=e.Tensor=e.Model=void 0,n(203);var i=n(201),a=o(i),s=n(2),u=o(s),l=n(19),c=r(l),f=n(133),p=r(f),h=n(202),d=r(h);if("undefined"!=typeof window){var v=n(204);window.weblas=v;}e.Model=a.default,e.Tensor=u.default,e.activations=c,e.layers=p,e.testUtils=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(89),f=r(c),p=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="InputLayer";var r=t.shape,a=void 0===r?[]:r;return n.shape=t.batch_input_shape&&t.batch_input_shape.length?t.batch_input_shape.slice(1):a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){if(!(0,f.default)(e.tensor.shape,this.shape))throw new Error("[InputLayer] input tensor shape "+e.tensor.shape+" does not match specified shape "+this.shape+".");return e;}}]),e;}(l.default);e.default=p;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(35),f=r(c),p=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));h.call(n),n.layerClass="ELU";var r=t.alpha,a=void 0===r?1:r;return n.alpha=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){return this._compute(e.tensor,this.alpha),e;}}]),e;}(l.default),h=function t(){this._compute=(0,f.default)({args:["array","scalar"],body:function t(e,n){e=Math.max(e,0)+n*(Math.exp(Math.min(e,0))-1);}});};e.default=p;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(19),f=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="LeakyReLU";var r=t.alpha,a=void 0===r?.3:r;return n.alpha=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){return(0,c.relu)(e,{alpha:this.alpha}),e;}}]),e;}(l.default);e.default=f;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(35),f=r(c),p=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n._compute=(0,f.default)({args:["array","array"],body:function t(e,n){e=Math.max(e,0)+n*Math.min(e,0);}}),n.layerClass="PReLU",n.params=["alphas"],n;}return a(e,t),s(e,[{key:"call",value:function t(e){return this._compute(e.tensor,this.weights.alphas.tensor),e;}}]),e;}(l.default);e.default=p;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(35),f=r(c),p=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));h.call(n),n.layerClass="ThresholdedReLU";var r=t.theta,a=void 0===r?1:r;return n.theta=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){return this._compute(e.tensor,this.theta),e;}}]),e;}(l.default),h=function t(){this._compute=(0,f.default)({args:["array","scalar"],body:function t(e,n){e*=Number(e>n);}});};e.default=p;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.ThresholdedReLU=e.ELU=e.PReLU=e.LeakyReLU=void 0;var o=n(230),i=r(o),a=n(231),s=r(a),u=n(229),l=r(u),c=n(232),f=r(c);e.LeakyReLU=i.default,e.PReLU=s.default,e.ELU=l.default,e.ThresholdedReLU=f.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(96),f=r(c),p=n(625),h=r(p),d=n(92),v=r(d),_=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Conv1D";var r=t.filters,a=void 0===r?1:r,s=t.kernel_size,u=void 0===s?1:s,l=t.strides,c=void 0===l?1:l,p=t.padding,h=void 0===p?"valid":p,d=t.dilation_rate,v=void 0===d?1:d,_=t.activation,m=void 0===_?"linear":_,g=t.use_bias,y=void 0===g||g;if("valid"!==h&&"same"!==h)throw new Error(n.name+" [Conv1D layer] Invalid padding.");if(1!==v&&1!==c)throw new Error(n.name+" [Conv1D layer] Incompatible combination of dilation_rate with strides.");n.use_bias=y,n.params=n.use_bias?["kernel","bias"]:["kernel"];var b={filters:a,kernel_size:[u,1],strides:[c,1],padding:h,data_format:"channels_first",dilation_rate:v,activation:m,use_bias:y};return n._conv2dAttrs=b,n._conv2d=new f.default(Object.assign(b,{gpu:t.gpu})),n;}return a(e,t),s(e,[{key:"setWeights",value:function t(e){e[0].tensor=(0,v.default)(e[0].tensor).transpose(2,1,0,3),this._conv2d.setWeights(e);}},{key:"call",value:function t(e){e.tensor=(0,v.default)(e.tensor).transpose(0,2,1);var n=this._conv2d.call(e);return e.tensor=(0,h.default)(n.tensor).transpose(1,0,2),e;}}]),e;}(l.default);e.default=_;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),f=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},p=n(19),h=o(p),d=n(2),v=r(d),_=n(1),m=r(_),g=n(3),y=r(g),b=n(59),w=r(b),x=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var n=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Conv2DTranspose";var r=t.filters,o=void 0===r?1:r,u=t.kernel_size,l=void 0===u?[3,3]:u,c=t.strides,f=void 0===c?[1,1]:c,p=t.padding,d=void 0===p?"valid":p,v=t.data_format,_=void 0===v?"channels_last":v,m=t.activation,g=void 0===m?"linear":m,y=t.use_bias,b=void 0===y||y;if(Array.isArray(l)?n.kernelShape=[o].concat(i(l)):n.kernelShape=[o,l,l],Array.isArray(f)?n.strides=f:n.strides=[f,f],"valid"!==d&&"same"!==d)throw new Error(n.name+" [Conv2DTranspose layer] Invalid padding.");if(n.padding=d,"channels_last"!==_&&"channels_first"!==_)throw new Error(n.name+" [Conv2DTranspose layer] Only channels_last and channels_first data formats are allowed.");return n.dataFormat=_,n.activation=g,n.activationFunc=h[g],n.use_bias=b,n.params=n.use_bias?["kernel","bias"]:["kernel"],n.gpu&&weblas&&(n._useWeblas=!0,n._pipelineEnabled=!1),n;}return u(e,t),c(e,[{key:"setWeights",value:function t(n){"channels_first"===this.dataFormat&&(n[0].tensor=n[0].tensor.transpose(2,3,1,0)),f(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n),this._wRowsMat=this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat._gpuMaxSizeExceeded||(this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose()));}},{key:"_calcOutputShape",value:function t(e){var n=e[0],r=e[1],o=l(this.kernelShape,3),i=o[0],a=o[1],s=o[2],u="same"===this.padding?n*this.strides[0]:n*this.strides[0]+Math.max(a-this.strides[0],0),c="same"===this.padding?r*this.strides[1]:r*this.strides[1]+Math.max(s-this.strides[1],0),f=i,p="same"===this.padding?Math.max(0,Math.floor((n-1)*this.strides[0]+a-u)):0,h="same"===this.padding?Math.max(0,Math.floor((r-1)*this.strides[1]+s-c)):0,d=Math.floor(p/2),v=p-d,_=Math.floor(h/2),m=h-_;this.outputShape=[u,c,f],this.outputPadding=[d,v,_,m];}},{key:"_im2col",value:function t(e){for(var n=l(e.tensor.shape,3),r=n[0],o=n[1],i=n[2],a=new v.default([],[r*o,i]),s=new v.default([],[r*o]),u=new v.default([],[r,o]),c=0;c<i;c++){y.default.assign(u.tensor,e.tensor.pick(null,null,c)),s.replaceTensorData(u.tensor.data),y.default.assign(a.tensor.pick(null,c),s.tensor);}return a;}},{key:"_w2row",value:function t(){for(var e=l(this.weights.kernel.tensor.shape,4),n=e[0],r=e[1],o=e[2],i=e[3],a=new v.default([],[i,n*r*o]),s=new v.default([],[n*r*o]),u=new v.default([],[n,r,o]),c=0;c<i;c++){y.default.assign(u.tensor,this.weights.kernel.tensor.pick(null,null,null,c)),s.replaceTensorData(u.tensor.data),y.default.assign(a.tensor.pick(c,null),s.tensor);}return a;}},{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));var n=this._im2col(e);this._useWeblas&&n.createWeblasTensor();var r=e.tensor.shape[0],o=e.tensor.shape[1],i=l(this.kernelShape,3),a=i[0],s=i[1],u=i[2],c=new v.default([],[r*o,s*u*a]);if(!this._useWeblas||n._gpuMaxSizeExceeded||this._wRowsMat._gpuMaxSizeExceeded)(0,w.default)(c.tensor,n.tensor,this._wRowsMat.tensor,1,1);else{var f=new v.default([],[this.weights.kernel.tensor.shape[3]]);f.createWeblasTensor(),c.tensor.data=weblas.pipeline.sgemm(1,n.weblasTensor,this._wRowsMat.weblasTensor,0,f).transfer(),n.weblasTensor.delete(),delete n.weblasTensor;}this._calcOutputShape(e.tensor.shape);var p=l(this.outputPadding,4),h=p[0],d=p[1],_=p[2],m=p[3],g=new v.default([],this.outputShape),b=new v.default([],[this.outputShape[0]+h+d,this.outputShape[1]+_+m,this.outputShape[2]]);if(this.use_bias)for(var x=0;x<a;x++){y.default.assigns(b.tensor.pick(null,null,x),this.weights.bias.tensor.get(x));}for(var E=[s,u,a],T=new v.default([],E),O=new v.default([],[s*u*a]),P=0,j=0;j<r;j++){for(var A=0;A<o;A++){y.default.assign(O.tensor,c.tensor.pick(P,null)),T.replaceTensorData(O.tensor.data);var S=j*this.strides[0],M=A*this.strides[1];y.default.addeq(b.tensor.hi(S+s,M+u,this.outputShape[2]).lo(S,M,0),T.tensor),P+=1;}}return y.default.assign(g.tensor,b.tensor.hi(this.outputShape[0]+h,this.outputShape[1]+_,this.outputShape[2]).lo(h,_,0)),e.tensor=g.tensor,this.activationFunc(e),"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(2,0,1)),e;}}]),e;}(m.default);e.default=x;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),f=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},p=n(19),h=o(p),d=n(2),v=r(d),_=n(1),m=r(_),g=n(3),y=r(g),b=n(59),w=r(b),x=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var n=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Conv3D";var r=t.filters,o=void 0===r?1:r,u=t.kernel_size,l=void 0===u?[1,1,1]:u,c=t.strides,f=void 0===c?[1,1,1]:c,p=t.padding,d=void 0===p?"valid":p,v=t.data_format,_=void 0===v?"channels_last":v,m=t.dilation_rate,g=void 0===m?[1,1,1]:m,y=t.activation,b=void 0===y?"linear":y,w=t.use_bias,x=void 0===w||w;if(Array.isArray(l)?n.kernelShape=[o].concat(i(l)):n.kernelShape=[o,l,l,l],Array.isArray(f)?n.strides=f:n.strides=[f,f,f],"valid"!==d&&"same"!==d)throw new Error(n.name+" [Conv3D layer] Invalid padding.");if(n.padding=d,"channels_last"!==_&&"channels_first"!==_)throw new Error(n.name+" [Conv3D layer] Only channels_last and channels_first data formats are allowed.");if(n.dataFormat=_,Array.isArray(g)?n.dilationRate=g:n.dilationRate=[g,g,g],!(1===n.dilationRate[0]&&1===n.dilationRate[1]&&1===n.dilationRate[2]||1===n.strides[0]&&1===n.strides[1]&&1===n.strides[2]))throw new Error(n.name+" [Conv3D layer] Incompatible combination of dilation_rate with strides.");return n.activation=b,n.activationFunc=h[b],n.use_bias=x,n.params=n.use_bias?["kernel","bias"]:["kernel"],n.gpu&&weblas&&(n._useWeblas=!0,n._pipelineEnabled=!1),n;}return u(e,t),c(e,[{key:"setWeights",value:function t(n){"channels_first"===this.dataFormat&&(n[0].tensor=n[0].tensor.transpose(2,3,4,1,0)),f(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n),this._wRowsMat=this._w2row(),this._useWeblas&&(this._wRowsMat.createWeblasTensor(),this._wRowsMat._gpuMaxSizeExceeded||(this._wRowsMat.weblasTensor=this._wRowsMat.weblasTensor.transpose()),this.use_bias?this.weights.bias.createWeblasTensor():(this._zerosVec=new v.default([],[this.weights.kernel.tensor.shape[4]]),this._zerosVec.createWeblasTensor()));}},{key:"_calcOutputShape",value:function t(e){var n=e.tensor.shape[0],r=e.tensor.shape[1],o=e.tensor.shape[2],i=l(this.kernelShape,4),a=i[0],s=i[1],u=i[2],c=i[3],f=s+(s-1)*(this.dilationRate[0]-1),p=u+(u-1)*(this.dilationRate[1]-1),h=c+(c-1)*(this.dilationRate[2]-1),d="same"===this.padding?Math.floor((n+this.strides[0]-1)/this.strides[0]):Math.floor((n-f+this.strides[0])/this.strides[0]),v="same"===this.padding?Math.floor((r+this.strides[1]-1)/this.strides[1]):Math.floor((r-p+this.strides[1])/this.strides[1]),_="same"===this.padding?Math.floor((o+this.strides[2]-1)/this.strides[2]):Math.floor((o-h+this.strides[2])/this.strides[2]),m=a,g="same"===this.padding?Math.max(0,Math.floor((d-1)*this.strides[0]+f-n)):0,y="same"===this.padding?Math.max(0,Math.floor((v-1)*this.strides[1]+p-r)):0,b="same"===this.padding?Math.max(0,Math.floor((_-1)*this.strides[2]+h-o)):0,w=Math.floor(g/2),x=g-w,E=Math.floor(y/2),T=y-E,O=Math.floor(b/2),P=b-O;this.outputShape=[d,v,_,m],this.inputPadding=[w,x,E,T,O,P];}},{key:"_padInput",value:function t(e){if("same"===this.padding){var n=l(e.tensor.shape,4),r=n[0],o=n[1],i=n[2],a=n[3],s=l(this.inputPadding,6),u=s[0],c=s[1],f=s[2],p=s[3],h=s[4],d=s[5],_=r+u+c,m=o+f+p,g=i+h+d,b=new v.default([],[_,m,g,a]);y.default.assign(b.tensor.hi(r+u,o+f,i+h,a).lo(u,f,h,0),e.tensor),e.tensor=b.tensor;}return e;}},{key:"_vol2col",value:function t(e){var n=l(e.tensor.shape,4),r=n[0],o=n[1],i=n[2],a=n[3],s=this.kernelShape[1],u=this.kernelShape[2],c=this.kernelShape[3],f=this.outputShape[0],p=this.outputShape[1],h=this.outputShape[2],d=f*p*h,_=s*u*c*a,m=s+(s-1)*(this.dilationRate[0]-1),g=u+(u-1)*(this.dilationRate[1]-1),b=c+(c-1)*(this.dilationRate[2]-1);if(this._volColsMat||(this._volColsMat=new v.default([],[d,_])),1===m&&1===g&&1===b&&1===this.strides[0]&&1===this.strides[1]&&1===this.strides[2])return this._volColsMat.replaceTensorData(e.tensor.data),this._useWeblas&&this._volColsMat.createWeblasTensor(),this._volColsMat;for(var w=new v.default([],[s,u,c,a]),x=0,E=0,T=r-m;E<=T;E+=this.strides[0]){for(var O=0,P=o-g;O<=P;O+=this.strides[1]){for(var j=0,A=i-b;j<=A;j+=this.strides[2]){y.default.assign(w.tensor,e.tensor.hi(E+m,O+g,j+b,a).lo(E,O,j,0).step(this.dilationRate[0],this.dilationRate[1],this.dilationRate[2],1)),this._volColsMat.tensor.data.set(w.tensor.data,x),x+=_;}}}return this._useWeblas&&this._volColsMat.createWeblasTensor(),this._volColsMat;}},{key:"_w2row",value:function t(){for(var e=this.weights.kernel.tensor.shape[3],n=l(this.kernelShape,4),r=n[0],o=n[1],i=n[2],a=n[3],s=o*i*a*e,u=new v.default([],[s,r]),c=new v.default([],[o,i,a,e]),f=new v.default([],[s]),p=0;p<r;p++){y.default.assign(c.tensor,this.weights.kernel.tensor.pick(null,null,null,null,p)),f.replaceTensorData(c.tensor.data),y.default.assign(u.tensor.pick(null,p),f.tensor);}return u;}},{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0)),this._calcOutputShape(e),this._padInput(e),this._vol2col(e);var n=this.kernelShape[0],r=this.outputShape[0],o=this.outputShape[1],i=this.outputShape[2],a=r*o*i,s=new v.default([],[a,n]);if(!this._useWeblas||this._volColsMat._gpuMaxSizeExceeded||this._wRowsMat._gpuMaxSizeExceeded){if(this.use_bias)for(var u=0;u<n;u++){y.default.assigns(s.tensor.pick(null,u),this.weights.bias.tensor.get(u));}(0,w.default)(s.tensor,this._volColsMat.tensor,this._wRowsMat.tensor,1,1);}else{var l=this.use_bias?this.weights.bias.weblasTensor:this._zerosVec.weblasTensor;s.tensor.data=weblas.pipeline.sgemm(1,this._volColsMat.weblasTensor,this._wRowsMat.weblasTensor,1,l).transfer();}for(var c=new v.default([],this.outputShape),f=new v.default([],[r*o*i]),p=new v.default([],[r,o,i]),h=0;h<n;h++){y.default.assign(f.tensor,s.tensor.pick(null,h)),p.replaceTensorData(f.tensor.data),y.default.assign(c.tensor.pick(null,null,null,h),p.tensor);}return e.tensor=c.tensor,this.activationFunc(e),"th"===this.dataFormat&&(e.tensor=e.tensor.transpose(3,0,1,2)),e;}}]),e;}(m.default);e.default=x;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Cropping1D";var r=t.cropping,a=void 0===r?[0,0]:r;return Array.isArray(a)?n.cropping=a:n.cropping=[a,a],n;}return a(e,t),s(e,[{key:"call",value:function t(e){var n=e.tensor.shape,r=[n[0]-this.cropping[0]-this.cropping[1],n[1]],o=new f.default([],r);return h.default.assign(o.tensor,e.tensor.hi(n[0]-this.cropping[1],n[2]).lo(this.cropping[0],0)),e.tensor=o.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Cropping2D";var r=t.cropping,a=void 0===r?[[0,0],[0,0]]:r,s=t.data_format,u=void 0===s?"channels_last":s;return Array.isArray(a)?Array.isArray(a[0])?n.cropping=a:n.cropping=[[a[0],a[0]],[a[1],a[1]]]:n.cropping=[[a,a],[a,a]],n.dataFormat=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));var n=e.tensor.shape,r=[n[0]-this.cropping[0][0]-this.cropping[0][1],n[1]-this.cropping[1][0]-this.cropping[1][1],n[2]],o=new f.default([],r);return h.default.assign(o.tensor,e.tensor.hi(n[0]-this.cropping[0][1],n[1]-this.cropping[1][1],n[2]).lo(this.cropping[0][0],this.cropping[1][0],0)),e.tensor=o.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(2,0,1)),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Cropping3D";var r=t.cropping,a=void 0===r?[[0,0],[0,0],[0,0]]:r,s=t.data_format,u=void 0===s?"channels_last":s;return Array.isArray(a)?Array.isArray(a[0])?n.cropping=a:n.cropping=[[a[0],a[0]],[a[1],a[1]],[a[2],a[2]]]:n.cropping=[[a,a],[a,a],[a,a]],n.dataFormat=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0));var n=e.tensor.shape,r=[n[0]-this.cropping[0][0]-this.cropping[0][1],n[1]-this.cropping[1][0]-this.cropping[1][1],n[2]-this.cropping[2][0]-this.cropping[2][1],n[3]],o=new f.default([],r);return h.default.assign(o.tensor,e.tensor.hi(n[0]-this.cropping[0][1],n[1]-this.cropping[1][1],n[2]-this.cropping[2][1],n[3]).lo(this.cropping[0][0],this.cropping[1][0],this.cropping[2][0],0)),e.tensor=o.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(3,0,1,2)),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),f=n(19),p=o(f),h=n(2),d=r(h),v=n(1),_=r(v),m=n(96),g=r(m),y=n(3),b=r(y),w=n(59),x=r(w),E=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,e),s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));}return u(e,t),c(e,[{key:"_im2col",value:function t(e){var n=l(e.tensor.shape,3),r=n[0],o=n[1],i=n[2],a=this.kernelShape[1],s=this.kernelShape[2],u=this.outputShape[0],c=this.outputShape[1],f=u*c,p=a*s;this._imColsMat||(this._imColsMat=new d.default([],[f*i,p]));for(var h=new d.default([],[a,s,1]),v=0,_=0;_<i;_++){for(var m=0,g=r-a;m<=g;m+=this.strides[0]){for(var y=0,w=o-s;y<=w;y+=this.strides[1]){b.default.assign(h.tensor,e.tensor.hi(m+a,y+s,_+1).lo(m,y,_)),this._imColsMat.tensor.data.set(h.tensor.data,v),v+=p;}}}return this._useWeblas&&this._imColsMat.createWeblasTensor(),this._imColsMat;}},{key:"_w2row",value:function t(){var e=this.weights.kernel.tensor.shape[2],n=l(this.kernelShape,3),r=n[0],o=n[1],i=n[2],a=o*i;this._wRowsMat=new d.default([],[a,r*e]);for(var s=new d.default([],[o,i]),u=new d.default([],[a]),c=0,f=0;f<e;f++){for(var p=0;p<r;p++){b.default.assign(s.tensor,this.weights.kernel.tensor.pick(null,null,f,p)),u.replaceTensorData(s.tensor.data),b.default.assign(this._wRowsMat.tensor.pick(null,c),u.tensor),c+=1;}}return this._wRowsMat;}},{key:"call",value:function t(e){this._calcOutputShape(e.tensor.shape),this._padInput(e),this._im2col(e);var n=this.kernelShape[0],r=this.outputShape[0],o=this.outputShape[1],i=r*o,a=new d.default([],[i*e.tensor.shape[2],n*e.tensor.shape[2]]);!this._useWeblas||this._imColsMat._gpuMaxSizeExceeded||this._wRowsMat._gpuMaxSizeExceeded?(0,x.default)(a.tensor,this._imColsMat.tensor,this._wRowsMat.tensor,1,1):a.tensor.data=weblas.pipeline.sgemm(1,this._imColsMat.weblasTensor,this._wRowsMat.weblasTensor,1,this._zerosVec.weblasTensor).transfer();for(var s=new d.default([],[r,o,e.tensor.shape[2]*n]),u=r*o*e.tensor.shape[2]*n,l=new Float32Array(u),c=0;c<e.tensor.shape[2];c++){for(var f=0,p=c*u+c*n,h=(c+1)*u;p<h;f++,p+=n*e.tensor.shape[2]){for(var v=0;v<n;v++){l[p+v-c*u]=a.tensor.data[p+v];}}}return s.replaceTensorData(l),e.tensor=s.tensor,e;}}]),e;}(g.default),T=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e);var n=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="SeparableConv2D";var r=t.filters,o=void 0===r?1:r,u=t.kernel_size,l=void 0===u?[1,1]:u,c=t.strides,f=void 0===c?[1,1]:c,h=t.padding,d=void 0===h?"valid":h,v=t.data_format,_=void 0===v?"channels_last":v,m=t.depth_multiplier,g=void 0===m?1:m,y=t.activation,b=void 0===y?"linear":y,w=t.use_bias,x=void 0===w||w;if(Array.isArray(l)?n.kernelShape=[o].concat(i(l)):n.kernelShape=[o,l,l],Array.isArray(f)?n.strides=f:n.strides=[f,f],"valid"!==d&&"same"!==d)throw new Error(n.name+" [Conv2D layer] Invalid padding.");if(n.padding=d,"channels_last"!==_&&"channels_first"!==_)throw new Error(n.name+" [Conv2D layer] Only channels_last and channels_first data formats are allowed.");if(n.dataFormat=_,n.activation=b,n.activationFunc=p[b],"valid"!==d&&"same"!==d)throw new Error(n.name+" [SeparableConv2D layer] Invalid padding.");return n.padding=d,n.use_bias=x,n.params=n.use_bias?["depthwise_kernel","pointwise_kernel","bias"]:["depthwise_kernel","pointwise_kernel"],n.depthwiseConvAttrs={filters:g,kernel_size:[n.kernelShape[1],n.kernelShape[2]],strides:n.strides,padding:d,data_format:_,activation:"linear",use_bias:!1,gpu:t.gpu},n.pointwiseConvAttrs={filters:o,kernel_size:[1,1],strides:[1,1],padding:d,data_format:_,activation:"linear",use_bias:x,gpu:t.gpu},n;}return u(e,t),c(e,[{key:"setWeights",value:function t(e){this._depthwiseConv=new E(this.depthwiseConvAttrs),this._depthwiseConv.setWeights(e.slice(0,1)),this._pointwiseConv=new g.default(this.pointwiseConvAttrs),this._pointwiseConv.setWeights(e.slice(1,3));}},{key:"call",value:function t(e){var n=this._depthwiseConv.call(e),r=this._pointwiseConv.call(n);return e.tensor=r.tensor,this.activationFunc(e),e;}}]),e;}(_.default);e.default=T;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="UpSampling1D";var r=t.size,a=void 0===r?2:r;return n.size=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){for(var n=e.tensor.shape,r=[n[0]*this.size,n[1]],o=new f.default([],r),i=0;i<this.size;i++){h.default.assign(o.tensor.lo(i,0).step(this.size,1),e.tensor);}return e.tensor=o.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="UpSampling2D";var r=t.size,a=void 0===r?[2,2]:r,s=t.data_format,u=void 0===s?"channels_last":s;return Array.isArray(a)?n.size=a:n.size=[a,a],n.dataFormat=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));for(var n=e.tensor.shape,r=[n[0]*this.size[0],n[1]*this.size[1],n[2]],o=new f.default([],r),i=0;i<this.size[0];i++){for(var a=0;a<this.size[1];a++){h.default.assign(o.tensor.lo(i,a,0).step(this.size[0],this.size[1],1),e.tensor);}}return e.tensor=o.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(2,0,1)),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="UpSampling3D";var r=t.size,a=void 0===r?[2,2,2]:r,s=t.data_format,u=void 0===s?"channels_last":s;return Array.isArray(a)?n.size=a:n.size=[a,a,a],n.dataFormat=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0));for(var n=e.tensor.shape,r=[n[0]*this.size[0],n[1]*this.size[1],n[2]*this.size[2],n[3]],o=new f.default([],r),i=0;i<this.size[0];i++){for(var a=0;a<this.size[1];a++){for(var s=0;s<this.size[2];s++){h.default.assign(o.tensor.lo(i,a,s,0).step(this.size[0],this.size[1],this.size[2],1),e.tensor);}}}return e.tensor=o.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(3,0,1,2)),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="ZeroPadding1D";var r=t.padding,a=void 0===r?[1,1]:r;return Array.isArray(a)?n.padding=a:n.padding=[a,a],n;}return a(e,t),s(e,[{key:"call",value:function t(e){var n=e.tensor.shape,r=[n[0]+this.padding[0]+this.padding[1],n[1]],o=new f.default([],r);return h.default.assign(o.tensor.hi(n[0]+this.padding[0],n[1]).lo(this.padding[0],0),e.tensor),e.tensor=o.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="ZeroPadding2D";var r=t.padding,a=void 0===r?[[1,1],[1,1]]:r,s=t.data_format,u=void 0===s?"channels_last":s;return Array.isArray(a)?Array.isArray(a[0])?n.padding=a:n.padding=[[a[0],a[0]],[a[1],a[1]]]:n.padding=[[a,a],[a,a]],n.dataFormat=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));var n=e.tensor.shape,r=[n[0]+this.padding[0][0]+this.padding[0][1],n[1]+this.padding[1][0]+this.padding[1][1],n[2]],o=new f.default([],r);return h.default.assign(o.tensor.hi(n[0]+this.padding[0][0],n[1]+this.padding[1][0],n[2]).lo(this.padding[0][0],this.padding[1][0],0),e.tensor),e.tensor=o.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(2,0,1)),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="ZeroPadding3D";var r=t.padding,a=void 0===r?[[1,1],[1,1],[1,1]]:r,s=t.data_format,u=void 0===s?"channels_last":s;return Array.isArray(a)?Array.isArray(a[0])?n.padding=a:n.padding=[[a[0],a[0]],[a[1],a[1]],[a[2],a[2]]]:n.padding=[[a,a],[a,a],[a,a]],n.dataFormat=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0));var n=e.tensor.shape,r=[n[0]+this.padding[0][0]+this.padding[0][1],n[1]+this.padding[1][0]+this.padding[1][1],n[2]+this.padding[2][0]+this.padding[2][1],n[3]],o=new f.default([],r);return h.default.assign(o.tensor.hi(n[0]+this.padding[0][0],n[1]+this.padding[1][0],n[2]+this.padding[2][0],n[3]).lo(this.padding[0][0],this.padding[1][0],this.padding[2][0],0),e.tensor),e.tensor=o.tensor,"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(3,0,1,2)),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.ZeroPadding3D=e.ZeroPadding2D=e.ZeroPadding1D=e.UpSampling3D=e.UpSampling2D=e.UpSampling1D=e.Cropping3D=e.Cropping2D=e.Cropping1D=e.Conv3D=e.Conv2DTranspose=e.SeparableConv2D=e.Conv2D=e.Conv1D=void 0;var o=n(234),i=r(o),a=n(96),s=r(a),u=n(240),l=r(u),c=n(235),f=r(c),p=n(236),h=r(p),d=n(237),v=r(d),_=n(238),m=r(_),g=n(239),y=r(g),b=n(241),w=r(b),x=n(242),E=r(x),T=n(243),O=r(T),P=n(244),j=r(P),A=n(245),S=r(A),M=n(246),k=r(M);e.Conv1D=i.default,e.Conv2D=s.default,e.SeparableConv2D=l.default,e.Conv2DTranspose=f.default,e.Conv3D=h.default,e.Cropping1D=v.default,e.Cropping2D=m.default,e.Cropping3D=y.default,e.UpSampling1D=w.default,e.UpSampling2D=E.default,e.UpSampling3D=O.default,e.ZeroPadding1D=j.default,e.ZeroPadding2D=S.default,e.ZeroPadding3D=k.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(19),c=o(l),f=n(1),p=r(f),h=n(60),d=r(h),v=n(225),_=r(v),m=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Activation";var r=t.activation,o=void 0===r?"linear":r;if(n.activation=o,n.activationFunc=c[o],n.gpu&&weblas&&(n._useWeblas=!0,n.pipeline)){(0,d.default)(n.layerClass,t)?(n._pipelineEnabled=!0,n.webglActivation=new _.default()):n._pipelineEnabled=!1;}return n;}return s(e,t),u(e,[{key:"_callPipelineMode",value:function t(e){return e._fromPipeline?(e.weblasTensor=this.webglActivation.call(e.weblasTensor,this.activation),e):this._callRegularMode(e);}},{key:"_callRegularMode",value:function t(e){return this.activationFunc(e),e;}},{key:"call",value:function t(e){return this._pipelineEnabled?this._callPipelineMode(e):this._callRegularMode(e);}}]),e;}(p.default);e.default=m;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},c=n(19),f=o(c),p=n(2),h=r(p),d=n(1),v=r(d),_=n(58),m=n(3),g=r(m),y=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Dense";var r=t.units,o=void 0===r?1:r,s=t.activation,u=void 0===s?"linear":s,l=t.input_dim,c=void 0===l?null:l,p=t.use_bias,h=void 0===p||p;return n.activation=u,n.activationFunc=f[u],n.units=o,n.inputDim=c,n.use_bias=h,n.params=n.use_bias?["kernel","bias"]:["kernel"],n.inputDim&&(n.inputShape=[n.inputDim]),n.gpu&&weblas&&(n._useWeblas=!0,n._pipelineEnabled=!1),n;}return s(e,t),u(e,[{key:"setWeights",value:function t(n){l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n),this._useWeblas&&(this.weights.kernel.createWeblasTensor(),this.weights.kernel._gpuMaxSizeExceeded||(this.weights.kernel.weblasTensor=this.weights.kernel.weblasTensor.transpose()),this.use_bias?this.weights.bias.createWeblasTensor():(this._zerosVec=new h.default([],[this.weights.kernel.tensor.shape[1]]),this._zerosVec.createWeblasTensor()));}},{key:"call",value:function t(e){var n=new h.default([],[this.units]);if(this._useWeblas&&e.createWeblasTensor(),!this._useWeblas||e._gpuMaxSizeExceeded||this.weights.kernel._gpuMaxSizeExceeded)this.use_bias&&g.default.assign(n.tensor,this.weights.bias.tensor),(0,_.gemv)(1,this.weights.kernel.tensor.transpose(1,0),e.tensor,1,n.tensor);else{var r=this.use_bias?this.weights.bias.weblasTensor:this._zerosVec.weblasTensor;n.tensor.data=weblas.pipeline.sgemm(1,e.weblasTensor,this.weights.kernel.weblasTensor,1,r).transfer();}return e.tensor=n.tensor,this.activationFunc(e),e;}}]),e;}(v.default);e.default=y;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Dropout";var r=t.p,a=void 0===r?.5:r;return n.p=Math.min(Math.max(0,a),1),n;}return a(e,t),s(e,[{key:"call",value:function t(e){return e;}}]),e;}(l.default);e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(2),l=r(u),c=n(1),f=r(c),p=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="Flatten",n;}return a(e,t),s(e,[{key:"call",value:function t(e){if(e.tensor.shape.length>1){var n=new l.default([],[e.tensor.shape.reduce(function(t,e){return t*e;},1)]);n.replaceTensorData(e.tensor.data),e.tensor=n.tensor;}return e;}}]),e;}(f.default);e.default=p;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Permute";var r=t.dims,o=void 0===r?[]:r;return n.dims=o.map(function(t){return t-1;}),n;}return s(e,t),u(e,[{key:"call",value:function t(e){var n;if(this.dims.length!==e.tensor.shape.length)throw new Error(this.name+" [Permute layer] The specified dims permutation must match the number of dimensions.");return e.tensor=(n=e.tensor).transpose.apply(n,o(this.dims)),e;}}]),e;}(c.default);e.default=f;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(92),f=r(c),p=n(626),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="RepeatVector";var r=t.n,a=void 0===r?1:r;return n.n=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){if(1!==e.tensor.shape.length)throw new Error(this.name+" [RepeatVector layer] Only 1D tensor inputs allowed.");return e.tensor=(0,h.default)((0,f.default)(e.tensor,0),[this.n,1]),e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(2),l=r(u),c=n(1),f=r(c),p=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Reshape";var r=t.target_shape,a=void 0===r?[]:r;return n.targetShape=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){if(this.targetShape.reduce(function(t,e){return t*e;},1)!==e.tensor.size)throw new Error(this.name+" [Reshape layer] The total size of new array must be unchanged in reshape layer.");var n=new l.default([],this.targetShape);return n.replaceTensorData(e.tensor.data),e.tensor=n.tensor,e;}}]),e;}(f.default);e.default=p;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="SpatialDropout1D";var r=t.p,a=void 0===r?.5:r,s=t.dimOrdering,u=void 0===s?"tf":s;return n.p=Math.min(Math.max(0,a),1),n.dimOrdering=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){return e;}}]),e;}(l.default);e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="SpatialDropout2D";var r=t.p,a=void 0===r?.5:r,s=t.dimOrdering,u=void 0===s?"tf":s;return n.p=Math.min(Math.max(0,a),1),n.dimOrdering=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){return e;}}]),e;}(l.default);e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="SpatialDropout3D";var r=t.p,a=void 0===r?.5:r,s=t.dimOrdering,u=void 0===s?"tf":s;return n.p=Math.min(Math.max(0,a),1),n.dimOrdering=u,n;}return a(e,t),s(e,[{key:"call",value:function t(e){return e;}}]),e;}(l.default);e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.RepeatVector=e.Permute=e.Reshape=e.Flatten=e.SpatialDropout3D=e.SpatialDropout2D=e.SpatialDropout1D=e.Dropout=e.Activation=e.Dense=void 0;var o=n(249),i=r(o),a=n(248),s=r(a),u=n(250),l=r(u),c=n(255),f=r(c),p=n(256),h=r(p),d=n(257),v=r(d),_=n(251),m=r(_),g=n(254),y=r(g),b=n(252),w=r(b),x=n(253),E=r(x);e.Dense=i.default,e.Activation=s.default,e.Dropout=l.default,e.SpatialDropout1D=f.default,e.SpatialDropout2D=h.default,e.SpatialDropout3D=v.default,e.Flatten=m.default,e.Reshape=y.default,e.Permute=w.default,e.RepeatVector=E.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Embedding";var r=t.input_dim,a=void 0===r?1:r,s=t.output_dim,u=void 0===s?1:s,l=t.input_length,c=void 0===l?0:l,f=t.mask_zero,p=void 0!==f&&f;return n.inputDim=a,n.outputDim=u,n.inputLength=c,n.maskZero=p,n.params=["embeddings"],n;}return a(e,t),s(e,[{key:"call",value:function t(e){for(var n=new f.default([],[e.tensor.shape[0],this.weights.embeddings.tensor.shape[1]]),r=0,o=e.tensor.shape[0];r<o;r++){h.default.assign(n.tensor.pick(r,null),this.weights.embeddings.tensor.pick(e.tensor.get(r),null));}return e.tensor=n.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.Embedding=void 0;var o=n(259),i=r(o);e.Embedding=i.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(19),c=o(l),f=n(2),p=r(f),h=n(1),d=r(h),v=n(58),_=n(3),m=r(_),g=n(35),y=r(g),b=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n._computeOutput=(0,y.default)({args:["array","array","array"],body:function t(e,n,r){e=n*r+(1-r)*e;}}),n.layerClass="Highway";var r=t.activation,o=void 0===r?"linear":r,s=t.bias,u=void 0===s||s;return n.activation=o,n.activationFunc=c[o],n.bias=u,n.params=n.bias?["W","W_carry","b","b_carry"]:["W","W_carry"],n;}return s(e,t),u(e,[{key:"call",value:function t(e){var n=new p.default([],[this.weights.W.tensor.shape[1]]);this.bias&&m.default.assign(n.tensor,this.weights.b.tensor),(0,v.gemv)(1,this.weights.W.tensor.transpose(1,0),e.tensor,1,n.tensor),this.activationFunc(n);var r=new p.default([],[this.weights.W_carry.tensor.shape[1]]);return this.bias&&m.default.assign(r.tensor,this.weights.b_carry.tensor),(0,v.gemv)(1,this.weights.W_carry.tensor.transpose(1,0),e.tensor,1,r.tensor),c.sigmoid(r),this._computeOutput(e.tensor,n.tensor,r.tensor),e;}}]),e;}(d.default);e.default=b;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(2),l=r(u),c=n(1),f=r(c),p=n(58),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="MaxoutDense";var r=t.output_dim,a=void 0===r?1:r,s=t.input_dim,u=void 0===s?null:s,l=t.bias,c=void 0===l||l;return n.outputDim=a,n.inputDim=u,n.bias=c,n.params=n.bias?["W","b"]:["W"],n;}return a(e,t),s(e,[{key:"call",value:function t(e){for(var n=this.weights.W.tensor.shape[0],r=new l.default([],[this.outputDim]),o=0;o<n;o++){var i=new l.default([],[this.outputDim]);this.bias&&d.default.assign(i.tensor,this.weights.b.tensor.pick(o,null)),(0,p.gemv)(1,this.weights.W.tensor.pick(o,null,null).transpose(1,0),e.tensor,1,i.tensor),d.default.maxeq(r.tensor,i.tensor);}return e.tensor=r.tensor,e;}}]),e;}(f.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(2),l=r(u),c=n(1),f=r(c),p=n(59),h=r(p),d=n(3),v=r(d),_=n(92),m=r(_),g=n(197),y=r(g),b=n(89),w=r(b),x=n(194),E=r(x),T=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Merge";var r=t.mode,a=void 0===r?"sum":r,s=t.concat_axis,u=void 0===s?-1:s,l=t.dot_axes,c=void 0===l?-1:l;if(!(["sum","mul","concat","ave","cos","dot","max"].indexOf(a)>-1))throw new Error(n.name+" [Merge layer] "+a+" not available.");return n.mode=a,n.concatAxis=u<=0?u:u-1,Array.isArray(c)?n.dotAxes=[c[0]<=0?c[0]:c[0]-1,c[1]<=0?c[1]:c[1]-1]:n.dotAxes=[c<=0?c:c-1,c<=0?c:c-1],n;}return a(e,t),s(e,[{key:"_validateInputs",value:function t(e){var n=e.map(function(t){return t.tensor.shape.slice();});if(["sum","mul","ave","cos","max"].indexOf(this.mode)>-1&&!n.every(function(t){return(0,w.default)(t,n[0]);}))throw new Error(this.name+" [Merge layer] All input shapes must be the same for mode "+this.mode+".");if(["cos","dot"].indexOf(this.mode)>-1){if(2!==e.length)throw new Error(this.name+" [Merge layer] Exactly 2 inputs required for mode "+this.mode+".");if(this.dotAxes[0]<0&&(this.dotAxes[0]=n[0].length+this.dotAxes[0]),this.dotAxes[1]<0&&(this.dotAxes[1]=n[1].length+this.dotAxes[1]),n[0][this.dotAxes[0]]!==n[1][this.dotAxes[1]])throw new Error(this.name+" [Merge layer] Dimensions incompatibility using dot mode.");}else if("concat"===this.mode){var r=n.slice(),o=this.concatAxis<0?r[0].length+this.concatAxis:this.concatAxis;if(0===this.concatAxis&&(o=0),(0,E.default)(r.length).forEach(function(t){r[t].splice(o,1);}),!r.every(function(t){return(0,w.default)(t,r[0]);}))throw new Error(this.name+" [Merge layer] In concat mode, all shapes must be the same except along the concat axis.");}return!0;}},{key:"call",value:function t(e){if(!this._validateInputs(e))throw new Error(this.name+" [Merge layer] Invalid inputs to call method.");var n=void 0,r=void 0;if(["sum","mul","ave","max"].indexOf(this.mode)>-1)r=e[0].tensor.shape.slice(),n=new l.default([],r);else if("concat"===this.mode){r=e[0].tensor.shape.slice();var o=this.concatAxis<0?r.length+this.concatAxis:this.concatAxis;0===this.concatAxis&&(o=0),e.slice(1,e.length).forEach(function(t){var e=t.tensor.shape.slice()[o];r[o]+=e;}),n=new l.default([],r);}else if(["cos","dot"].indexOf(this.mode)>-1){var i=e[0].tensor.shape.slice(),a=e[1].tensor.shape.slice();i.splice(this.dotAxes[0],1),a.splice(this.dotAxes[1],1),r=i.concat(a),1===r.length&&r.push(1),n=new l.default([],r);}if("sum"===this.mode)for(var s=0;s<e.length;s++){v.default.addeq(n.tensor,e[s].tensor);}else if("mul"===this.mode){v.default.assigns(n.tensor,1);for(var u=0;u<e.length;u++){v.default.muleq(n.tensor,e[u].tensor);}}else if("ave"===this.mode){for(var c=0;c<e.length;c++){v.default.addeq(n.tensor,e[c].tensor);}v.default.divseq(n.tensor,e.length);}else if("max"===this.mode){v.default.assign(n.tensor,e[0].tensor);for(var f=1;f<e.length;f++){v.default.maxeq(n.tensor,e[f].tensor);}}else if("concat"===this.mode){var p=this.concatAxis<0?e[0].tensor.shape.length+this.concatAxis:this.concatAxis;if(0===this.concatAxis&&(p=0),0===p)(0,y.default)(n.tensor,e.map(function(t){return t.tensor;}));else{for(var d,_=[p],g=0;g<e[0].tensor.shape.length;g++){g!==p&&_.push(g);}(0,y.default)((d=n.tensor).transpose.apply(d,_),e.map(function(t){var e;return(e=t.tensor).transpose.apply(e,_);}));}}else if("dot"===this.mode){if(2!==e[0].tensor.shape.length||2!==e[1].tensor.shape.length)throw new Error(this.name+" [Merge layer] dot mode for 3+ dim tensors not yet implemented.");0===this.dotAxes[0]&&0===this.dotAxes[1]?(0,h.default)(n.tensor,e[0].tensor.transpose(1,0),e[1].tensor):1===this.dotAxes[0]&&1===this.dotAxes[1]&&(0,h.default)(n.tensor,e[0].tensor,e[1].tensor.transpose(1,0));}else if("cos"===this.mode){if(2!==e[0].tensor.shape.length||2!==e[1].tensor.shape.length)throw new Error(this.name+" [Merge layer] cos mode for 3+ dim tensors not yet implemented.");var b=new l.default([],n.tensor.shape),w=new l.default([],n.tensor.shape);0===this.dotAxes[0]&&0===this.dotAxes[1]?((0,h.default)(b.tensor,e[0].tensor.transpose(1,0),e[0].tensor),(0,h.default)(w.tensor,e[1].tensor.transpose(1,0),e[1].tensor),(0,h.default)(n.tensor,e[0].tensor.transpose(1,0),e[1].tensor)):1===this.dotAxes[0]&&1===this.dotAxes[1]&&((0,h.default)(b.tensor,e[0].tensor,e[0].tensor.transpose(1,0)),(0,h.default)(w.tensor,e[1].tensor,e[1].tensor.transpose(1,0)),(0,h.default)(n.tensor,e[0].tensor,e[1].tensor.transpose(1,0))),v.default.muleq(b.tensor,w.tensor),v.default.sqrteq(b.tensor),v.default.diveq(n.tensor,b.tensor),n.tensor=(0,m.default)(n.tensor,0);}return n;}}]),e;}(f.default);e.default=T;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.Highway=e.MaxoutDense=e.Merge=void 0;var o=n(263),i=r(o),a=n(262),s=r(a),u=n(261),l=r(u);e.Merge=i.default,e.MaxoutDense=s.default,e.Highway=l.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(51),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="Add",n.mode="sum",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(51),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="Average",n.mode="ave",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(51),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Concatenate",n.mode="concat";var r=t.axis,a=void 0===r?-1:r;return n.concatAxis=a<=0?a:a-1,n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(51),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Dot",n.mode="dot";var r=t.axes,a=void 0===r?-1:r,s=t.normalize,u=void 0!==s&&s;return Array.isArray(a)?n.dotAxes=[a[0]<=0?a[0]:a[0]-1,a[1]<=0?a[1]:a[1]-1]:n.dotAxes=[a<=0?a:a-1,a<=0?a:a-1],n.normalize=u,n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(51),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="Maximum",n.mode="max",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(51),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="Multiply",n.mode="mul",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.Dot=e.Concatenate=e.Maximum=e.Average=e.Multiply=e.Add=void 0;var o=n(265),i=r(o),a=n(270),s=r(a),u=n(266),l=r(u),c=n(269),f=r(c),p=n(267),h=r(p),d=n(268),v=r(d);e.Add=i.default,e.Multiply=s.default,e.Average=l.default,e.Maximum=f.default,e.Concatenate=h.default,e.Dot=v.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="GaussianDropout";var r=t.p,a=void 0===r?.5:r;return n.p=Math.min(Math.max(0,a),1),n;}return a(e,t),s(e,[{key:"call",value:function t(e){return e;}}]),e;}(l.default);e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="GaussianNoise";var r=t.sigma,a=void 0===r?0:r;return n;}return a(e,t),s(e,[{key:"call",value:function t(e){return e;}}]),e;}(l.default);e.default=c;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.GaussianNoise=e.GaussianDropout=void 0;var o=n(272),i=r(o),a=n(273),s=r(a);e.GaussianDropout=i.default,e.GaussianNoise=s.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=n(199),_=r(v),m=n(189),g=r(m),y=n(60),b=r(y),w=n(226),x=r(w),E=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="BatchNormalization";var r=t.epsilon,a=void 0===r?.001:r,s=t.axis,u=void 0===s?-1:s,l=t.center,c=void 0===l||l,f=t.scale,p=void 0===f||f;if(n.epsilon=a,n.center=c,n.scale=p,n.axis=u,n.axisNormalized=!1,n.params=[],n.scale&&n.params.push("gamma"),n.center&&n.params.push("beta"),n.params=n.params.concat(["moving_mean","moving_variance"]),n.gpu&&weblas&&(n._useWeblas=!0,n.pipeline)){(0,b.default)(n.layerClass,t)?(n._pipelineEnabled=!0,n.webglBatchNorm=new x.default()):n._pipelineEnabled=!1;}return n;}return a(e,t),s(e,[{key:"setWeights",value:function t(n){var r=this;u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n),this._useWeblas&&this.params.forEach(function(t){r.weights[t].createWeblasTensor();});}},{key:"_callPipelineMode",value:function t(e){return e._fromPipeline?(e.weblasTensor=this.webglBatchNorm.call(e.weblasTensor,this.epsilon,this.weights.gamma.weblasTensor,this.weights.beta.weblasTensor,this.weights.moving_mean.weblasTensor,this.weights.moving_variance.weblasTensor),e):this._callRegularMode(e);}},{key:"_callRegularMode",value:function t(e){this.axisNormalized||(this.axis=this.axis<0?e.tensor.shape.length+this.axis:this.axis-1,this.axisNormalized=!0);for(var n=[],r=0;r<e.tensor.shape.length;r++){r===this.axis?n.push(1):n.push(null);}for(var o=new p.default([],e.tensor.shape),i=new p.default([],e.tensor.shape),a=0;a<e.tensor.shape[this.axis];a++){if(n[this.axis]=a,this.scale){var s;d.default.assigns((s=o.tensor).pick.apply(s,n),this.weights.gamma.tensor.get(a));}if(this.center){var u;d.default.assigns((u=i.tensor).pick.apply(u,n),this.weights.beta.tensor.get(a));}}for(var l=new p.default([],e.tensor.shape),c=new p.default([],e.tensor.shape),f=0;f<e.tensor.shape[this.axis];f++){var h,v;n[this.axis]=f,d.default.assigns((h=l.tensor).pick.apply(h,n),this.weights.moving_mean.tensor.get(f)),d.default.assigns((v=c.tensor).pick.apply(v,n),this.weights.moving_variance.tensor.get(f)+this.epsilon);}return d.default.sqrteq(c.tensor),d.default.subeq(e.tensor,l.tensor),d.default.diveq(e.tensor,c.tensor),this.scale&&d.default.muleq(e.tensor,o.tensor),this.center&&d.default.addeq(e.tensor,i.tensor),e;}},{key:"call",value:function t(e){return this._pipelineEnabled?this._callPipelineMode(e):this._callRegularMode(e);}}]),e;}(c.default);e.default=E;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.BatchNormalization=void 0;var o=n(275),i=r(o);e.BatchNormalization=i.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(140),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="AveragePooling1D",n.poolingFunc="average",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(141),u=r(s),l=n(60),c=r(l),f=n(139),p=r(f),h=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));if(n.layerClass="AveragePooling2D",n.poolingFunc="average",n.gpu&&weblas&&(n._useWeblas=!0,n.pipeline)){(0,c.default)(n.layerClass,t)?(n._pipelineEnabled=!0,n.webglPooling2D=new p.default(n.poolingFunc)):n._pipelineEnabled=!1;}return n;}return a(e,t),e;}(u.default);e.default=h;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(142),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="AveragePooling3D",n.poolingFunc="average",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="GlobalAveragePooling1D",n;}return a(e,t),u(e,[{key:"call",value:function t(e){for(var n=s(e.tensor.shape,2),r=n[0],o=n[1],i=new p.default([],[o]),a=0,u=o;a<u;a++){i.tensor.set(a,d.default.sum(e.tensor.pick(null,a))/r);}return e.tensor=i.tensor,e;}}]),e;}(c.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="GlobalAveragePooling2D";var r=t.data_format,a=void 0===r?"channels_last":r;return n.dataFormat=a,n;}return a(e,t),u(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));for(var n=s(e.tensor.shape,3),r=n[0],o=n[1],i=n[2],a=new p.default([],[i]),u=0,l=i;u<l;u++){a.tensor.set(u,d.default.sum(e.tensor.pick(null,null,u))/(r*o));}return e.tensor=a.tensor,e;}}]),e;}(c.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0){}}catch(t){o=!0,i=t;}finally{try{!r&&a.return&&a.return();}finally{if(o)throw i;}}return n;}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");};}(),u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="GlobalAveragePooling3D";var r=t.data_format,a=void 0===r?"channels_last":r;return n.dataFormat=a,n;}return a(e,t),u(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0));for(var n=s(e.tensor.shape,4),r=n[0],o=n[1],i=n[2],a=n[3],u=new p.default([],[a]),l=0,c=a;l<c;l++){u.tensor.set(l,d.default.sum(e.tensor.pick(null,null,null,l))/(r*o*i));}return e.tensor=u.tensor,e;}}]),e;}(c.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="GlobalMaxPooling1D",n;}return a(e,t),s(e,[{key:"call",value:function t(e){for(var n=e.tensor.shape[1],r=new f.default([],[n]),o=0,i=n;o<i;o++){r.tensor.set(o,h.default.sup(e.tensor.pick(null,o)));}return e.tensor=r.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="GlobalMaxPooling2D";var r=t.data_format,a=void 0===r?"channels_last":r;return n.dataFormat=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,0));for(var n=e.tensor.shape[2],r=new f.default([],[n]),o=0,i=n;o<i;o++){r.tensor.set(o,h.default.sup(e.tensor.pick(null,null,o)));}return e.tensor=r.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),u=n(1),l=r(u),c=n(2),f=r(c),p=n(3),h=r(p),d=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="GlobalMaxPooling3D";var r=t.data_format,a=void 0===r?"channels_last":r;return n.dataFormat=a,n;}return a(e,t),s(e,[{key:"call",value:function t(e){"channels_first"===this.dataFormat&&(e.tensor=e.tensor.transpose(1,2,3,0));for(var n=e.tensor.shape[3],r=new f.default([],[n]),o=0,i=n;o<i;o++){r.tensor.set(o,h.default.sup(e.tensor.pick(null,null,null,o)));}return e.tensor=r.tensor,e;}}]),e;}(l.default);e.default=d;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(140),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="MaxPooling1D",n.poolingFunc="max",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(141),u=r(s),l=n(60),c=r(l),f=n(139),p=r(f),h=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));if(n.layerClass="MaxPooling2D",n.poolingFunc="max",n.gpu&&weblas&&(n._useWeblas=!0,n.pipeline)){(0,c.default)(n.layerClass,t)?(n._pipelineEnabled=!0,n.webglPooling2D=new p.default(n.poolingFunc)):n._pipelineEnabled=!1;}return n;}return a(e,t),e;}(u.default);e.default=h;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var s=n(142),u=r(s),l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.layerClass="MaxPooling3D",n.poolingFunc="max",n;}return a(e,t),e;}(u.default);e.default=l;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalAveragePooling3D=e.GlobalAveragePooling2D=e.GlobalAveragePooling1D=e.GlobalMaxPooling3D=e.GlobalMaxPooling2D=e.GlobalMaxPooling1D=e.AveragePooling3D=e.AveragePooling2D=e.AveragePooling1D=e.MaxPooling3D=e.MaxPooling2D=e.MaxPooling1D=void 0;var o=n(286),i=r(o),a=n(287),s=r(a),u=n(288),l=r(u),c=n(277),f=r(c),p=n(278),h=r(p),d=n(279),v=r(d),_=n(283),m=r(_),g=n(284),y=r(g),b=n(285),w=r(b),x=n(280),E=r(x),T=n(281),O=r(T),P=n(282),j=r(P);e.MaxPooling1D=i.default,e.MaxPooling2D=s.default,e.MaxPooling3D=l.default,e.AveragePooling1D=f.default,e.AveragePooling2D=h.default,e.AveragePooling3D=v.default,e.GlobalMaxPooling1D=m.default,e.GlobalMaxPooling2D=y.default,e.GlobalMaxPooling3D=w.default,e.GlobalAveragePooling1D=E.default,e.GlobalAveragePooling2D=O.default,e.GlobalAveragePooling3D=j.default;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},c=n(19),f=o(c),p=n(2),h=r(p),d=n(1),v=r(d),_=n(58),m=n(3),g=r(m),y=n(35),b=r(y),w=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n._combine=(0,b.default)({args:["array","array","array","array"],body:function t(e,n,r,o){e=n+r+o;}}),n._update=(0,b.default)({args:["array","array","array"],body:function t(e,n,r){e=e*(1-r)+n*r;}}),n.layerClass="GRU";var r=t.units,o=void 0===r?1:r,s=t.activation,u=void 0===s?"tanh":s,l=t.use_bias,c=void 0===l||l,p=t.recurrent_activation,h=void 0===p?"hard_sigmoid":p,d=t.return_sequences,v=void 0!==d&&d,_=t.go_backwards,m=void 0!==_&&_,g=t.stateful,y=void 0!==g&&g;return n.units=o,n.activation=u,n.recurrentActivation=h,n.activationFunc=f[u],n.recurrentActivationFunc=f[h],n.use_bias=c,n.returnSequences=v,n.goBackwards=m,n.stateful=y,n.params=n.use_bias?["kernel","recurrent_kernel","bias"]:["kernel","recurrent_kernel"],n;}return s(e,t),u(e,[{key:"setWeights",value:function t(n){l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n);var r=this.weights.kernel.tensor.shape;this.weights.W_z=new h.default([],[r[0],this.units]),this.weights.W_r=new h.default([],[r[0],this.units]),this.weights.W_h=new h.default([],[r[0],this.units]),g.default.assign(this.weights.W_z.tensor,this.weights.kernel.tensor.hi(r[0],this.units).lo(0,0)),g.default.assign(this.weights.W_r.tensor,this.weights.kernel.tensor.hi(r[0],2*this.units).lo(0,this.units)),g.default.assign(this.weights.W_h.tensor,this.weights.kernel.tensor.hi(r[0],3*this.units).lo(0,2*this.units));var o=this.weights.recurrent_kernel.tensor.shape;this.weights.U_z=new h.default([],[o[0],this.units]),this.weights.U_r=new h.default([],[o[0],this.units]),this.weights.U_h=new h.default([],[o[0],this.units]),g.default.assign(this.weights.U_z.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],this.units).lo(0,0)),g.default.assign(this.weights.U_r.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],2*this.units).lo(0,this.units)),g.default.assign(this.weights.U_h.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],3*this.units).lo(0,2*this.units)),this.weights.b_z=new h.default([],[this.units]),this.weights.b_r=new h.default([],[this.units]),this.weights.b_h=new h.default([],[this.units]),this.use_bias&&(g.default.assign(this.weights.b_z.tensor,this.weights.bias.tensor.hi(this.units).lo(0)),g.default.assign(this.weights.b_r.tensor,this.weights.bias.tensor.hi(2*this.units).lo(this.units)),g.default.assign(this.weights.b_h.tensor,this.weights.bias.tensor.hi(3*this.units).lo(2*this.units)));}},{key:"call",value:function t(e){var n=this,r=new h.default([],[e.tensor.shape[1]]),o=this.units,i=this.units,a=this.units,s=new h.default([],[o]),u=new h.default([],[o]),l=new h.default([],[o]),c=new h.default([],[i]),f=new h.default([],[i]),p=new h.default([],[i]),d=this.stateful&&this.currentHiddenState?this.currentHiddenState:new h.default([],[a]),v=new h.default([],[a]),m=new h.default([],[a]),y=new h.default([],[a]);this.hiddenStateSequence=new h.default([],[e.tensor.shape[0],a]);for(var b=function t(){[u,l,f,p,v,m].forEach(function(t){return g.default.assigns(t.tensor,0);});},w=function t(){g.default.assign(y.tensor,d.tensor),(0,_.gemv)(1,n.weights.W_z.tensor.transpose(1,0),r.tensor,1,u.tensor),(0,_.gemv)(1,n.weights.U_z.tensor.transpose(1,0),y.tensor,1,l.tensor),n._combine(s.tensor,u.tensor,l.tensor,n.weights.b_z.tensor),n.recurrentActivationFunc(s),(0,_.gemv)(1,n.weights.W_r.tensor.transpose(1,0),r.tensor,1,f.tensor),(0,_.gemv)(1,n.weights.U_r.tensor.transpose(1,0),y.tensor,1,p.tensor),n._combine(c.tensor,f.tensor,p.tensor,n.weights.b_r.tensor),n.recurrentActivationFunc(c),g.default.muleq(c.tensor,y.tensor),(0,_.gemv)(1,n.weights.W_h.tensor.transpose(1,0),r.tensor,1,v.tensor),(0,_.gemv)(1,n.weights.U_h.tensor.transpose(1,0),c.tensor,1,m.tensor),n._combine(d.tensor,v.tensor,m.tensor,n.weights.b_h.tensor),n.activationFunc(d),n._update(d.tensor,y.tensor,s.tensor);},x=0,E=e.tensor.shape[0];x<E;x++){var T=this.goBackwards?E-x-1:x;g.default.assign(r.tensor,e.tensor.pick(T,null)),b(),w(),this.returnSequences&&g.default.assign(this.hiddenStateSequence.tensor.pick(x,null),d.tensor);}return this.returnSequences?e.tensor=this.hiddenStateSequence.tensor:e.tensor=d.tensor,this.stateful&&(this.currentHiddenState=d),e;}}]),e;}(v.default);e.default=w;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},c=n(19),f=o(c),p=n(2),h=r(p),d=n(1),v=r(d),_=n(58),m=n(3),g=r(m),y=n(35),b=r(y),w=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n._combine=(0,b.default)({args:["array","array","array","array"],body:function t(e,n,r,o){e=n+r+o;}}),n._update=(0,b.default)({args:["array","array","array","array"],body:function t(e,n,r,o){e=e*r+n*o;}}),n.layerClass="LSTM";var r=t.units,o=void 0===r?1:r,s=t.activation,u=void 0===s?"tanh":s,l=t.use_bias,c=void 0===l||l,p=t.recurrent_activation,h=void 0===p?"hard_sigmoid":p,d=t.return_sequences,v=void 0!==d&&d,_=t.go_backwards,m=void 0!==_&&_,g=t.stateful,y=void 0!==g&&g;return n.units=o,n.activation=u,n.recurrentActivation=h,n.activationFunc=f[u],n.recurrentActivationFunc=f[h],n.use_bias=c,n.returnSequences=v,n.goBackwards=m,n.stateful=y,n.params=n.use_bias?["kernel","recurrent_kernel","bias"]:["kernel","recurrent_kernel"],n;}return s(e,t),u(e,[{key:"setWeights",value:function t(n){l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n);var r=this.weights.kernel.tensor.shape;this.weights.W_i=new h.default([],[r[0],this.units]),this.weights.W_f=new h.default([],[r[0],this.units]),this.weights.W_c=new h.default([],[r[0],this.units]),this.weights.W_o=new h.default([],[r[0],this.units]),g.default.assign(this.weights.W_i.tensor,this.weights.kernel.tensor.hi(r[0],this.units).lo(0,0)),g.default.assign(this.weights.W_f.tensor,this.weights.kernel.tensor.hi(r[0],2*this.units).lo(0,this.units)),g.default.assign(this.weights.W_c.tensor,this.weights.kernel.tensor.hi(r[0],3*this.units).lo(0,2*this.units)),g.default.assign(this.weights.W_o.tensor,this.weights.kernel.tensor.hi(r[0],4*this.units).lo(0,3*this.units));var o=this.weights.recurrent_kernel.tensor.shape;this.weights.U_i=new h.default([],[o[0],this.units]),this.weights.U_f=new h.default([],[o[0],this.units]),this.weights.U_c=new h.default([],[o[0],this.units]),this.weights.U_o=new h.default([],[o[0],this.units]),g.default.assign(this.weights.U_i.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],this.units).lo(0,0)),g.default.assign(this.weights.U_f.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],2*this.units).lo(0,this.units)),g.default.assign(this.weights.U_c.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],3*this.units).lo(0,2*this.units)),g.default.assign(this.weights.U_o.tensor,this.weights.recurrent_kernel.tensor.hi(o[0],4*this.units).lo(0,3*this.units)),this.weights.b_i=new h.default([],[this.units]),this.weights.b_f=new h.default([],[this.units]),this.weights.b_c=new h.default([],[this.units]),this.weights.b_o=new h.default([],[this.units]),this.use_bias&&(g.default.assign(this.weights.b_i.tensor,this.weights.bias.tensor.hi(this.units).lo(0)),g.default.assign(this.weights.b_f.tensor,this.weights.bias.tensor.hi(2*this.units).lo(this.units)),g.default.assign(this.weights.b_c.tensor,this.weights.bias.tensor.hi(3*this.units).lo(2*this.units)),g.default.assign(this.weights.b_o.tensor,this.weights.bias.tensor.hi(4*this.units).lo(3*this.units)));}},{key:"call",value:function t(e){var n=this,r=new h.default([],[e.tensor.shape[1]]),o=this.weights.b_i.tensor.shape[0],i=this.weights.b_c.tensor.shape[0],a=this.weights.b_f.tensor.shape[0],s=this.weights.b_o.tensor.shape[0],u=new h.default([],[o]),l=new h.default([],[o]),c=new h.default([],[o]),f=new h.default([],[a]),p=new h.default([],[a]),d=new h.default([],[a]),v=new h.default([],[s]),m=new h.default([],[s]),y=new h.default([],[s]),b=new h.default([],[i]),w=new h.default([],[i]),x=new h.default([],[i]),E=this.stateful&&this.previousCandidate?this.previousCandidate:new h.default([],[i]),T=this.stateful&&this.currentHiddenState?this.currentHiddenState:new h.default([],[i]),O=new h.default([],[i]);this.hiddenStateSequence=new h.default([],[e.tensor.shape[0],i]);for(var P=function t(){[l,c,p,d,m,y,w,x].forEach(function(t){return g.default.assigns(t.tensor,0);});},j=function t(){g.default.assign(O.tensor,T.tensor),(0,_.gemv)(1,n.weights.W_i.tensor.transpose(1,0),r.tensor,1,l.tensor),(0,_.gemv)(1,n.weights.U_i.tensor.transpose(1,0),O.tensor,1,c.tensor),n._combine(u.tensor,l.tensor,c.tensor,n.weights.b_i.tensor),n.recurrentActivationFunc(u),(0,_.gemv)(1,n.weights.W_f.tensor.transpose(1,0),r.tensor,1,p.tensor),(0,_.gemv)(1,n.weights.U_f.tensor.transpose(1,0),O.tensor,1,d.tensor),n._combine(f.tensor,p.tensor,d.tensor,n.weights.b_f.tensor),n.recurrentActivationFunc(f),(0,_.gemv)(1,n.weights.W_o.tensor.transpose(1,0),r.tensor,1,m.tensor),(0,_.gemv)(1,n.weights.U_o.tensor.transpose(1,0),O.tensor,1,y.tensor),n._combine(v.tensor,m.tensor,y.tensor,n.weights.b_o.tensor),n.recurrentActivationFunc(v),(0,_.gemv)(1,n.weights.W_c.tensor.transpose(1,0),r.tensor,1,w.tensor),(0,_.gemv)(1,n.weights.U_c.tensor.transpose(1,0),O.tensor,1,x.tensor),n._combine(b.tensor,w.tensor,x.tensor,n.weights.b_c.tensor),n.activationFunc(b),n._update(b.tensor,E.tensor,u.tensor,f.tensor),g.default.assign(E.tensor,b.tensor),n.activationFunc(b),g.default.mul(T.tensor,v.tensor,b.tensor);},A=0,S=e.tensor.shape[0];A<S;A++){var M=this.goBackwards?S-A-1:A;g.default.assign(r.tensor,e.tensor.pick(M,null)),P(),j(),g.default.assign(this.hiddenStateSequence.tensor.pick(A,null),T.tensor);}return this.returnSequences?e.tensor=this.hiddenStateSequence.tensor:e.tensor=T.tensor,this.stateful&&(this.previousCandidate=E,this.currentHiddenState=T),e;}}]),e;}(v.default);e.default=w;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r);}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r);},c=n(19),f=o(c),p=n(2),h=r(p),d=n(1),v=r(d),_=n(58),m=n(3),g=r(m),y=n(35),b=r(y),w=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n._combine=(0,b.default)({args:["array","array","array","array"],body:function t(e,n,r,o){e=n+r+o;}}),n.layerClass="SimpleRNN";var r=t.units,o=void 0===r?1:r,s=t.activation,u=void 0===s?"tanh":s,l=t.use_bias,c=void 0===l||l,p=t.return_sequences,h=void 0!==p&&p,d=t.go_backwards,v=void 0!==d&&d,_=t.stateful,m=void 0!==_&&_;return n.units=o,n.activation=u,n.activationFunc=f[u],n.use_bias=c,n.returnSequences=h,n.goBackwards=v,n.stateful=m,n.params=n.use_bias?["kernel","recurrent_kernel","bias"]:["kernel","recurrent_kernel"],n;}return s(e,t),u(e,[{key:"setWeights",value:function t(n){l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setWeights",this).call(this,n),this.use_bias||(this.weights.bias=new h.default([],[this.units]));}},{key:"call",value:function t(e){var n=this,r=new h.default([],[e.tensor.shape[1]]),o=this.units,i=this.stateful&&this.currentHiddenState?this.currentHiddenState:new h.default([],[o]),a=new h.default([],[o]),s=new h.default([],[o]),u=new h.default([],[o]);this.hiddenStateSequence=new h.default([],[e.tensor.shape[0],o]);for(var l=function t(){[a,s].forEach(function(t){return g.default.assigns(t.tensor,0);});},c=function t(){g.default.assign(u.tensor,i.tensor),(0,_.gemv)(1,n.weights.kernel.tensor.transpose(1,0),r.tensor,1,a.tensor),(0,_.gemv)(1,n.weights.recurrent_kernel.tensor.transpose(1,0),u.tensor,1,s.tensor),n._combine(i.tensor,a.tensor,s.tensor,n.weights.bias.tensor),n.activationFunc(i);},f=0,p=e.tensor.shape[0];f<p;f++){var d=this.goBackwards?p-f-1:f;g.default.assign(r.tensor,e.tensor.pick(d,null)),l(),c(),this.returnSequences&&g.default.assign(this.hiddenStateSequence.tensor.pick(f,null),i.tensor);}return this.returnSequences?e.tensor=this.hiddenStateSequence.tensor:e.tensor=i.tensor,this.stateful&&(this.currentHiddenState=i),e;}}]),e;}(v.default);e.default=w;},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t){Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);}return e.default=t,e;}function o(t){return t&&t.__esModule?t:{default:t};}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=o(l),f=n(2),p=o(f),h=n(3),d=o(h),v=n(590),_=o(v),m=n(143),g=r(m),y=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="Bidirectional";var r=t.layer,o=t.merge_mode,s=void 0===o?"concat":o;if(!r)throw new Error("[Bidirectional] wrapped layer is undefined.");n.forwardLayer=r;var u={units:n.forwardLayer.units,activation:n.forwardLayer.activation,recurrent_activation:n.forwardLayer.recurrentActivation,return_sequences:n.forwardLayer.returnSequences,go_backwards:!n.forwardLayer.goBackwards,stateful:n.forwardLayer.stateful};return n.backwardLayer=new g[r.layerClass](u),n.mergeMode=s,n;}return s(e,t),u(e,[{key:"setWeights",value:function t(e){this.forwardLayer.setWeights(e.slice(0,e.length/2)),this.backwardLayer.setWeights(e.slice(e.length/2));}},{key:"call",value:function t(e){var n=new p.default(e.tensor.data,e.tensor.shape),r=new p.default(e.tensor.data,e.tensor.shape),o=this.forwardLayer.call(n),i=this.backwardLayer.call(r);if("concat"===this.mergeMode){var a=o.tensor.shape.slice();a[a.length-1]+=i.tensor.shape[a.length-1];var s=new p.default([],a);this.forwardLayer.returnSequences?(d.default.assign(s.tensor.hi(a[0],o.tensor.shape[1]).lo(0,0),o.tensor),d.default.assign(s.tensor.hi(a[0],a[1]).lo(0,o.tensor.shape[1]),i.tensor.step(-1))):(d.default.assign(s.tensor.hi(o.tensor.shape[0]).lo(0),o.tensor),d.default.assign(s.tensor.hi(a[0]).lo(o.tensor.shape[0]),i.tensor)),e.tensor=s.tensor;}else if("sum"===this.mergeMode){var u=o.tensor.shape.slice(),l=new p.default([],u);d.default.addeq(l.tensor,o.tensor),d.default.addeq(l.tensor,i.tensor),e.tensor=l.tensor;}else if("mul"===this.mergeMode){var c=o.tensor.shape.slice(),f=new p.default([],c);d.default.assigns(f.tensor,1),d.default.muleq(f.tensor,o.tensor),d.default.muleq(f.tensor,i.tensor),e.tensor=f.tensor;}else if("ave"===this.mergeMode){var h=o.tensor.shape.slice(),v=new p.default([],h);d.default.addeq(v.tensor,o.tensor),d.default.addeq(v.tensor,i.tensor),d.default.divseq(v.tensor,2),e.tensor=v.tensor;}return e;}}]),e;}(c.default);e.default=y;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++){n[e]=t[e];}return n;}return Array.from(t);}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e?t:e;}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(typeof e==="undefined"?"undefined":_typeof(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e;};}(),l=n(1),c=r(l),f=n(2),p=r(f),h=n(3),d=r(h),v=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.layerClass="TimeDistributed";var r=t.layer;if(!r)throw new Error("[TimeDistributed] wrapped layer is undefined.");return n.layer=r,n;}return s(e,t),u(e,[{key:"setWeights",value:function t(e){this.layer.setWeights(e);}},{key:"call",value:function t(e){var n,r,i=[].concat(o(e.tensor.shape.slice(1))),a=new p.default([],i);d.default.assign(a.tensor,(n=e.tensor).pick.apply(n,[0].concat(o(i.map(function(t){return null;})))));var s=this.layer.call(a),u=s.tensor.shape.slice(),l=new p.default([],[e.tensor.shape[0]].concat(o(u)));d.default.assign((r=l.tensor).pick.apply(r,[0].concat(o(u.map(function(t){return null;})))),s.tensor);for(var c=1,f=e.tensor.shape[0];c<f;c++){var h,v,_=new p.default([],i);d.default.assign(_.tensor,(h=e.tensor).pick.apply(h,[c].concat(o(i.map(function(t){return null;}))))),s=this.layer.call(_),d.default.assign((v=l.tensor).pick.apply(v,[c].concat(o(u.map(function(t){return null;})))),s.tensor);}return e.tensor=l.tensor,e;}}]),e;}(c.default);e.default=v;},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t};}Object.defineProperty(e,"__esModule",{value:!0}),e.Bidirectional=e.TimeDistributed=void 0;var o=n(294),i=r(o),a=n(293),s=r(a);e.TimeDistributed=i.default,e.Bidirectional=s.default;},function(t,e,n){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0;}function o(t){return 3*t.length/4-r(t);}function i(t){var e,n,o,i,a,s,u=t.length;a=r(t),s=new f(3*u/4-a),o=a>0?u-4:u;var l=0;for(e=0,n=0;e<o;e+=4,n+=3){i=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],s[l++]=i>>16&255,s[l++]=i>>8&255,s[l++]=255&i;}return 2===a?(i=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[l++]=255&i):1===a&&(i=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[l++]=i>>8&255,s[l++]=255&i),s;}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t];}function s(t,e,n){for(var r,o=[],i=e;i<n;i+=3){r=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(a(r));}return o.join("");}function u(t){for(var e,n=t.length,r=n%3,o="",i=[],a=16383,u=0,c=n-r;u<c;u+=16383){i.push(s(t,u,u+16383>c?c:u+16383));}return 1===r?(e=t[n-1],o+=l[e>>2],o+=l[e<<4&63],o+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],o+=l[e>>10],o+=l[e>>4&63],o+=l[e<<2&63],o+="="),i.push(o),i.join("");}e.byteLength=o,e.toByteArray=i,e.fromByteArray=u;for(var l=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=p.length;h<d;++h){l[h]=p[h],c[p.charCodeAt(h)]=h;}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;},function(t,e,n){"use strict";"use restrict";function r(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e;}var o=32;e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(t){return(t>0)-(t<0);},e.abs=function(t){var e=t>>31;return(t^e)-e;},e.min=function(t,e){return e^(t^e)&-(t<e);},e.max=function(t,e){return t^(t^e)&-(t<e);},e.isPow2=function(t){return!(t&t-1||!t);},e.log2=function(t){var e,n;return e=(t>65535)<<4,t>>>=e,n=(t>255)<<3,t>>>=n,e|=n,n=(t>15)<<2,t>>>=n,e|=n,n=(t>3)<<1,t>>>=n,(e|=n)|t>>1;},e.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0;},e.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24;},e.countTrailingZeros=r,e.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1;},e.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1);},e.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1;};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,r=e,o=7;for(n>>>=1;n;n>>>=1){r<<=1,r|=1&n,--o;}t[e]=r<<o&255;}}(i),e.reverse=function(t){return i[255&t]<<24|i[t>>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255];},e.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1;},e.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16;},e.interleave3=function(t,e,n){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,n&=1023,n=4278190335&(n|n<<16),n=251719695&(n|n<<8),n=3272356035&(n|n<<4),n=1227133513&(n|n<<2),t|n<<2;},e.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22;},e.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>r(t)+1;};},function(t,e,n){(function(e,n,r){/* @preserve
	             * The MIT License (MIT)
	             * 
	             * Copyright (c) 2013-2017 Petka Antonov
	             * 
	             * Permission is hereby granted, free of charge, to any person obtaining a copy
	             * of this software and associated documentation files (the "Software"), to deal
	             * in the Software without restriction, including without limitation the rights
	             * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	             * copies of the Software, and to permit persons to whom the Software is
	             * furnished to do so, subject to the following conditions:
	             * 
	             * The above copyright notice and this permission notice shall be included in
	             * all copies or substantial portions of the Software.
	             * 
	             * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	             * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	             * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
	             * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	             * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	             * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	             * THE SOFTWARE.
	             * 
	             */!function(e){var n;t.exports=e();}(function(){var t,o,i;return function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l;}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n||t);},c,c.exports,t,e,n,r);}return n[a].exports;}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a<r.length;a++){o(r[a]);}return o;}({1:[function(t,e,n){"use strict";e.exports=function(t){function e(t){var e=new n(t),r=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),r;}var n=t._SomePromiseArray;t.any=function(t){return e(t);},t.prototype.any=function(){return e(this);};};},{}],2:[function(t,n,r){"use strict";function o(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new c(16),this._normalQueue=new c(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues();},this._schedule=l;}function i(t,e,n){this._lateQueue.push(t,e,n),this._queueTick();}function a(t,e,n){this._normalQueue.push(t,e,n),this._queueTick();}function s(t){this._normalQueue._pushOne(t),this._queueTick();}var u;try{throw new Error();}catch(t){u=t;}var l=t("./schedule"),c=t("./queue"),f=t("./util");o.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e;},o.prototype.hasCustomScheduler=function(){return this._customScheduler;},o.prototype.enableTrampoline=function(){this._trampolineEnabled=!0;},o.prototype.disableTrampolineIfNecessary=function(){f.hasDevTools&&(this._trampolineEnabled=!1);},o.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues;},o.prototype.fatalError=function(t,n){n?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t);},o.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function t(){throw e;}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e);},0);else try{this._schedule(function(){t(e);});}catch(t){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");}},f.hasDevTools?(o.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n);},100);});},o.prototype.invoke=function(t,e,n){this._trampolineEnabled?a.call(this,t,e,n):this._schedule(function(){t.call(e,n);});},o.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises();});}):(o.prototype.invokeLater=i,o.prototype.invoke=a,o.prototype.settlePromises=s),o.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r);}else e._settlePromises();}},o.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue);},o.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues));},o.prototype._reset=function(){this._isTickUsed=!1;},n.exports=o,n.exports.firstLineError=u;},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var o=!1,i=function i(t,e){this._reject(e);},a=function a(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(i,i,null,this,t);},s=function s(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target);},u=function u(t,e){e.promiseRejectionQueued||this._reject(t);};t.prototype.bind=function(i){o||(o=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(i),c=new t(e);c._propagateFrom(this,1);var f=this._target();if(c._setBoundTo(l),l instanceof t){var p={promiseRejectionQueued:!1,promise:c,target:f,bindingPromise:l};f._then(e,a,void 0,c,p),l._then(s,u,void 0,c,p),c._setOnCancel(l);}else c._resolveCallback(f);return c;},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField;},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField);},t.bind=function(e,n){return t.resolve(n).bind(e);};};},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===i&&(Promise=o);}catch(t){}return i;}var o;"undefined"!=typeof Promise&&(o=Promise);var i=t("./promise")();i.noConflict=r,e.exports=i;},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var o=r(null),i=r(null);o[" size"]=i[" size"]=0;}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var o="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(o);}return r;}function r(t){return n(t,this.pop()).apply(t,this);}function o(t){return t[this];}function i(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e];}var a=t("./util"),s=a.canEvaluate,u=a.isIdentifier,l,c,f,p,h;e.prototype.call=function(t){var e=[].slice.call(arguments,1),n;return e.push(t),this._then(r,void 0,void 0,e,void 0);},e.prototype.get=function(t){var e="number"==typeof t,n;if(e)n=i;else if(s){var r=c(t);n=null!==r?r:o;}else n=o;return this._then(n,void 0,void 0,t,void 0);};};},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,o){var i=t("./util"),a=i.tryCatch,s=i.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break;}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break;}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n;}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--;},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0;},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0));},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel();},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0));},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises();},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0;},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled();},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled();},e.prototype._doInvokeOnCancel=function(t,e){if(i.isArray(t))for(var n=0;n<t.length;++n){this._doInvokeOnCancel(t[n],e);}else if(void 0!==t)if("function"==typeof t){if(!e){var r=a(t).call(this._boundValue());r===s&&(this._attachExtraTrace(r.e),u.throwLater(r.e));}}else t._resultCancelled(this);},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,t);},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel());},e.prototype._resultCancelled=function(){this.cancel();};};},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){function n(t,n,s){return function(u){var l=s._boundValue();t:for(var c=0;c<t.length;++c){var f=t[c];if(f===Error||null!=f&&f.prototype instanceof Error){if(u instanceof f)return i(n).call(l,u);}else if("function"==typeof f){var p=i(f).call(l,u);if(p===a)return p;if(p)return i(n).call(l,u);}else if(r.isObject(u)){for(var h=o(f),d=0;d<h.length;++d){var v=h[d];if(f[v]!=u[v])continue t;}return i(n).call(l,u);}}return e;};}var r=t("./util"),o=t("./es5").keys,i=r.tryCatch,a=r.errorObj;return n;};},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){this._trace=new e.CapturedTrace(r());}function n(){if(o)return new e();}function r(){var t=i.length-1;if(t>=0)return i[t];}var o=!1,i=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null;},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace));},e.prototype._popContext=function(){if(void 0!==this._trace){var t=i.pop(),e=t._promiseCreated;return t._promiseCreated=null,e;}return null;},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,i=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=i,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,o=!1;},o=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this);};},e;};},{}],9:[function(t,n,r){"use strict";n.exports=function(n,r){function o(t,e){return{promise:e};}function i(){return!1;}function a(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+F.toString(t));r._attachCancellationCallback(t);});}catch(t){return t;}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?F.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t);}function u(){return this._onCancelField;}function l(t){this._onCancelField=t;}function c(){this._cancellationParent=void 0,this._onCancelField=void 0;}function f(t,e){if(0!=(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1;}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo);}function p(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo);}function h(){var t=this._boundTo;return void 0!==t&&t instanceof n?t.isFulfilled()?t.value():void 0:t;}function d(){this._trace=new C(this._peekContext());}function v(t,e){if(U(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=T(t);F.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),F.notEnumerableProp(t,"__stackCleaned__",!0);}}}function _(t,e,n,r,o){if(void 0===t&&null!==e&&$){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var i="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=x(s),l=u.length-1;l>=0;--l){var c=u[l];if(!V.test(c)){var f=c.match(X);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break;}}if(u.length>0)for(var p=u[0],l=0;l<s.length;++l){if(s[l]===p){l>0&&(a="\n"+s[l-1]);break;}}}var h="a promise was created in a "+n+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(h,!0,e);}}function m(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),g(n);}function g(t,e,r){if(at.warnings){var o=new N(t),i;if(e)r._attachExtraTrace(o);else if(at.longStackTraces&&(i=n._peekContext()))i.attachExtraTrace(o);else{var a=T(o);o.stack=a.message+"\n"+a.stack.join("\n");}et("warning",o)||O(o,"",!0);}}function y(t,e){for(var n=0;n<e.length-1;++n){e[n].push("From previous event:"),e[n]=e[n].join("\n");}return n<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n");}function b(t){for(var e=0;e<t.length;++e){(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--);}}function w(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],o=e.length-1,i=e[o],a=-1,s=r.length-1;s>=0;--s){if(r[s]===i){a=s;break;}}for(var s=a;s>=0;--s){var u=r[s];if(e[o]!==u)break;e.pop(),o--;}e=r;}}function x(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],o="    (No stack trace)"===r||z.test(r),i=o&&rt(r);o&&!i&&(G&&" "!==r.charAt(0)&&(r="    "+r),e.push(r));}return e;}function E(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if("    (No stack trace)"===r||z.test(r))break;}return n>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e;}function T(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?E(t):["    (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:x(e)};}function O(t,e,n){if("undefined"!=typeof console){var r;if(F.isObject(t)){var o=t.stack;r=e+W(o,t);}else r=e+String(t);"function"==typeof q?q(r,n):"function"!=typeof console.log&&"object"!=_typeof(console.log)||console.log(r);}}function P(t,e,n,r){var o=!1;try{"function"==typeof e&&(o=!0,"rejectionHandled"===t?e(r):e(n,r));}catch(t){I.throwLater(t);}"unhandledRejection"===t?et(t,n,r)||o||O(n,"Unhandled rejection "):et(t,r);}function j(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():F.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t);}catch(t){}0===e.length&&(e="(empty array)");}return"(<"+A(e)+">, no stack trace)";}function A(t){var e=41;return t.length<41?t:t.substr(0,38)+"...";}function S(){return"function"==typeof it;}function M(t){var e=t.match(ot);if(e)return{fileName:e[1],line:parseInt(e[2],10)};}function k(t,e){if(S()){for(var n=t.stack.split("\n"),r=e.stack.split("\n"),o=-1,i=-1,a,s,u=0;u<n.length;++u){var l=M(n[u]);if(l){a=l.fileName,o=l.line;break;}}for(var u=0;u<r.length;++u){var l=M(r[u]);if(l){s=l.fileName,i=l.line;break;}}o<0||i<0||!a||!s||a!==s||o>=i||(rt=function rt(t){if(B.test(t))return!0;var e=M(t);return!!(e&&e.fileName===a&&o<=e.line&&e.line<=i);});}}function C(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,C),e>32&&this.uncycle();}var R=n._getDomain,I=n._async,N=t("./errors").Warning,F=t("./util"),U=F.canAttachTrace,L,D,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,V=/\((?:timers\.js):\d+:\d+\)/,X=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,z=null,W=null,G=!1,q,H=!(0==F.env("BLUEBIRD_DEBUG")),Y=!(0==F.env("BLUEBIRD_WARNINGS")||!H&&!F.env("BLUEBIRD_WARNINGS")),K=!(0==F.env("BLUEBIRD_LONG_STACK_TRACES")||!H&&!F.env("BLUEBIRD_LONG_STACK_TRACES")),$=0!=F.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(Y||!!F.env("BLUEBIRD_W_FORGOTTEN_RETURN"));n.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288;},n.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0));},n.prototype._notifyUnhandledRejectionIsHandled=function(){P("rejectionHandled",L,void 0,this);},n.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField;},n.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField);},n.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),P("unhandledRejection",D,t,this);}},n.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField;},n.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField;},n.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0;},n.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField;},n.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled());},n.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0;},n.prototype._warn=function(t,e,n){return g(t,e,n||this);},n.onPossiblyUnhandledRejection=function(t){var e=R();D="function"==typeof t?null===e?t:F.domainBind(e,t):void 0;},n.onUnhandledRejectionHandled=function(t){var e=R();L="function"==typeof t?null===e?t:F.domainBind(e,t):void 0;};var Q=function Q(){};n.longStackTraces=function(){if(I.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");if(!at.longStackTraces&&S()){var t=n.prototype._captureStackTrace,e=n.prototype._attachExtraTrace;at.longStackTraces=!0,Q=function Q(){if(I.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");n.prototype._captureStackTrace=t,n.prototype._attachExtraTrace=e,r.deactivateLongStackTraces(),I.enableTrampoline(),at.longStackTraces=!1;},n.prototype._captureStackTrace=d,n.prototype._attachExtraTrace=v,r.activateLongStackTraces(),I.disableTrampolineIfNecessary();}},n.hasLongStackTraces=function(){return at.longStackTraces&&S();};var Z=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return F.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!F.global.dispatchEvent(n);};}if("function"==typeof Event){var t=new Event("CustomEvent");return F.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!F.global.dispatchEvent(n);};}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),F.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!F.global.dispatchEvent(n);};}catch(t){}return function(){return!1;};}(),J=function(){return F.isNode?function(){return e.emit.apply(e,arguments);}:F.global?function(t){var e="on"+t.toLowerCase(),n=F.global[e];return!!n&&(n.apply(F.global,[].slice.call(arguments,1)),!0);}:function(){return!1;};}(),tt={promiseCreated:o,promiseFulfilled:o,promiseRejected:o,promiseResolved:o,promiseCancelled:o,promiseChained:function promiseChained(t,e,n){return{promise:e,child:n};},warning:function warning(t,e){return{warning:e};},unhandledRejection:function unhandledRejection(t,e,n){return{reason:e,promise:n};},rejectionHandled:o},et=function et(t){var e=!1;try{e=J.apply(null,arguments);}catch(t){I.throwLater(t),e=!0;}var n=!1;try{n=Z(t,tt[t].apply(null,arguments));}catch(t){I.throwLater(t),n=!0;}return n||e;};n.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?n.longStackTraces():!t.longStackTraces&&n.hasLongStackTraces()&&Q()),"warnings"in t){var e=t.warnings;at.warnings=!!e,$=at.warnings,F.isObject(e)&&"wForgottenReturn"in e&&($=!!e.wForgottenReturn);}if("cancellation"in t&&t.cancellation&&!at.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");n.prototype._clearCancellationData=c,n.prototype._propagateFrom=f,n.prototype._onCancel=u,n.prototype._setOnCancel=l,n.prototype._attachCancellationCallback=s,n.prototype._execute=a,nt=f,at.cancellation=!0;}return"monitoring"in t&&(t.monitoring&&!at.monitoring?(at.monitoring=!0,n.prototype._fireEvent=et):!t.monitoring&&at.monitoring&&(at.monitoring=!1,n.prototype._fireEvent=i)),n;},n.prototype._fireEvent=i,n.prototype._execute=function(t,e,n){try{t(e,n);}catch(t){return t;}},n.prototype._onCancel=function(){},n.prototype._setOnCancel=function(t){},n.prototype._attachCancellationCallback=function(t){},n.prototype._captureStackTrace=function(){},n.prototype._attachExtraTrace=function(){},n.prototype._clearCancellationData=function(){},n.prototype._propagateFrom=function(t,e){};var nt=p,rt=function rt(){return!1;},ot=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;F.inherits(C,Error),r.CapturedTrace=C,C.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},r=0,o=this;void 0!==o;++r){e.push(o),o=o._parent;}t=this._length=r;for(var r=t-1;r>=0;--r){var i=e[r].stack;void 0===n[i]&&(n[i]=r);}for(var r=0;r<t;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var u=r>0?e[r-1]:this;s<t-1?(u._parent=e[s+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var l=u._length+1,c=r-2;c>=0;--c){e[c]._length=l,l++;}return;}}}},C.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=T(t),n=e.message,r=[e.stack],o=this;void 0!==o;){r.push(x(o.stack.split("\n"))),o=o._parent;}w(r),b(r),F.notEnumerableProp(t,"stack",y(n,r)),F.notEnumerableProp(t,"__stackCleaned__",!0);}};var it=function t(){var e=/^\s*at\s*/,n=function n(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():j(e);};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,z=/^\s*at\s*/,W=n;var r=Error.captureStackTrace;return rt=function rt(t){return B.test(t);},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6;};}var o=new Error();if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return z=/@/,W=n,G=!0,function t(e){e.stack=new Error().stack;};var i;try{throw new Error();}catch(t){i="stack"in t;}return"stack"in o||!i||"number"!=typeof Error.stackTraceLimit?(W=function W(t,e){return"string"==typeof t?t:"object"!=(typeof e==="undefined"?"undefined":_typeof(e))&&"function"!=typeof e||void 0===e.name||void 0===e.message?j(e):e.toString();},null):(z=/^\s*at\s*/,W=n,function t(e){Error.stackTraceLimit+=6;try{throw new Error();}catch(t){e.stack=t.stack;}Error.stackTraceLimit-=6;});}([]);"undefined"!=typeof console&&void 0!==console.warn&&(q=function q(t){console.warn(t);},F.isNode&&e.stderr.isTTY?q=function q(t,e){var n=e?"[33m":"[31m";console.warn(n+t+"[0m\n");}:F.isNode||"string"!=typeof new Error().stack||(q=function q(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red");}));var at={warnings:Y,longStackTraces:!1,cancellation:!1,monitoring:!1};return K&&n.longStackTraces(),{longStackTraces:function longStackTraces(){return at.longStackTraces;},warnings:function warnings(){return at.warnings;},cancellation:function cancellation(){return at.cancellation;},monitoring:function monitoring(){return at.monitoring;},propagateFromFunction:function propagateFromFunction(){return nt;},boundValueFunction:function boundValueFunction(){return h;},checkForgottenReturns:_,setBounds:k,warn:g,deprecated:m,CapturedTrace:C,fireDomEvent:Z,fireGlobalEvent:J};};},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value;}function n(){throw this.reason;}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0);},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0);},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function r(){throw e;};return this.caught(t,r);},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var o=function o(){return r;};return this.caught(n,o);};};},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return i(this);}function r(t,n){return o(t,n,e,e);}var o=t.reduce,i=t.all;t.prototype.each=function(t){return o(this,t,e,0)._then(n,void 0,void 0,this,void 0);},t.prototype.mapSeries=function(t){return o(this,t,e,e);},t.each=function(t,r){return o(t,r,e,0)._then(n,void 0,void 0,t,void 0);},t.mapSeries=r;};},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){if(!(this instanceof n))return new n(r);l(this,"message","string"==typeof r?r:e),l(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this);}return u(n,Error),n;}function o(t){if(!(this instanceof o))return new o(t);l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}var i=t("./es5"),a=i.freeze,s=t("./util"),u=s.inherits,l=s.notEnumerableProp,c,f,p=r("Warning","warning"),h=r("CancellationError","cancellation error"),d=r("TimeoutError","timeout error"),v=r("AggregateError","aggregate error");try{c=TypeError,f=RangeError;}catch(t){c=r("TypeError","type error"),f=r("RangeError","range error");}for(var _="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m<_.length;++m){"function"==typeof Array.prototype[_[m]]&&(v.prototype[_[m]]=Array.prototype[_[m]]);}i.defineProperty(v.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),v.prototype.isOperational=!0;var g=0;v.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",o=r.split("\n"),i=0;i<o.length;++i){o[i]=t+o[i];}r=o.join("\n"),e+=r+"\n";}return g--,e;},u(o,Error);var y=Error.__BluebirdErrorTypes__;y||(y=a({CancellationError:h,TimeoutError:d,OperationalError:o,RejectionError:o,AggregateError:v}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:y,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:c,RangeError:f,CancellationError:y.CancellationError,OperationalError:y.OperationalError,TimeoutError:y.TimeoutError,AggregateError:y.AggregateError,Warning:p};},{"./es5":13,"./util":36}],13:[function(t,e,n){var r=function(){"use strict";return void 0===this;}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function propertyIsWritable(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set);}};else{var o={}.hasOwnProperty,i={}.toString,a={}.constructor.prototype,s=function s(t){var e=[];for(var n in t){o.call(t,n)&&e.push(n);}return e;},u=function u(t,e){return{value:t[e]};},l=function l(t,e,n){return t[e]=n.value,t;},c=function c(t){return t;},f=function f(t){try{return Object(t).constructor.prototype;}catch(t){return a;}},p=function p(t){try{return"[object Array]"===i.call(t);}catch(t){return!1;}};e.exports={isArray:p,keys:s,names:s,defineProperty:l,getDescriptor:u,freeze:c,getPrototypeOf:f,isES5:r,propertyIsWritable:function propertyIsWritable(){return!0;}};}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e);},t.filter=function(t,r,o){return n(t,r,o,e);};};},{}],15:[function(t,e,n){"use strict";e.exports=function(e,n,r){function o(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null;}function i(t){this.finallyHandler=t;}function a(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0);}function s(){return l.call(this,this.promise._target()._settledValue());}function u(t){if(!a(this,t))return p.e=t,p;}function l(t){var o=this.promise,l=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?l.call(o._boundValue()):l.call(o._boundValue(),t);if(c===r)return c;if(void 0!==c){o._setReturnedNonUndefined();var h=n(c,o);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var d=new f("late cancellation observer");return o._attachExtraTrace(d),p.e=d,p;}h.isPending()&&h._attachCancellationCallback(new i(this));}return h._then(s,u,void 0,this,void 0);}}}return o.isRejected()?(a(this),p.e=t,p):(a(this),t);}var c=t("./util"),f=e.CancellationError,p=c.errorObj,h=t("./catch_filter")(r);return o.prototype.isFinallyHandler=function(){return 0===this.type;},i.prototype._resultCancelled=function(){a(this.finallyHandler);},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new o(this,e,t),void 0);},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,l,l);},e.prototype.tap=function(t){return this._passThrough(t,1,l);},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,l);var r=new Array(n-1),o=0,i;for(i=0;i<n-1;++i){var a=arguments[i];if(!c.isObject(a))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+c.classString(a)));r[o++]=a;}r.length=o;var s=arguments[i];return this._passThrough(h(r,s,this),1,void 0,l);},o;};},{"./catch_filter":7,"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i,a){function s(t,n,r){for(var i=0;i<n.length;++i){r._pushContext();var a=h(n[i])(t);if(r._popContext(),a===p){r._pushContext();var s=e.reject(p.e);return r._popContext(),s;}var u=o(a,r);if(u instanceof e)return u;}return null;}function u(t,n,o,i){if(a.cancellation()){var s=new e(r),u=this._finallyPromise=new e(r);this._promise=s.lastly(function(){return u;}),s._captureStackTrace(),s._setOnCancel(this);}else{(this._promise=new e(r))._captureStackTrace();}this._stack=i,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(d):d,this._yieldedPromise=null,this._cancellationPhase=!1;}var l=t("./errors"),c=l.TypeError,f=t("./util"),p=f.errorObj,h=f.tryCatch,d=[];f.inherits(u,i),u.prototype._isResolved=function(){return null===this._promise;},u.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null);},u.prototype._promiseCancelled=function(){if(!this._isResolved()){var t=void 0!==this._generator.return,n;if(t)this._promise._pushContext(),n=h(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),n=h(this._generator.throw).call(this._generator,r),this._promise._popContext();}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(n);}},u.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e);},u.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e);},u.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel();}},u.prototype.promise=function(){return this._promise;},u.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0);},u.prototype._continue=function(t){var n=this._promise;if(t===p)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);var r=t.value;if(!0===t.done)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var i=o(r,this._promise);if(!(i instanceof e)&&null===(i=s(i,this._yieldHandlers,this._promise)))return void this._promiseRejected(new c("A value %s was yielded that could not be treated as a promise\n\n    See http://goo.gl/MqrFmX\n\n".replace("%s",String(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));i=i._target();var a=i._bitField;0==(50397184&a)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&a)?e._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?e._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled();},e.coroutine=function(t,e){if("function"!=typeof t)throw new c("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var n=Object(e).yieldHandler,r=u,o=new Error().stack;return function(){var e=t.apply(this,arguments),i=new r(void 0,void 0,n,o),a=i.promise();return i._generator=e,i._promiseFulfilled(void 0),a;};},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new c("expecting a function but got "+f.classString(t));d.push(t);},e.spawn=function(t){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return n("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var r=new u(t,this),o=r.promise();return r._run(e.spawn),o;};};},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i,a){var s=t("./util"),u=s.canEvaluate,l=s.tryCatch,c=s.errorObj,f,p,h,d,v,_,m,g;e.join=function(){var t=arguments.length-1,e;if(t>0&&"function"==typeof arguments[t]){e=arguments[t];var r,o,i,a,s,u,l,c;}var f=[].slice.call(arguments);e&&f.pop();var r=new n(f).promise();return void 0!==e?r.spread(e):r;};};},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i,a){function s(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var o=l();this._callback=null===o?e:c.domainBind(o,e),this._preservedValues=r===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0);}function u(t,n,o,i){if("function"!=typeof n)return r("expecting a function but got "+c.classString(n));var a=0;if(void 0!==o){if("object"!=(typeof o==="undefined"?"undefined":_typeof(o))||null===o)return e.reject(new TypeError("options argument must be an object but it is "+c.classString(o)));if("number"!=typeof o.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+c.classString(o.concurrency)));a=o.concurrency;}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(t,n,a,i).promise();}var l=e._getDomain,c=t("./util"),f=c.tryCatch,p=c.errorObj,h=e._async;c.inherits(s,n),s.prototype._asyncInit=function(){this._init$(void 0,-2);},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,n){var r=this._values,i=this.length(),s=this._preservedValues,u=this._limit;if(n<0){if(n=-1*n-1,r[n]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0;}else{if(u>=1&&this._inFlight>=u)return r[n]=t,this._queue.push(n),!1;null!==s&&(s[n]=t);var l=this._promise,c=this._callback,h=l._boundValue();l._pushContext();var d=f(c).call(h,t,n,i),v=l._popContext();if(a.checkForgottenReturns(d,v,null!==s?"Promise.filter":"Promise.map",l),d===p)return this._reject(d.e),!0;var _=o(d,this._promise);if(_ instanceof e){_=_._target();var m=_._bitField;if(0==(50397184&m))return u>=1&&this._inFlight++,r[n]=_,_._proxy(this,-1*(n+1)),!1;if(0==(33554432&m))return 0!=(16777216&m)?(this._reject(_._reason()),!0):(this._cancel(),!0);d=_._value();}r[n]=d;}return++this._totalResolved>=i&&(null!==s?this._filter(r,s):this._resolve(r),!0);},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r);}},s.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),o=0,i=0;i<n;++i){t[i]&&(r[o++]=e[i]);}r.length=o,this._resolve(r);},s.prototype.preservedValues=function(){return this._preservedValues;},e.prototype.map=function(t,e){return u(this,t,e,null);},e.map=function(t,e,n,r){return u(t,e,n,r);};};},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i){var a=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var o=s(t).apply(this,arguments),a=r._popContext();return i.checkForgottenReturns(o,a,"Promise.method",r),r._resolveFromSyncValue(o),r;};},e.attempt=e.try=function(t){if("function"!=typeof t)return o("expecting a function but got "+a.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var u;if(arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];u=a.isArray(l)?s(t).apply(c,l):s(t).call(c,l);}else u=s(t)();var f=r._popContext();return i.checkForgottenReturns(u,f,"Promise.try",r),r._resolveFromSyncValue(u),r;},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0);};};},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&c.getPrototypeOf(t)===Error.prototype;}function o(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=c.keys(t),o=0;o<n.length;++o){var i=n[o];f.test(i)||(e[i]=t[i]);}return e;}return a.markAsOriginatingFromRejection(t),t;}function i(t,e){return function(n,r){if(null!==t){if(n){var i=o(s(n));t._attachExtraTrace(i),t._reject(i);}else if(e){var a=[].slice.call(arguments,1);t._fulfill(a);}else t._fulfill(r);t=null;}};}var a=t("./util"),s=a.maybeWrapAsError,u=t("./errors"),l=u.OperationalError,c=t("./es5"),f=/^(?:name|message|stack|cause)$/;e.exports=i;},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,n){"use strict";e.exports=function(e){function n(t,e){var n=this;if(!i.isArray(t))return r.call(n,t,e);var o=s(e).apply(n._boundValue(),[null].concat(t));o===u&&a.throwLater(o.e);}function r(t,e){var n=this,r=n._boundValue(),o=void 0===t?s(e).call(r,null):s(e).call(r,null,t);o===u&&a.throwLater(o.e);}function o(t,e){var n=this;if(!t){var r=new Error(t+"");r.cause=t,t=r;}var o=s(e).call(n._boundValue(),t);o===u&&a.throwLater(o.e);}var i=t("./util"),a=e._async,s=i.tryCatch,u=i.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var i=r;void 0!==e&&Object(e).spread&&(i=n),this._then(i,o,void 0,this,t);}return this;};};},{"./util":36}],22:[function(t,n,r){"use strict";n.exports=function(){function r(){}function o(t,e){if(null==t||t.constructor!==i)throw new y("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new y("expecting a function but got "+h.classString(e));}function i(t){t!==w&&o(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this);}function a(t){this.promise._resolveCallback(t);}function s(t){this.promise._rejectCallback(t,!1);}function u(t){var e=new i(w);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t;}var l=function l(){return new y("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n");},c=function c(){return new i.PromiseInspection(this._target());},f=function f(t){return i.reject(new y(t));},p={},h=t("./util"),d;d=h.isNode?function(){var t=e.domain;return void 0===t&&(t=null),t;}:function(){return null;},h.notEnumerableProp(i,"_getDomain",d);var v=t("./es5"),_=t("./async"),m=new _();v.defineProperty(i,"_async",{value:m});var g=t("./errors"),y=i.TypeError=g.TypeError;i.RangeError=g.RangeError;var b=i.CancellationError=g.CancellationError;i.TimeoutError=g.TimeoutError,i.OperationalError=g.OperationalError,i.RejectionError=g.OperationalError,i.AggregateError=g.AggregateError;var w=function w(){},x={},E={},T=t("./thenables")(i,w),O=t("./promise_array")(i,w,T,f,r),P=t("./context")(i),j=P.create,A=t("./debuggability")(i,P),S=A.CapturedTrace,M=t("./finally")(i,T,E),k=t("./catch_filter")(E),C=t("./nodeback"),R=h.errorObj,I=h.tryCatch;return i.prototype.toString=function(){return"[object Promise]";},i.prototype.caught=i.prototype.catch=function(t){var e=arguments.length;if(e>1){var n=new Array(e-1),r=0,o;for(o=0;o<e-1;++o){var i=arguments[o];if(!h.isObject(i))return f("Catch statement predicate: expecting an object but got "+h.classString(i));n[r++]=i;}return n.length=r,t=arguments[o],this.then(void 0,k(n,t,this));}return this.then(void 0,t);},i.prototype.reflect=function(){return this._then(c,c,void 0,this,void 0);},i.prototype.then=function(t,e){if(A.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n);}return this._then(t,e,void 0,void 0,void 0);},i.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal();},i.prototype.spread=function(t){return"function"!=typeof t?f("expecting a function but got "+h.classString(t)):this.all()._then(t,void 0,void 0,x,void 0);},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t;},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new O(this).promise();},i.prototype.error=function(t){return this.caught(h.originatesFromRejection,t);},i.getNewLibraryCopy=n.exports,i.is=function(t){return t instanceof i;},i.fromNode=i.fromCallback=function(t){var e=new i(w);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=I(t)(C(e,n));return r===R&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e;},i.all=function(t){return new O(t).promise();},i.cast=function(t){var e=T(t);return e instanceof i||(e=new i(w),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e;},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(w);return e._captureStackTrace(),e._rejectCallback(t,!0),e;},i.setScheduler=function(t){if("function"!=typeof t)throw new y("expecting a function but got "+h.classString(t));return m.setScheduler(t);},i.prototype._then=function(t,e,n,r,o){var a=void 0!==o,s=a?o:new i(w),u=this._target(),l=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var c=d();if(0!=(50397184&l)){var f,p,v=u._settlePromiseCtx;0!=(33554432&l)?(p=u._rejectionHandler0,f=t):0!=(16777216&l)?(p=u._fulfillmentHandler0,f=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,p=new b("late cancellation observer"),u._attachExtraTrace(p),f=e),m.invoke(v,u,{handler:null===c?f:"function"==typeof f&&h.domainBind(c,f),promise:s,receiver:r,value:p});}else u._addCallbacks(t,e,s,r,c);return s;},i.prototype._length=function(){return 65535&this._bitField;},i.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField);},i.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField);},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t;},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this);},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this);},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this);},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField;},i.prototype._isFinal=function(){return(4194304&this._bitField)>0;},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField;},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this);},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField;},i.prototype._setAsyncGuaranteed=function(){m.hasCustomScheduler()||(this._bitField=134217728|this._bitField);},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==p)return void 0===e&&this._isBound()?this._boundValue():e;},i.prototype._promiseAt=function(t){return this[4*t-4+2];},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0];},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1];},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=t._bitField,n=t._fulfillmentHandler0,r=t._rejectionHandler0,o=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(n,r,o,i,null);},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),o=t._promiseAt(e),i=t._receiverAt(e);void 0===i&&(i=p),this._addCallbacks(n,r,o,i,null);},i.prototype._addCallbacks=function(t,e,n,r,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===o?t:h.domainBind(o,t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:h.domainBind(o,e));else{var a=4*i-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===o?t:h.domainBind(o,t)),"function"==typeof e&&(this[a+1]=null===o?e:h.domainBind(o,e));}return this._setLength(i+1),i;},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null);},i.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=T(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0==(50397184&o)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;s<a;++s){r._migrateCallbackAt(this,s);}this._setFollowing(),this._setLength(0),this._setFollowee(r);}else if(0!=(33554432&o))this._fulfill(r._value());else if(0!=(16777216&o))this._reject(r._reason());else{var u=new b("late cancellation observer");r._attachExtraTrace(u),this._reject(u);}}},i.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),o=r===t;if(!o&&!n&&A.warnings()){var i="a promise was rejected with a non-error: "+h.classString(t);this._warn(i,!0);}this._attachExtraTrace(r,!!e&&o),this._reject(t);},i.prototype._resolveFromExecutor=function(t){if(t!==w){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t);},function(t){e._rejectCallback(t,n);});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0);}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var o=r._bitField;if(0==(65536&o)){r._pushContext();var i;e===x?n&&"number"==typeof n.length?i=I(t).apply(this._boundValue(),n):(i=R,i.e=new y("cannot .spread() a non-array: "+h.classString(n))):i=I(t).call(e,n);var a=r._popContext();o=r._bitField,0==(65536&o)&&(i===E?r._reject(n):i===R?r._rejectCallback(i.e,!1):(A.checkForgottenReturns(i,a,"",r,this),r._resolveCallback(i)));}},i.prototype._target=function(){for(var t=this;t._isFollowing();){t=t._followee();}return t;},i.prototype._followee=function(){return this._rejectionHandler0;},i.prototype._setFollowee=function(t){this._rejectionHandler0=t;},i.prototype._settlePromise=function(t,e,n,o){var a=t instanceof i,s=this._bitField,u=0!=(134217728&s);0!=(65536&s)?(a&&t._invokeInternalOnCancel(),n instanceof M&&n.isFinallyHandler()?(n.cancelPromise=t,I(e).call(n,o)===R&&t._reject(R.e)):e===c?t._fulfill(c.call(n)):n instanceof r?n._promiseCancelled(t):a||t instanceof O?t._cancel():n.cancel()):"function"==typeof e?a?(u&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,n,o,t)):e.call(n,o,t):n instanceof r?n._isResolved()||(0!=(33554432&s)?n._promiseFulfilled(o,t):n._promiseRejected(o,t)):a&&(u&&t._setAsyncGuaranteed(),0!=(33554432&s)?t._fulfill(o):t._reject(o));},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o);},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value);},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,o,e);},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0;},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n);}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():m.settlePromises(this));}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return m.fatalError(t,h.isNode);(65535&e)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled();}},i.prototype._fulfillPromises=function(t,e){for(var n=1;n<t;n++){var r=this._fulfillmentHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,e);}},i.prototype._rejectPromises=function(t,e){for(var n=1;n<t;n++){var r=this._rejectionHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,e);}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!=(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n);}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r);}this._setLength(0);}this._clearCancellationData();},i.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0;},i.defer=i.pending=function(){return A.deprecated("Promise.defer","new Promise"),{promise:new i(w),resolve:a,reject:s};},h.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,w,T,f,A),t("./bind")(i,w,T,A),t("./cancel")(i,O,f,A),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,O,T,w,m,d),i.Promise=i,i.version="3.5.0",t("./map.js")(i,O,f,T,w,A),t("./call_get.js")(i),t("./using.js")(i,f,T,j,w,A),t("./timers.js")(i,w,A),t("./generators.js")(i,f,w,T,r,A),t("./nodeify.js")(i),t("./promisify.js")(i,w),t("./props.js")(i,O,T,f),t("./race.js")(i,w,T,f),t("./reduce.js")(i,O,f,T,w,A),t("./settle.js")(i,O,A),t("./some.js")(i,O,f),t("./filter.js")(i,w),t("./each.js")(i,w),t("./any.js")(i),h.toFastProperties(i),h.toFastProperties(i.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new i(w)),A.setBounds(_.firstLineError,h.lastLineError),i;};},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i){function a(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map();}}function s(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2);}var u=t("./util"),l=u.isArray;return u.inherits(s,i),s.prototype.length=function(){return this._length;},s.prototype.promise=function(){return this._promise;},s.prototype._init=function t(n,i){var s=r(this._values,this._promise);if(s instanceof e){s=s._target();var l=s._bitField;if(this._values=s,0==(50397184&l))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,i);if(0==(33554432&l))return 0!=(16777216&l)?this._reject(s._reason()):this._cancel();s=s._value();}if(null===(s=u.asArray(s))){var c=o("expecting an array or an iterable object but got "+u.classString(s)).reason();return void this._promise._rejectCallback(c,!1);}if(0===s.length)return void(-5===i?this._resolveEmptyArray():this._resolve(a(i)));this._iterate(s);},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<n;++s){var u=r(t[s],o);u instanceof e?(u=u._target(),a=u._bitField):a=null,i?null!==a&&u.suppressUnhandledRejections():null!==a?0==(50397184&a)?(u._proxy(this,s),this._values[s]=u):i=0!=(33554432&a)?this._promiseFulfilled(u._value(),s):0!=(16777216&a)?this._promiseRejected(u._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(u,s);}i||o._setAsyncGuaranteed();},s.prototype._isResolved=function(){return null===this._values;},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t);},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel());},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1);},s.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0);},s.prototype._promiseCancelled=function(){return this._cancel(),!0;},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0;},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n){t[n]instanceof e&&t[n].cancel();}}},s.prototype.shouldCopyValues=function(){return!0;},s.prototype.getActualLength=function(t){return t;},s;};},{"./util":36}],24:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t){return!w.test(t);}function o(t){try{return!0===t.__isPromisified__;}catch(t){return!1;}}function i(t,e,n){var r=p.getDataPropertyOrDefault(t,e+n,y);return!!r&&o(r);}function a(t,e,n){for(var r=0;r<t.length;r+=2){var o=t[r];if(n.test(o))for(var i=o.replace(n,""),a=0;a<t.length;a+=2){if(t[a]===i)throw new m("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s",e));}}}function s(t,e,n,r){for(var s=p.inheritedDataKeys(t),u=[],l=0;l<s.length;++l){var c=s[l],f=t[c],h=r===x||x(c,f,t);"function"!=typeof f||o(f)||i(t,c,e)||!r(c,f,t,h)||u.push(c,f);}return a(u,e,n),u;}function u(t,r,o,i,a,s){function u(){var o=r;r===f&&(o=this);var i=new e(n);i._captureStackTrace();var a="string"==typeof c&&this!==l?this[c]:t,u=h(i,s);try{a.apply(o,d(arguments,u));}catch(t){i._rejectCallback(v(t),!0,!0);}return i._isFateSealed()||i._setAsyncGuaranteed(),i;}var l=function(){return this;}(),c=t;return"string"==typeof c&&(t=i),p.notEnumerableProp(u,"__isPromisified__",!0),u;}function l(t,e,n,r,o){for(var i=new RegExp(E(e)+"$"),a=s(t,e,i,n),u=0,l=a.length;u<l;u+=2){var c=a[u],h=a[u+1],d=c+e;if(r===S)t[d]=S(c,f,c,h,e,o);else{var v=r(h,function(){return S(c,f,c,h,e,o);});p.notEnumerableProp(v,"__isPromisified__",!0),t[d]=v;}}return p.toFastProperties(t),t;}function c(t,e,n){return S(t,e,void 0,t,null,n);}var f={},p=t("./util"),h=t("./nodeback"),d=p.withAppended,v=p.maybeWrapAsError,_=p.canEvaluate,m=t("./errors").TypeError,g="Async",y={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),x=function x(t){return p.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t;},E=function E(t){return t.replace(/([$])/,"\\$");},T,O,P,j,A,S=_?T:u;e.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+p.classString(t));if(o(t))return t;e=Object(e);var n=void 0===e.context?f:e.context,i=!!e.multiArgs,a=c(t,n,i);return p.copyDescriptors(t,a,r),a;},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=(typeof t==="undefined"?"undefined":_typeof(t)))throw new m("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r="Async");var o=e.filter;"function"!=typeof o&&(o=x);var i=e.promisifier;if("function"!=typeof i&&(i=S),!p.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");for(var a=p.inheritedDataKeys(t),s=0;s<a.length;++s){var u=t[a[s]];"constructor"!==a[s]&&p.isClass(u)&&(l(u.prototype,r,o,i,n),l(u,r,o,i,n));}return l(t,r,o,i,n);};};},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,n){"use strict";e.exports=function(e,n,r,o){function i(t){var e=!1,n;if(void 0!==c&&t instanceof c)n=f(t),e=!0;else{var r=l.keys(t),o=r.length;n=new Array(2*o);for(var i=0;i<o;++i){var a=r[i];n[i]=t[a],n[i+o]=a;}}this.constructor$(n),this._isMap=e,this._init$(void 0,e?-6:-3);}function a(t){var n,a=r(t);return u(a)?(n=a instanceof e?a._then(e.props,void 0,void 0,void 0,void 0):new i(a).promise(),a instanceof e&&n._propagateFrom(a,2),n):o("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n");}var s=t("./util"),u=s.isObject,l=t("./es5"),c;"function"==typeof Map&&(c=Map);var f=function(){function t(t,r){this[e]=t,this[e+n]=r,e++;}var e=0,n=0;return function r(o){n=o.size,e=0;var i=new Array(2*o.size);return o.forEach(t,i),i;};}(),p=function p(t){for(var e=new c(),n=t.length/2|0,r=0;r<n;++r){var o=t[n+r],i=t[r];e.set(o,i);}return e;};s.inherits(i,n),i.prototype._init=function(){},i.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var n;if(this._isMap)n=p(this._values);else{n={};for(var r=this.length(),o=0,i=this.length();o<i;++o){n[this._values[o+r]]=this._values[o];}}return this._resolve(n),!0;}return!1;},i.prototype.shouldCopyValues=function(){return!1;},i.prototype.getActualLength=function(t){return t>>1;},e.prototype.props=function(){return a(this);},e.props=function(t){return a(t);};};},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,o){for(var i=0;i<o;++i){n[i+r]=t[i+e],t[i+e]=void 0;}}function o(t){this._capacity=t,this._length=0,this._front=0;}o.prototype._willBeOverCapacity=function(t){return this._capacity<t;},o.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1;},o.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var o=this._front+r-3;this._checkCapacity(r);var i=this._capacity-1;this[o+0&i]=t,this[o+1&i]=e,this[o+2&i]=n,this._length=r;},o.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e;},o.prototype.length=function(){return this._length;},o.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1);},o.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,r(this,0,this,e,this._front+this._length&e-1);},e.exports=o;},{}],27:[function(t,e,n){"use strict";e.exports=function(e,n,r,o){function i(t,i){var u=r(t);if(u instanceof e)return s(u);if(null===(t=a.asArray(t)))return o("expecting an array or an iterable object but got "+a.classString(t));var l=new e(n);void 0!==i&&l._propagateFrom(i,3);for(var c=l._fulfill,f=l._reject,p=0,h=t.length;p<h;++p){var d=t[p];(void 0!==d||p in t)&&e.cast(d)._then(c,f,void 0,l,null);}return l;}var a=t("./util"),s=function s(t){return t.then(function(e){return i(e,t);});};e.race=function(t){return i(t,void 0);},e.prototype.race=function(){return i(this,void 0);};};},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i,a){function s(t,n,r,o){this.constructor$(t);var a=p();this._fn=null===a?n:h.domainBind(a,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5);}function u(t,e){this.isFulfilled()?e._resolve(t):e._reject(t);}function l(t,e,n,o){return"function"!=typeof e?r("expecting a function but got "+h.classString(e)):new s(t,e,n,o).promise();}function c(t){this.accum=t,this.array._gotAccum(t);var n=o(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(f,void 0,void 0,this,void 0)):f.call(this,n);}function f(t){var n=this.array,r=n._promise,o=d(n._fn);r._pushContext();var i;(i=void 0!==n._eachValues?o.call(r._boundValue(),t,this.index,this.length):o.call(r._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(n._currentCancellable=i);var s=r._popContext();return a.checkForgottenReturns(i,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),i;}var p=e._getDomain,h=t("./util"),d=h.tryCatch;h.inherits(s,n),s.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==i&&this._eachValues.push(t);},s.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues;},s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue);},s.prototype.shouldCopyValues=function(){return!1;},s.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null;},s.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel());},s.prototype._iterate=function(t){this._values=t;var n,r,o=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;r<o;++r){var i={accum:null,value:t[r],index:r,length:o,array:this};n=n._then(c,void 0,void 0,i,void 0);}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(u,u,void 0,n,this);},e.prototype.reduce=function(t,e){return l(this,t,e,null);},e.reduce=function(t,e,n,r){return l(t,e,n,r);};};},{"./util":36}],29:[function(t,o,i){"use strict";var a=t("./util"),s,u=function u(){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n");},l=a.getNativePromise();if(a.isNode&&"undefined"==typeof MutationObserver){var c=n.setImmediate,f=e.nextTick;s=a.isRecentNode?function(t){c.call(n,t);}:function(t){f.call(e,t);};}else if("function"==typeof l&&"function"==typeof l.resolve){var p=l.resolve();s=function s(t){p.then(t);};}else s="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?void 0!==r?function(t){r(t);}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0);}:u:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div");new MutationObserver(function(){t.classList.toggle("foo"),n=!1;}).observe(r,e);var o=function o(){n||(n=!0,r.classList.toggle("foo"));};return function n(r){var i=new MutationObserver(function(){i.disconnect(),r();});i.observe(t,e),o();};}();o.exports=s;},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function o(t){this.constructor$(t);}var i=e.PromiseInspection;t("./util").inherits(o,n),o.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0);},o.prototype._promiseFulfilled=function(t,e){var n=new i();return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n);},o.prototype._promiseRejected=function(t,e){var n=new i();return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n);},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new o(t).promise();},e.prototype.settle=function(){return e.settle(this);};};},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function o(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1;}function i(t,e){if((0|e)!==e||e<0)return r("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");var n=new o(t),i=n.promise();return n.setHowMany(e),n.init(),i;}var a=t("./util"),s=t("./errors").RangeError,u=t("./errors").AggregateError,l=a.isArray,c={};a.inherits(o,n),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()));}},o.prototype.init=function(){this._initialized=!0,this._init();},o.prototype.setUnwrap=function(){this._unwrap=!0;},o.prototype.howMany=function(){return this._howMany;},o.prototype.setHowMany=function(t){this._howMany=t;},o.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0);},o.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome();},o.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome());},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u(),e=this.length();e<this._values.length;++e){this._values[e]!==c&&t.push(this._values[e]);}return t.length>0?this._reject(t):this._cancel(),!0;}return!1;},o.prototype._fulfilled=function(){return this._totalResolved;},o.prototype._rejected=function(){return this._values.length-this.length();},o.prototype._addRejected=function(t){this._values.push(t);},o.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t;},o.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected();},o.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new s(e);},o.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0));},e.some=function(t,e){return i(t,e);},e.prototype.some=function(t){return i(this,t);},e._SomePromiseArray=o;};},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0);}e.prototype._settledValue=function(){return this._settledValueField;};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue();},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue();},o=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField);},i=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField);},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField);},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField);};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField);},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField);},t.prototype._isCancelled=function(){return this._target().__isCancelled();},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField);},t.prototype.isPending=function(){return a.call(this._target());},t.prototype.isRejected=function(){return i.call(this._target());},t.prototype.isFulfilled=function(){return o.call(this._target());},t.prototype.isResolved=function(){return s.call(this._target());},t.prototype.value=function(){return n.call(this._target());},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t);},t.prototype._value=function(){return this._settledValue();},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue();},t.PromiseInspection=e;};},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(c(t)){if(t instanceof e)return t;var o=i(t);if(o===l){r&&r._pushContext();var u=e.reject(o.e);return r&&r._popContext(),u;}if("function"==typeof o){if(a(t)){var u=new e(n);return t._then(u._fulfill,u._reject,void 0,u,null),u;}return s(t,o,r);}}return t;}function o(t){return t.then;}function i(t){try{return o(t);}catch(t){return l.e=t,l;}}function a(t){try{return f.call(t,"_promise0");}catch(t){return!1;}}function s(t,r,o){function i(t){s&&(s._resolveCallback(t),s=null);}function a(t){s&&(s._rejectCallback(t,f,!0),s=null);}var s=new e(n),c=s;o&&o._pushContext(),s._captureStackTrace(),o&&o._popContext();var f=!0,p=u.tryCatch(r).call(t,i,a);return f=!1,s&&p===l&&(s._rejectCallback(p.e,!0,!0),s=null),c;}var u=t("./util"),l=u.errorObj,c=u.isObject,f={}.hasOwnProperty;return r;};},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function o(t){this.handle=t;}function i(t){return clearTimeout(this.handle),t;}function a(t){throw clearTimeout(this.handle),t;}var s=t("./util"),u=e.TimeoutError;o.prototype._resultCancelled=function(){clearTimeout(this.handle);};var l=function l(t){return c(+this).thenReturn(t);},c=e.delay=function(t,i){var a,s;return void 0!==i?(a=e.resolve(i)._then(l,null,null,t,void 0),r.cancellation()&&i instanceof e&&a._setOnCancel(i)):(a=new e(n),s=setTimeout(function(){a._fulfill();},+t),r.cancellation()&&a._setOnCancel(new o(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a;};e.prototype.delay=function(t){return c(t,this);};var f=function f(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),s.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel();};e.prototype.timeout=function(t,e){t=+t;var n,s,u=new o(setTimeout(function t(){n.isPending()&&f(n,e,s);},t));return r.cancellation()?(s=this.then(),n=s._then(i,a,void 0,u,void 0),n._setOnCancel(u)):n=this._then(i,a,void 0,u,void 0),n;};};},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,o,i,a){function s(t){setTimeout(function(){throw t;},0);}function u(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e;}function l(t,n){function o(){if(a>=l)return c._fulfill();var i=u(t[a++]);if(i instanceof e&&i._isDisposable()){try{i=r(i._getDisposer().tryDispose(n),t.promise);}catch(t){return s(t);}if(i instanceof e)return i._then(o,s,null,null,null);}o();}var a=0,l=t.length,c=new e(i);return o(),c;}function c(t,e,n){this._data=t,this._promise=e,this._context=n;}function f(t,e,n){this.constructor$(t,e,n);}function p(t){return c.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t;}function h(t){this.length=t,this.promise=null,this[t-1]=null;}var d=t("./util"),v=t("./errors").TypeError,_=t("./util").inherits,m=d.errorObj,g=d.tryCatch,y={};c.prototype.data=function(){return this._data;},c.prototype.promise=function(){return this._promise;},c.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():y;},c.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==y?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r;},c.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose;},_(f,c),f.prototype.doDispose=function(t,e){return this.data().call(t,t,e);},h.prototype._resultCancelled=function(){for(var t=this.length,n=0;n<t;++n){var r=this[n];r instanceof e&&r.cancel();}},e.using=function(){var t=arguments.length;if(t<2)return n("you must pass at least 2 arguments to Promise.using");var o=arguments[t-1];if("function"!=typeof o)return n("expecting a function but got "+d.classString(o));var i,s=!0;2===t&&Array.isArray(arguments[0])?(i=arguments[0],t=i.length,s=!1):(i=arguments,t--);for(var u=new h(t),f=0;f<t;++f){var v=i[f];if(c.isDisposer(v)){var _=v;v=v.promise(),v._setDisposable(_);}else{var y=r(v);y instanceof e&&(v=y._then(p,null,null,{resources:u,index:f},void 0));}u[f]=v;}for(var b=new Array(u.length),f=0;f<b.length;++f){b[f]=e.resolve(u[f]).reflect();}var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return m.e=n.error(),m;if(!n.isFulfilled())return void w.cancel();t[e]=n.value();}x._pushContext(),o=g(o);var r=s?o.apply(void 0,t):o(t),i=x._popContext();return a.checkForgottenReturns(r,i,"Promise.using",x),r;}),x=w.lastly(function(){var t=new e.PromiseInspection(w);return l(u,t);});return u.promise=x,x._setOnCancel(u),x;},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t;},e.prototype._isDisposable=function(){return(131072&this._bitField)>0;},e.prototype._getDisposer=function(){return this._disposer;},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0;},e.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this,o());throw new v();};};},{"./errors":12,"./util":36}],36:[function(t,r,o){"use strict";function i(){try{var t=k;return k=null,t.apply(this,arguments);}catch(t){return M.e=t,M;}}function a(t){return k=t,i;}function s(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t;}function u(t){return"function"==typeof t||"object"==(typeof t==="undefined"?"undefined":_typeof(t))&&null!==t;}function l(t){return s(t)?new Error(g(t)):t;}function c(t,e){var n=t.length,r=new Array(n+1),o;for(o=0;o<n;++o){r[o]=t[o];}return r[o]=e,r;}function f(t,e,n){if(!A.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0;}function p(t,e,n){if(s(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return A.defineProperty(t,e,r),t;}function h(t){throw t;}function d(t){try{if("function"==typeof t){var e=A.names(t.prototype),n=A.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),o=N.test(t+"")&&A.names(t).length>0;if(n||r||o)return!0;}return!1;}catch(t){return!1;}}function v(t){function e(){}e.prototype=t;for(var n=8;n--;){new e();}return t;}function _(t){return F.test(t);}function m(t,e,n){for(var r=new Array(t),o=0;o<t;++o){r[o]=e+o+n;}return r;}function g(t){try{return t+"";}catch(t){return"[no string representation]";}}function y(t){return null!==t&&"object"==(typeof t==="undefined"?"undefined":_typeof(t))&&"string"==typeof t.message&&"string"==typeof t.name;}function b(t){try{p(t,"isOperational",!0);}catch(t){}}function w(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational);}function x(t){return y(t)&&A.propertyIsWritable(t,"stack");}function E(t){return{}.toString.call(t);}function T(t,e,n){for(var r=A.names(t),o=0;o<r.length;++o){var i=r[o];if(n(i))try{A.defineProperty(e,i,A.getDescriptor(t,i));}catch(t){}}}function O(t){return V?e.env[t]:void 0;}function P(){if("function"==typeof Promise)try{var t=new Promise(function(){});if("[object Promise]"==={}.toString.call(t))return Promise;}catch(t){}}function j(t,e){return t.bind(e);}var A=t("./es5"),S="undefined"==typeof navigator,M={e:{}},k,C="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null,R=function R(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype){r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n]);}}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n(),t.prototype;},I=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function e(_e2){for(var n=0;n<t.length;++n){if(t[n]===_e2)return!0;}return!1;};if(A.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],o=Object.create(null);null!=t&&!e(t);){var i;try{i=n(t);}catch(t){return r;}for(var a=0;a<i.length;++a){var s=i[a];if(!o[s]){o[s]=!0;var u=Object.getOwnPropertyDescriptor(t,s);null!=u&&null==u.get&&null==u.set&&r.push(s);}}t=A.getPrototypeOf(t);}return r;};}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var o=[];t:for(var i in n){if(r.call(n,i))o.push(i);else{for(var a=0;a<t.length;++a){if(r.call(t[a],i))continue t;}o.push(i);}}return o;};}(),N=/this\s*\.\s*\S+\s*=/,F=/^[a-z$_][a-z$_0-9]*$/i,U=function(){return"stack"in new Error()?function(t){return x(t)?t:new Error(g(t));}:function(t){if(x(t))return t;try{throw new Error(g(t));}catch(t){return t;}};}(),L=function L(t){return A.isArray(t)?t:null;};if("undefined"!=typeof Symbol&&Symbol.iterator){var D="function"==typeof Array.from?function(t){return Array.from(t);}:function(t){for(var e=[],n=t[Symbol.iterator](),r;!(r=n.next()).done;){e.push(r.value);}return e;};L=function L(t){return A.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?D(t):null;};}var B=void 0!==e&&"[object process]"===E(e).toLowerCase(),V=void 0!==e&&void 0!==e.env,X={isClass:d,isIdentifier:_,inheritedDataKeys:I,getDataPropertyOrDefault:f,thrower:h,isArray:A.isArray,asArray:L,notEnumerableProp:p,isPrimitive:s,isObject:u,isError:y,canEvaluate:S,errorObj:M,tryCatch:a,inherits:R,withAppended:c,maybeWrapAsError:l,toFastProperties:v,filledRange:m,toString:g,canAttachTrace:x,ensureErrorObject:U,originatesFromRejection:w,markAsOriginatingFromRejection:b,classString:E,copyDescriptors:T,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:B,hasEnvVariables:V,env:O,global:C,getNativePromise:P,domainBind:j};X.isRecentNode=X.isNode&&function(){var t=e.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0;}(),X.isNode&&X.toFastProperties(e);try{throw new Error();}catch(t){X.lastLineError=t;}r.exports=X;},{"./es5":13}]},{},[4])(4);}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);}).call(e,n(132),n(39),n(637).setImmediate);},function(t,e,n){n(308),t.exports=n(31).RegExp.escape;},function(t,e,n){var r=n(7),o=n(105),i=n(8)("species");t.exports=function(t){var e;return o(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!o(e.prototype)||(e=void 0),r(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e;};},function(t,e,n){var r=n(300);t.exports=function(t,e){return new(r(t))(e);};},function(t,e,n){"use strict";var r=n(4),o=n(28),i="number";t.exports=function(t){if("string"!==t&&t!==i&&"default"!==t)throw TypeError("Incorrect hint");return o(r(this),t!=i);};},function(t,e,n){var r=n(44),o=n(77),i=n(63);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a=n(t),s=i.f,u=0,l;a.length>u;){s.call(t,l=a[u++])&&e.push(l);}return e;};},function(t,e,n){var r=n(44),o=n(18);t.exports=function(t,e){for(var n=o(t),i=r(n),a=i.length,s=0,u;a>s;){if(n[u=i[s++]]===e)return u;}};},function(t,e,n){"use strict";var r=n(306),o=n(73),i=n(14);t.exports=function(){for(var t=i(this),e=arguments.length,n=Array(e),a=0,s=r._,u=!1;e>a;){(n[a]=arguments[a++])===s&&(u=!0);}return function(){var r=this,i=arguments.length,a=0,l=0,c;if(!u&&!i)return o(t,n,r);if(c=n.slice(),u)for(;e>a;a++){c[a]===s&&(c[a]=arguments[l++]);}for(;i>l;){c.push(arguments[l++]);}return o(t,c,r);};};},function(t,e,n){t.exports=n(5);},function(t,e){t.exports=function(t,e){var n=e===Object(e)?function(t){return e[t];}:e;return function(e){return String(e).replace(t,n);};};},function(t,e,n){var r=n(0),o=n(307)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function t(e){return o(e);}});},function(t,e,n){var r=n(0);r(r.P,"Array",{copyWithin:n(146)}),n(52)("copyWithin");},function(t,e,n){"use strict";var r=n(0),o=n(26)(4);r(r.P+r.F*!n(25)([].every,!0),"Array",{every:function t(e){return o(this,e,arguments[1]);}});},function(t,e,n){var r=n(0);r(r.P,"Array",{fill:n(97)}),n(52)("fill");},function(t,e,n){"use strict";var r=n(0),o=n(26)(2);r(r.P+r.F*!n(25)([].filter,!0),"Array",{filter:function t(e){return o(this,e,arguments[1]);}});},function(t,e,n){"use strict";var r=n(0),o=n(26)(6),i="findIndex",a=!0;i in[]&&Array(1)[i](function(){a=!1;}),r(r.P+r.F*a,"Array",{findIndex:function t(e){return o(this,e,arguments.length>1?arguments[1]:void 0);}}),n(52)(i);},function(t,e,n){"use strict";var r=n(0),o=n(26)(5),i="find",a=!0;i in[]&&Array(1)[i](function(){a=!1;}),r(r.P+r.F*a,"Array",{find:function t(e){return o(this,e,arguments.length>1?arguments[1]:void 0);}}),n(52)(i);},function(t,e,n){"use strict";var r=n(0),o=n(26)(0),i=n(25)([].forEach,!0);r(r.P+r.F*!i,"Array",{forEach:function t(e){return o(this,e,arguments[1]);}});},function(t,e,n){"use strict";var r=n(32),o=n(0),i=n(12),a=n(155),s=n(104),u=n(11),l=n(98),c=n(121);o(o.S+o.F*!n(75)(function(t){Array.from(t);}),"Array",{from:function t(e){var n=i(e),o="function"==typeof this?this:Array,f=arguments.length,p=f>1?arguments[1]:void 0,h=void 0!==p,d=0,v=c(n),_,m,g,y;if(h&&(p=r(p,f>2?arguments[2]:void 0,2)),void 0==v||o==Array&&s(v))for(_=u(n.length),m=new o(_);_>d;d++){l(m,d,h?p(n[d],d):n[d]);}else for(y=v.call(n),m=new o();!(g=y.next()).done;d++){l(m,d,h?a(y,p,[g.value,d],!0):g.value);}return m.length=d,m;}});},function(t,e,n){"use strict";var r=n(0),o=n(69)(!1),i=[].indexOf,a=!!i&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(a||!n(25)(i)),"Array",{indexOf:function t(e){return a?i.apply(this,arguments)||0:o(this,e,arguments[1]);}});},function(t,e,n){var r=n(0);r(r.S,"Array",{isArray:n(105)});},function(t,e,n){"use strict";var r=n(0),o=n(18),i=[].join;r(r.P+r.F*(n(62)!=Object||!n(25)(i)),"Array",{join:function t(e){return i.call(o(this),void 0===e?",":e);}});},function(t,e,n){"use strict";var r=n(0),o=n(18),i=n(38),a=n(11),s=[].lastIndexOf,u=!!s&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(u||!n(25)(s)),"Array",{lastIndexOf:function t(e){if(u)return s.apply(this,arguments)||0;var n=o(this),r=a(n.length),l=r-1;for(arguments.length>1&&(l=Math.min(l,i(arguments[1]))),l<0&&(l=r+l);l>=0;l--){if(l in n&&n[l]===e)return l||0;}return-1;}});},function(t,e,n){"use strict";var r=n(0),o=n(26)(1);r(r.P+r.F*!n(25)([].map,!0),"Array",{map:function t(e){return o(this,e,arguments[1]);}});},function(t,e,n){"use strict";var r=n(0),o=n(98);r(r.S+r.F*n(6)(function(){function t(){}return!(Array.of.call(t)instanceof t);}),"Array",{of:function t(){for(var e=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);n>e;){o(r,e,arguments[e++]);}return r.length=n,r;}});},function(t,e,n){"use strict";var r=n(0),o=n(148);r(r.P+r.F*!n(25)([].reduceRight,!0),"Array",{reduceRight:function t(e){return o(this,e,arguments.length,arguments[1],!0);}});},function(t,e,n){"use strict";var r=n(0),o=n(148);r(r.P+r.F*!n(25)([].reduce,!0),"Array",{reduce:function t(e){return o(this,e,arguments.length,arguments[1],!1);}});},function(t,e,n){"use strict";var r=n(0),o=n(102),i=n(23),a=n(47),s=n(11),u=[].slice;r(r.P+r.F*n(6)(function(){o&&u.call(o);}),"Array",{slice:function t(e,n){var r=s(this.length),o=i(this);if(n=void 0===n?r:n,"Array"==o)return u.call(this,e,n);for(var l=a(e,r),c=a(n,r),f=s(c-l),p=Array(f),h=0;h<f;h++){p[h]="String"==o?this.charAt(l+h):this[l+h];}return p;}});},function(t,e,n){"use strict";var r=n(0),o=n(26)(3);r(r.P+r.F*!n(25)([].some,!0),"Array",{some:function t(e){return o(this,e,arguments[1]);}});},function(t,e,n){"use strict";var r=n(0),o=n(14),i=n(12),a=n(6),s=[].sort,u=[1,2,3];r(r.P+r.F*(a(function(){u.sort(void 0);})||!a(function(){u.sort(null);})||!n(25)(s)),"Array",{sort:function t(e){return void 0===e?s.call(i(this)):s.call(i(this),o(e));}});},function(t,e,n){n(46)("Array");},function(t,e,n){var r=n(0);r(r.S,"Date",{now:function now(){return new Date().getTime();}});},function(t,e,n){"use strict";var r=n(0),o=n(6),i=Date.prototype.getTime,a=function a(t){return t>9?t:"0"+t;};r(r.P+r.F*(o(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString();})||!o(function(){new Date(NaN).toISOString();})),"Date",{toISOString:function t(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,n=e.getUTCFullYear(),r=e.getUTCMilliseconds(),o=n<0?"-":n>9999?"+":"";return o+("00000"+Math.abs(n)).slice(o?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(r>99?r:"0"+a(r))+"Z";}});},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(28);r(r.P+r.F*n(6)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function toISOString(){return 1;}});}),"Date",{toJSON:function t(e){var n=o(this),r=i(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null;}});},function(t,e,n){var r=n(8)("toPrimitive"),o=Date.prototype;r in o||n(15)(o,r,n(302));},function(t,e,n){var r=Date.prototype,o="Invalid Date",i="toString",a=r[i],s=r.getTime;new Date(NaN)+""!=o&&n(16)(r,i,function t(){var e=s.call(this);return e===e?a.call(this):o;});},function(t,e,n){var r=n(0);r(r.P,"Function",{bind:n(149)});},function(t,e,n){"use strict";var r=n(7),o=n(22),i=n(8)("hasInstance"),a=Function.prototype;i in a||n(10).f(a,i,{value:function value(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=o(t);){if(this.prototype===t)return!0;}return!1;}});},function(t,e,n){var r=n(10).f,o=n(37),i=n(13),a=Function.prototype,s=/^\s*function ([^ (]*)/,u="name",l=Object.isExtensible||function(){return!0;};u in a||n(9)&&r(a,u,{configurable:!0,get:function get(){try{var t=this,e=(""+t).match(s)[1];return i(t,u)||!l(t)||r(t,u,o(5,e)),e;}catch(t){return"";}}});},function(t,e,n){var r=n(0),o=n(157),i=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function t(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:o(e-1+i(e-1)*i(e+1));}});},function(t,e,n){function r(t){return isFinite(t=+t)&&0!=t?t<0?-r(-t):Math.log(t+Math.sqrt(t*t+1)):t;}var o=n(0),i=Math.asinh;o(o.S+o.F*!(i&&1/i(0)>0),"Math",{asinh:r});},function(t,e,n){var r=n(0),o=Math.atanh;r(r.S+r.F*!(o&&1/o(-0)<0),"Math",{atanh:function t(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2;}});},function(t,e,n){var r=n(0),o=n(109);r(r.S,"Math",{cbrt:function t(e){return o(e=+e)*Math.pow(Math.abs(e),1/3);}});},function(t,e,n){var r=n(0);r(r.S,"Math",{clz32:function t(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32;}});},function(t,e,n){var r=n(0),o=Math.exp;r(r.S,"Math",{cosh:function t(e){return(o(e=+e)+o(-e))/2;}});},function(t,e,n){var r=n(0),o=n(108);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o});},function(t,e,n){var r=n(0),o=n(109),i=Math.pow,a=i(2,-52),s=i(2,-23),u=i(2,127)*(2-s),l=i(2,-126),c=function c(t){return t+1/a-1/a;};r(r.S,"Math",{fround:function t(e){var n=Math.abs(e),r=o(e),i,f;return n<l?r*c(n/l/s)*l*s:(i=(1+s/a)*n,f=i-(i-n),f>u||f!=f?r*(1/0):r*f);}});},function(t,e,n){var r=n(0),o=Math.abs;r(r.S,"Math",{hypot:function t(e,n){for(var r=0,i=0,a=arguments.length,s=0,u,l;i<a;){u=o(arguments[i++]),s<u?(l=s/u,r=r*l*l+1,s=u):u>0?(l=u/s,r+=l*l):r+=u;}return s===1/0?1/0:s*Math.sqrt(r);}});},function(t,e,n){var r=n(0),o=Math.imul;r(r.S+r.F*n(6)(function(){return-5!=o(4294967295,5)||2!=o.length;}),"Math",{imul:function t(e,n){var r=65535,o=+e,i=+n,a=65535&o,s=65535&i;return 0|a*s+((65535&o>>>16)*s+a*(65535&i>>>16)<<16>>>0);}});},function(t,e,n){var r=n(0);r(r.S,"Math",{log10:function t(e){return Math.log(e)/Math.LN10;}});},function(t,e,n){var r=n(0);r(r.S,"Math",{log1p:n(157)});},function(t,e,n){var r=n(0);r(r.S,"Math",{log2:function t(e){return Math.log(e)/Math.LN2;}});},function(t,e,n){var r=n(0);r(r.S,"Math",{sign:n(109)});},function(t,e,n){var r=n(0),o=n(108),i=Math.exp;r(r.S+r.F*n(6)(function(){return-2e-17!=!Math.sinh(-2e-17);}),"Math",{sinh:function t(e){return Math.abs(e=+e)<1?(o(e)-o(-e))/2:(i(e-1)-i(-e-1))*(Math.E/2);}});},function(t,e,n){var r=n(0),o=n(108),i=Math.exp;r(r.S,"Math",{tanh:function t(e){var n=o(e=+e),r=o(-e);return n==1/0?1:r==1/0?-1:(n-r)/(i(e)+i(-e));}});},function(t,e,n){var r=n(0);r(r.S,"Math",{trunc:function t(e){return(e>0?Math.floor:Math.ceil)(e);}});},function(t,e,n){"use strict";var r=n(5),o=n(13),i=n(23),a=n(103),s=n(28),u=n(6),l=n(43).f,c=n(21).f,f=n(10).f,p=n(56).trim,h="Number",d=r[h],v=d,_=d.prototype,m=i(n(42)(_))==h,g="trim"in String.prototype,y=function y(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){e=g?e.trim():p(e,3);var n=e.charCodeAt(0),r,o,i;if(43===n||45===n){if(88===(r=e.charCodeAt(2))||120===r)return NaN;}else if(48===n){switch(e.charCodeAt(1)){case 66:case 98:o=2,i=49;break;case 79:case 111:o=8,i=55;break;default:return+e;}for(var a=e.slice(2),u=0,l=a.length,c;u<l;u++){if((c=a.charCodeAt(u))<48||c>i)return NaN;}return parseInt(a,o);}}return+e;};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function t(e){var n=arguments.length<1?0:e,r=this;return r instanceof d&&(m?u(function(){_.valueOf.call(r);}):i(r)!=h)?a(new v(y(n)),r,d):y(n);};for(var b=n(9)?l(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0,x;b.length>w;w++){o(v,x=b[w])&&!o(d,x)&&f(d,x,c(v,x));}d.prototype=_,_.constructor=d,n(16)(r,h,d);}},function(t,e,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)});},function(t,e,n){var r=n(0),o=n(5).isFinite;r(r.S,"Number",{isFinite:function t(e){return"number"==typeof e&&o(e);}});},function(t,e,n){var r=n(0);r(r.S,"Number",{isInteger:n(154)});},function(t,e,n){var r=n(0);r(r.S,"Number",{isNaN:function t(e){return e!=e;}});},function(t,e,n){var r=n(0),o=n(154),i=Math.abs;r(r.S,"Number",{isSafeInteger:function t(e){return o(e)&&i(e)<=9007199254740991;}});},function(t,e,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991});},function(t,e,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991});},function(t,e,n){var r=n(0),o=n(164);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o});},function(t,e,n){var r=n(0),o=n(165);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o});},function(t,e,n){"use strict";var r=n(0),o=n(38),i=n(145),a=n(116),s=1..toFixed,u=Math.floor,l=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",f="0",p=function p(t,e){for(var n=-1,r=e;++n<6;){r+=t*l[n],l[n]=r%1e7,r=u(r/1e7);}},h=function h(t){for(var e=6,n=0;--e>=0;){n+=l[e],l[e]=u(n/t),n=n%t*1e7;}},d=function d(){for(var t=6,e="";--t>=0;){if(""!==e||0===t||0!==l[t]){var n=String(l[t]);e=""===e?n:e+a.call("0",7-n.length)+n;}}return e;},v=function v(t,e,n){return 0===e?n:e%2==1?v(t,e-1,n*t):v(t*t,e/2,n);},_=function _(t){for(var e=0,n=t;n>=4096;){e+=12,n/=4096;}for(;n>=2;){e+=1,n/=2;}return e;};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!n(6)(function(){s.call({});})),"Number",{toFixed:function t(e){var n=i(this,c),r=o(e),s="",u="0",l,f,m,g;if(r<0||r>20)throw RangeError(c);if(n!=n)return"NaN";if(n<=-1e21||n>=1e21)return String(n);if(n<0&&(s="-",n=-n),n>1e-21)if(l=_(n*v(2,69,1))-69,f=l<0?n*v(2,-l,1):n/v(2,l,1),f*=4503599627370496,(l=52-l)>0){for(p(0,f),m=r;m>=7;){p(1e7,0),m-=7;}for(p(v(10,m,1),0),m=l-1;m>=23;){h(1<<23),m-=23;}h(1<<m),p(1,1),h(2),u=d();}else p(0,f),p(1<<-l,0),u=d()+a.call("0",r);return r>0?(g=u.length,u=s+(g<=r?"0."+a.call("0",r-g)+u:u.slice(0,g-r)+"."+u.slice(g-r))):u=s+u,u;}});},function(t,e,n){"use strict";var r=n(0),o=n(6),i=n(145),a=1..toPrecision;r(r.P+r.F*(o(function(){return"1"!==a.call(1,void 0);})||!o(function(){a.call({});})),"Number",{toPrecision:function t(e){var n=i(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(n):a.call(n,e);}});},function(t,e,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(158)});},function(t,e,n){var r=n(0);r(r.S,"Object",{create:n(42)});},function(t,e,n){var r=n(0);r(r.S+r.F*!n(9),"Object",{defineProperties:n(159)});},function(t,e,n){var r=n(0);r(r.S+r.F*!n(9),"Object",{defineProperty:n(10).f});},function(t,e,n){var r=n(7),o=n(36).onFreeze;n(27)("freeze",function(t){return function e(n){return t&&r(n)?t(o(n)):n;};});},function(t,e,n){var r=n(18),o=n(21).f;n(27)("getOwnPropertyDescriptor",function(){return function t(e,n){return o(r(e),n);};});},function(t,e,n){n(27)("getOwnPropertyNames",function(){return n(160).f;});},function(t,e,n){var r=n(12),o=n(22);n(27)("getPrototypeOf",function(){return function t(e){return o(r(e));};});},function(t,e,n){var r=n(7);n(27)("isExtensible",function(t){return function e(n){return!!r(n)&&(!t||t(n));};});},function(t,e,n){var r=n(7);n(27)("isFrozen",function(t){return function e(n){return!r(n)||!!t&&t(n);};});},function(t,e,n){var r=n(7);n(27)("isSealed",function(t){return function e(n){return!r(n)||!!t&&t(n);};});},function(t,e,n){var r=n(0);r(r.S,"Object",{is:n(166)});},function(t,e,n){var r=n(12),o=n(44);n(27)("keys",function(){return function t(e){return o(r(e));};});},function(t,e,n){var r=n(7),o=n(36).onFreeze;n(27)("preventExtensions",function(t){return function e(n){return t&&r(n)?t(o(n)):n;};});},function(t,e,n){var r=n(7),o=n(36).onFreeze;n(27)("seal",function(t){return function e(n){return t&&r(n)?t(o(n)):n;};});},function(t,e,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(111).set});},function(t,e,n){"use strict";var r=n(61),o={};o[n(8)("toStringTag")]="z",o+""!="[object z]"&&n(16)(Object.prototype,"toString",function t(){return"[object "+r(this)+"]";},!0);},function(t,e,n){var r=n(0),o=n(164);r(r.G+r.F*(parseFloat!=o),{parseFloat:o});},function(t,e,n){var r=n(0),o=n(165);r(r.G+r.F*(parseInt!=o),{parseInt:o});},function(t,e,n){"use strict";var r=n(41),o=n(5),i=n(32),a=n(61),s=n(0),u=n(7),l=n(14),c=n(40),f=n(53),p=n(113),h=n(118).set,d=n(110)(),v="Promise",_=o.TypeError,m=o.process,g=o[v],m=o.process,y="process"==a(m),b=function b(){},w,x,E,T=!!function(){try{var t=g.resolve(1),e=(t.constructor={})[n(8)("species")]=function(t){t(b,b);};return(y||"function"==typeof PromiseRejectionEvent)&&t.then(b)instanceof e;}catch(t){}}(),O=function O(t,e){return t===e||t===g&&e===E;},P=function P(t){var e;return!(!u(t)||"function"!=typeof(e=t.then))&&e;},j=function j(t){return O(g,t)?new A(t):new x(t);},A=x=function x(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw _("Bad Promise constructor");e=t,n=r;}),this.resolve=l(e),this.reject=l(n);},S=function S(t){try{t();}catch(t){return{error:t};}},M=function M(t,e){if(!t._n){t._n=!0;var n=t._c;d(function(){for(var r=t._v,o=1==t._s,i=0,a=function a(e){var n=o?e.ok:e.fail,i=e.resolve,a=e.reject,s=e.domain,u,l;try{n?(o||(2==t._h&&R(t),t._h=1),!0===n?u=r:(s&&s.enter(),u=n(r),s&&s.exit()),u===e.promise?a(_("Promise-chain cycle")):(l=P(u))?l.call(u,i,a):i(u)):a(r);}catch(t){a(t);}};n.length>i;){a(n[i++]);}t._c=[],t._n=!1,e&&!t._h&&k(t);});}},k=function k(t){h.call(o,function(){var e=t._v,n,r,i;if(C(t)&&(n=S(function(){y?m.emit("unhandledRejection",e,t):(r=o.onunhandledrejection)?r({promise:t,reason:e}):(i=o.console)&&i.error&&i.error("Unhandled promise rejection",e);}),t._h=y||C(t)?2:1),t._a=void 0,n)throw n.error;});},C=function C(t){if(1==t._h)return!1;for(var e=t._a||t._c,n=0,r;e.length>n;){if(r=e[n++],r.fail||!C(r.promise))return!1;}return!0;},R=function R(t){h.call(o,function(){var e;y?m.emit("rejectionHandled",t):(e=o.onrejectionhandled)&&e({promise:t,reason:t._v});});},I=function I(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0));},N=function N(t){var e=this,n;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw _("Promise can't be resolved itself");(n=P(t))?d(function(){var r={_w:e,_d:!1};try{n.call(t,i(N,r,1),i(I,r,1));}catch(t){I.call(r,t);}}):(e._v=t,e._s=1,M(e,!1));}catch(t){I.call({_w:e,_d:!1},t);}}};T||(g=function t(e){c(this,g,v,"_h"),l(e),w.call(this);try{e(i(N,this,1),i(I,this,1));}catch(t){I.call(this,t);}},w=function t(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1;},w.prototype=n(45)(g.prototype,{then:function t(e,n){var r=j(p(this,g));return r.ok="function"!=typeof e||e,r.fail="function"==typeof n&&n,r.domain=y?m.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&M(this,!1),r.promise;},catch:function _catch(t){return this.then(void 0,t);}}),A=function A(){var t=new w();this.promise=t,this.resolve=i(N,t,1),this.reject=i(I,t,1);}),s(s.G+s.W+s.F*!T,{Promise:g}),n(55)(g,v),n(46)(v),E=n(31)[v],s(s.S+s.F*!T,v,{reject:function t(e){var n=j(this);return(0,n.reject)(e),n.promise;}}),s(s.S+s.F*(r||!T),v,{resolve:function t(e){if(e instanceof g&&O(e.constructor,this))return e;var n=j(this);return(0,n.resolve)(e),n.promise;}}),s(s.S+s.F*!(T&&n(75)(function(t){g.all(t).catch(b);})),v,{all:function t(e){var n=this,r=j(n),o=r.resolve,i=r.reject,a=S(function(){var t=[],r=0,a=1;f(e,!1,function(e){var s=r++,u=!1;t.push(void 0),a++,n.resolve(e).then(function(e){u||(u=!0,t[s]=e,--a||o(t));},i);}),--a||o(t);});return a&&i(a.error),r.promise;},race:function t(e){var n=this,r=j(n),o=r.reject,i=S(function(){f(e,!1,function(t){n.resolve(t).then(r.resolve,o);});});return i&&o(i.error),r.promise;}});},function(t,e,n){var r=n(0),o=n(14),i=n(4),a=(n(5).Reflect||{}).apply,s=Function.apply;r(r.S+r.F*!n(6)(function(){a(function(){});}),"Reflect",{apply:function t(e,n,r){var u=o(e),l=i(r);return a?a(u,n,l):s.call(u,n,l);}});},function(t,e,n){var r=n(0),o=n(42),i=n(14),a=n(4),s=n(7),u=n(6),l=n(149),c=(n(5).Reflect||{}).construct,f=u(function(){function t(){}return!(c(function(){},[],t)instanceof t);}),p=!u(function(){c(function(){});});r(r.S+r.F*(f||p),"Reflect",{construct:function t(e,n){i(e),a(n);var r=arguments.length<3?e:i(arguments[2]);if(p&&!f)return c(e,n,r);if(e==r){switch(n.length){case 0:return new e();case 1:return new e(n[0]);case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[1],n[2]);case 4:return new e(n[0],n[1],n[2],n[3]);}var u=[null];return u.push.apply(u,n),new(l.apply(e,u))();}var h=r.prototype,d=o(s(h)?h:Object.prototype),v=Function.apply.call(e,d,n);return s(v)?v:d;}});},function(t,e,n){var r=n(10),o=n(0),i=n(4),a=n(28);o(o.S+o.F*n(6)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2});}),"Reflect",{defineProperty:function t(e,n,o){i(e),n=a(n,!0),i(o);try{return r.f(e,n,o),!0;}catch(t){return!1;}}});},function(t,e,n){var r=n(0),o=n(21).f,i=n(4);r(r.S,"Reflect",{deleteProperty:function t(e,n){var r=o(i(e),n);return!(r&&!r.configurable)&&delete e[n];}});},function(t,e,n){"use strict";var r=n(0),o=n(4),i=function i(t){this._t=o(t),this._i=0;var e=this._k=[],n;for(n in t){e.push(n);}};n(106)(i,"Object",function(){var t=this,e=t._k,n;do{if(t._i>=e.length)return{value:void 0,done:!0};}while(!((n=e[t._i++])in t._t));return{value:n,done:!1};}),r(r.S,"Reflect",{enumerate:function t(e){return new i(e);}});},function(t,e,n){var r=n(21),o=n(0),i=n(4);o(o.S,"Reflect",{getOwnPropertyDescriptor:function t(e,n){return r.f(i(e),n);}});},function(t,e,n){var r=n(0),o=n(22),i=n(4);r(r.S,"Reflect",{getPrototypeOf:function t(e){return o(i(e));}});},function(t,e,n){function r(t,e){var n=arguments.length<3?t:arguments[2],s,c;return l(t)===n?t[e]:(s=o.f(t,e))?a(s,"value")?s.value:void 0!==s.get?s.get.call(n):void 0:u(c=i(t))?r(c,e,n):void 0;}var o=n(21),i=n(22),a=n(13),s=n(0),u=n(7),l=n(4);s(s.S,"Reflect",{get:r});},function(t,e,n){var r=n(0);r(r.S,"Reflect",{has:function t(e,n){return n in e;}});},function(t,e,n){var r=n(0),o=n(4),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function t(e){return o(e),!i||i(e);}});},function(t,e,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(163)});},function(t,e,n){var r=n(0),o=n(4),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function t(e){o(e);try{return i&&i(e),!0;}catch(t){return!1;}}});},function(t,e,n){var r=n(0),o=n(111);o&&r(r.S,"Reflect",{setPrototypeOf:function t(e,n){o.check(e,n);try{return o.set(e,n),!0;}catch(t){return!1;}}});},function(t,e,n){function r(t,e,n){var u=arguments.length<4?t:arguments[3],p=i.f(c(t),e),h,d;if(!p){if(f(d=a(t)))return r(d,e,n,u);p=l(0);}return s(p,"value")?!(!1===p.writable||!f(u))&&(h=i.f(u,e)||l(0),h.value=n,o.f(u,e,h),!0):void 0!==p.set&&(p.set.call(u,n),!0);}var o=n(10),i=n(21),a=n(22),s=n(13),u=n(0),l=n(37),c=n(4),f=n(7);u(u.S,"Reflect",{set:r});},function(t,e,n){var r=n(5),o=n(103),i=n(10).f,a=n(43).f,s=n(74),u=n(72),l=r.RegExp,c=l,f=l.prototype,p=/a/g,h=/a/g,d=new l(p)!==p;if(n(9)&&(!d||n(6)(function(){return h[n(8)("match")]=!1,l(p)!=p||l(h)==h||"/a/i"!=l(p,"i");}))){l=function t(e,n){var r=this instanceof l,i=s(e),a=void 0===n;return!r&&i&&e.constructor===l&&a?e:o(d?new c(i&&!a?e.source:e,n):c((i=e instanceof l)?e.source:e,i&&a?u.call(e):n),r?this:f,l);};for(var v=function v(t){(t in l)||i(l,t,{configurable:!0,get:function get(){return c[t];},set:function set(e){c[t]=e;}});},_=a(c),m=0;_.length>m;){v(_[m++]);}f.constructor=l,l.prototype=f,n(16)(r,"RegExp",l);}n(46)("RegExp");},function(t,e,n){n(71)("match",1,function(t,e,n){return[function n(r){"use strict";var o=t(this),i=void 0==r?void 0:r[e];return void 0!==i?i.call(r,o):new RegExp(r)[e](String(o));},n];});},function(t,e,n){n(71)("replace",2,function(t,e,n){return[function r(o,i){"use strict";var a=t(this),s=void 0==o?void 0:o[e];return void 0!==s?s.call(o,a,i):n.call(String(a),o,i);},n];});},function(t,e,n){n(71)("search",1,function(t,e,n){return[function n(r){"use strict";var o=t(this),i=void 0==r?void 0:r[e];return void 0!==i?i.call(r,o):new RegExp(r)[e](String(o));},n];});},function(t,e,n){n(71)("split",2,function(t,e,r){"use strict";var o=n(74),i=r,a=[].push,s="split",u="length",l="lastIndex";if("c"=="abbc"[s](/(b)*/)[1]||4!="test"[s](/(?:)/,-1)[u]||2!="ab"[s](/(?:ab)*/)[u]||4!="."[s](/(.?)(.?)/)[u]||"."[s](/()()/)[u]>1||""[s](/.?/)[u]){var c=void 0===/()??/.exec("")[1];r=function r(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!o(t))return i.call(n,t,e);var r=[],s=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,p=void 0===e?4294967295:e>>>0,h=new RegExp(t.source,s+"g"),d,v,_,m,g;for(c||(d=new RegExp("^"+h.source+"$(?!\\s)",s));(v=h.exec(n))&&!((_=v.index+v[0][u])>f&&(r.push(n.slice(f,v.index)),!c&&v[u]>1&&v[0].replace(d,function(){for(g=1;g<arguments[u]-2;g++){void 0===arguments[g]&&(v[g]=void 0);}}),v[u]>1&&v.index<n[u]&&a.apply(r,v.slice(1)),m=v[0][u],f=_,r[u]>=p));){h[l]===v.index&&h[l]++;}return f===n[u]?!m&&h.test("")||r.push(""):r.push(n.slice(f)),r[u]>p?r.slice(0,p):r;};}else"0"[s](void 0,0)[u]&&(r=function r(t,e){return void 0===t&&0===e?[]:i.call(this,t,e);});return[function n(o,i){var a=t(this),s=void 0==o?void 0:o[e];return void 0!==s?s.call(o,a,i):r.call(String(a),o,i);},r];});},function(t,e,n){"use strict";n(170);var r=n(4),o=n(72),i=n(9),a="toString",s=/./[a],u=function u(t){n(16)(RegExp.prototype,a,t,!0);};n(6)(function(){return"/a/b"!=s.call({source:"a",flags:"b"});})?u(function t(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!i&&e instanceof RegExp?o.call(e):void 0);}):s.name!=a&&u(function t(){return s.call(this);});},function(t,e,n){"use strict";n(17)("anchor",function(t){return function e(n){return t(this,"a","name",n);};});},function(t,e,n){"use strict";n(17)("big",function(t){return function e(){return t(this,"big","","");};});},function(t,e,n){"use strict";n(17)("blink",function(t){return function e(){return t(this,"blink","","");};});},function(t,e,n){"use strict";n(17)("bold",function(t){return function e(){return t(this,"b","","");};});},function(t,e,n){"use strict";var r=n(0),o=n(114)(!1);r(r.P,"String",{codePointAt:function t(e){return o(this,e);}});},function(t,e,n){"use strict";var r=n(0),o=n(11),i=n(115),a="endsWith",s=""[a];r(r.P+r.F*n(101)(a),"String",{endsWith:function t(e){var n=i(this,e,a),r=arguments.length>1?arguments[1]:void 0,u=o(n.length),l=void 0===r?u:Math.min(o(r),u),c=String(e);return s?s.call(n,c,l):n.slice(l-c.length,l)===c;}});},function(t,e,n){"use strict";n(17)("fixed",function(t){return function e(){return t(this,"tt","","");};});},function(t,e,n){"use strict";n(17)("fontcolor",function(t){return function e(n){return t(this,"font","color",n);};});},function(t,e,n){"use strict";n(17)("fontsize",function(t){return function e(n){return t(this,"font","size",n);};});},function(t,e,n){var r=n(0),o=n(47),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function t(e){for(var n=[],r=arguments.length,a=0,s;r>a;){if(s=+arguments[a++],o(s,1114111)!==s)throw RangeError(s+" is not a valid code point");n.push(s<65536?i(s):i(55296+((s-=65536)>>10),s%1024+56320));}return n.join("");}});},function(t,e,n){"use strict";var r=n(0),o=n(115),i="includes";r(r.P+r.F*n(101)(i),"String",{includes:function t(e){return!!~o(this,e,i).indexOf(e,arguments.length>1?arguments[1]:void 0);}});},function(t,e,n){"use strict";n(17)("italics",function(t){return function e(){return t(this,"i","","");};});},function(t,e,n){"use strict";var r=n(114)(!0);n(107)(String,"String",function(t){this._t=String(t),this._i=0;},function(){var t=this._t,e=this._i,n;return e>=t.length?{value:void 0,done:!0}:(n=r(t,e),this._i+=n.length,{value:n,done:!1});});},function(t,e,n){"use strict";n(17)("link",function(t){return function e(n){return t(this,"a","href",n);};});},function(t,e,n){var r=n(0),o=n(18),i=n(11);r(r.S,"String",{raw:function t(e){for(var n=o(e.raw),r=i(n.length),a=arguments.length,s=[],u=0;r>u;){s.push(String(n[u++])),u<a&&s.push(String(arguments[u]));}return s.join("");}});},function(t,e,n){var r=n(0);r(r.P,"String",{repeat:n(116)});},function(t,e,n){"use strict";n(17)("small",function(t){return function e(){return t(this,"small","","");};});},function(t,e,n){"use strict";var r=n(0),o=n(11),i=n(115),a="startsWith",s=""[a];r(r.P+r.F*n(101)(a),"String",{startsWith:function t(e){var n=i(this,e,a),r=o(Math.min(arguments.length>1?arguments[1]:void 0,n.length)),u=String(e);return s?s.call(n,u,r):n.slice(r,r+u.length)===u;}});},function(t,e,n){"use strict";n(17)("strike",function(t){return function e(){return t(this,"strike","","");};});},function(t,e,n){"use strict";n(17)("sub",function(t){return function e(){return t(this,"sub","","");};});},function(t,e,n){"use strict";n(17)("sup",function(t){return function e(){return t(this,"sup","","");};});},function(t,e,n){"use strict";n(56)("trim",function(t){return function e(){return t(this,3);};});},function(t,e,n){"use strict";var r=n(5),o=n(13),i=n(9),a=n(0),s=n(16),u=n(36).KEY,l=n(6),c=n(78),f=n(55),p=n(48),h=n(8),d=n(168),v=n(120),_=n(304),m=n(303),g=n(105),y=n(4),b=n(18),w=n(28),x=n(37),E=n(42),T=n(160),O=n(21),P=n(10),j=n(44),A=O.f,S=P.f,M=T.f,k=r.Symbol,C=r.JSON,R=C&&C.stringify,I="prototype",N=h("_hidden"),F=h("toPrimitive"),U={}.propertyIsEnumerable,L=c("symbol-registry"),D=c("symbols"),B=c("op-symbols"),V=Object[I],X="function"==typeof k,z=r.QObject,W=!z||!z[I]||!z[I].findChild,G=i&&l(function(){return 7!=E(S({},"a",{get:function get(){return S(this,"a",{value:7}).a;}})).a;})?function(t,e,n){var r=A(V,e);r&&delete V[e],S(t,e,n),r&&t!==V&&S(V,e,r);}:S,q=function q(t){var e=D[t]=E(k[I]);return e._k=t,e;},H=X&&"symbol"==_typeof(k.iterator)?function(t){return"symbol"==(typeof t==="undefined"?"undefined":_typeof(t));}:function(t){return t instanceof k;},Y=function t(e,n,r){return e===V&&Y(B,n,r),y(e),n=w(n,!0),y(r),o(D,n)?(r.enumerable?(o(e,N)&&e[N][n]&&(e[N][n]=!1),r=E(r,{enumerable:x(0,!1)})):(o(e,N)||S(e,N,x(1,{})),e[N][n]=!0),G(e,n,r)):S(e,n,r);},K=function t(e,n){y(e);for(var r=m(n=b(n)),o=0,i=r.length,a;i>o;){Y(e,a=r[o++],n[a]);}return e;},$=function t(e,n){return void 0===n?E(e):K(E(e),n);},Q=function t(e){var n=U.call(this,e=w(e,!0));return!(this===V&&o(D,e)&&!o(B,e))&&(!(n||!o(this,e)||!o(D,e)||o(this,N)&&this[N][e])||n);},Z=function t(e,n){if(e=b(e),n=w(n,!0),e!==V||!o(D,n)||o(B,n)){var r=A(e,n);return!r||!o(D,n)||o(e,N)&&e[N][n]||(r.enumerable=!0),r;}},J=function t(e){for(var n=M(b(e)),r=[],i=0,a;n.length>i;){o(D,a=n[i++])||a==N||a==u||r.push(a);}return r;},tt=function t(e){for(var n=e===V,r=M(n?B:b(e)),i=[],a=0,s;r.length>a;){!o(D,s=r[a++])||n&&!o(V,s)||i.push(D[s]);}return i;};X||(k=function t(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),n=function n(t){this===V&&n.call(B,t),o(this,N)&&o(this[N],e)&&(this[N][e]=!1),G(this,e,x(1,t));};return i&&W&&G(V,e,{configurable:!0,set:n}),q(e);},s(k[I],"toString",function t(){return this._k;}),O.f=Z,P.f=Y,n(43).f=T.f=J,n(63).f=Q,n(77).f=tt,i&&!n(41)&&s(V,"propertyIsEnumerable",Q,!0),d.f=function(t){return q(h(t));}),a(a.G+a.W+a.F*!X,{Symbol:k});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;){h(et[nt++]);}for(var et=j(h.store),nt=0;et.length>nt;){v(et[nt++]);}a(a.S+a.F*!X,"Symbol",{for:function _for(t){return o(L,t+="")?L[t]:L[t]=k(t);},keyFor:function t(e){if(H(e))return _(L,e);throw TypeError(e+" is not a symbol!");},useSetter:function useSetter(){W=!0;},useSimple:function useSimple(){W=!1;}}),a(a.S+a.F*!X,"Object",{create:$,defineProperty:Y,defineProperties:K,getOwnPropertyDescriptor:Z,getOwnPropertyNames:J,getOwnPropertySymbols:tt}),C&&a(a.S+a.F*(!X||l(function(){var t=k();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t));})),"JSON",{stringify:function t(e){if(void 0!==e&&!H(e)){for(var n=[e],r=1,o,i;arguments.length>r;){n.push(arguments[r++]);}return o=n[1],"function"==typeof o&&(i=o),!i&&g(o)||(o=function o(t,e){if(i&&(e=i.call(this,t,e)),!H(e))return e;}),n[1]=o,R.apply(C,n);}}}),k[I][F]||n(15)(k[I],F,k[I].valueOf),f(k,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0);},function(t,e,n){"use strict";var r=n(0),o=n(79),i=n(119),a=n(4),s=n(47),u=n(11),l=n(7),c=n(5).ArrayBuffer,f=n(113),p=i.ArrayBuffer,h=i.DataView,d=o.ABV&&c.isView,v=p.prototype.slice,_=o.VIEW,m="ArrayBuffer";r(r.G+r.W+r.F*(c!==p),{ArrayBuffer:p}),r(r.S+r.F*!o.CONSTR,m,{isView:function t(e){return d&&d(e)||l(e)&&_ in e;}}),r(r.P+r.U+r.F*n(6)(function(){return!new p(2).slice(1,void 0).byteLength;}),m,{slice:function t(e,n){if(void 0!==v&&void 0===n)return v.call(a(this),e);for(var r=a(this).byteLength,o=s(e,r),i=s(void 0===n?r:n,r),l=new(f(this,p))(u(i-o)),c=new h(this),d=new h(l),_=0;o<i;){d.setUint8(_++,c.getUint8(o++));}return l;}}),n(46)(m);},function(t,e,n){var r=n(0);r(r.G+r.W+r.F*!n(79).ABV,{DataView:n(119).DataView});},function(t,e,n){n(34)("Float32",4,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Float64",8,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Int16",2,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Int32",4,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Int8",1,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Uint16",2,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Uint32",4,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Uint8",1,function(t){return function e(n,r,o){return t(this,n,r,o);};});},function(t,e,n){n(34)("Uint8",1,function(t){return function e(n,r,o){return t(this,n,r,o);};},!0);},function(t,e,n){"use strict";var r=n(152);n(70)("WeakSet",function(t){return function e(){return t(this,arguments.length>0?arguments[0]:void 0);};},{add:function t(e){return r.def(this,e,!0);}},r,!1,!0);},function(t,e,n){"use strict";var r=n(0),o=n(69)(!0);r(r.P,"Array",{includes:function t(e){return o(this,e,arguments.length>1?arguments[1]:void 0);}}),n(52)("includes");},function(t,e,n){var r=n(0),o=n(110)(),i=n(5).process,a="process"==n(23)(i);r(r.G,{asap:function t(e){var n=a&&i.domain;o(n?n.bind(e):e);}});},function(t,e,n){var r=n(0),o=n(23);r(r.S,"Error",{isError:function t(e){return"Error"===o(e);}});},function(t,e,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(151)("Map")});},function(t,e,n){var r=n(0);r(r.S,"Math",{iaddh:function t(e,n,r,o){var i=e>>>0,a=n>>>0,s=r>>>0;return a+(o>>>0)+((i&s|(i|s)&~(i+s>>>0))>>>31)|0;}});},function(t,e,n){var r=n(0);r(r.S,"Math",{imulh:function t(e,n){var r=65535,o=+e,i=+n,a=65535&o,s=65535&i,u=o>>16,l=i>>16,c=(u*s>>>0)+(a*s>>>16);return u*l+(c>>16)+((a*l>>>0)+(65535&c)>>16);}});},function(t,e,n){var r=n(0);r(r.S,"Math",{isubh:function t(e,n,r,o){var i=e>>>0,a=n>>>0,s=r>>>0;return a-(o>>>0)-((~i&s|~(i^s)&i-s>>>0)>>>31)|0;}});},function(t,e,n){var r=n(0);r(r.S,"Math",{umulh:function t(e,n){var r=65535,o=+e,i=+n,a=65535&o,s=65535&i,u=o>>>16,l=i>>>16,c=(u*s>>>0)+(a*s>>>16);return u*l+(c>>>16)+((a*l>>>0)+(65535&c)>>>16);}});},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(14),a=n(10);n(9)&&r(r.P+n(76),"Object",{__defineGetter__:function t(e,n){a.f(o(this),e,{get:i(n),enumerable:!0,configurable:!0});}});},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(14),a=n(10);n(9)&&r(r.P+n(76),"Object",{__defineSetter__:function t(e,n){a.f(o(this),e,{set:i(n),enumerable:!0,configurable:!0});}});},function(t,e,n){var r=n(0),o=n(162)(!0);r(r.S,"Object",{entries:function t(e){return o(e);}});},function(t,e,n){var r=n(0),o=n(163),i=n(18),a=n(21),s=n(98);r(r.S,"Object",{getOwnPropertyDescriptors:function t(e){for(var n=i(e),r=a.f,u=o(n),l={},c=0,f;u.length>c;){s(l,f=u[c++],r(n,f));}return l;}});},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(28),a=n(22),s=n(21).f;n(9)&&r(r.P+n(76),"Object",{__lookupGetter__:function t(e){var n=o(this),r=i(e,!0),u;do{if(u=s(n,r))return u.get;}while(n=a(n));}});},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(28),a=n(22),s=n(21).f;n(9)&&r(r.P+n(76),"Object",{__lookupSetter__:function t(e){var n=o(this),r=i(e,!0),u;do{if(u=s(n,r))return u.set;}while(n=a(n));}});},function(t,e,n){var r=n(0),o=n(162)(!1);r(r.S,"Object",{values:function t(e){return o(e);}});},function(t,e,n){"use strict";var r=n(0),o=n(5),i=n(31),a=n(110)(),s=n(8)("observable"),u=n(14),l=n(4),c=n(40),f=n(45),p=n(15),h=n(53),d=h.RETURN,v=function v(t){return null==t?void 0:u(t);},_=function _(t){var e=t._c;e&&(t._c=void 0,e());},m=function m(t){return void 0===t._o;},g=function g(t){m(t)||(t._o=void 0,_(t));},y=function y(t,e){l(t),this._c=void 0,this._o=t,t=new b(this);try{var n=e(t),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function n(){r.unsubscribe();}:u(n),this._c=n);}catch(e){return void t.error(e);}m(this)&&_(this);};y.prototype=f({},{unsubscribe:function t(){g(this);}});var b=function b(t){this._s=t;};b.prototype=f({},{next:function t(e){var n=this._s;if(!m(n)){var r=n._o;try{var o=v(r.next);if(o)return o.call(r,e);}catch(t){try{g(n);}finally{throw t;}}}},error:function t(e){var n=this._s;if(m(n))throw e;var r=n._o;n._o=void 0;try{var o=v(r.error);if(!o)throw e;e=o.call(r,e);}catch(t){try{_(n);}finally{throw t;}}return _(n),e;},complete:function t(e){var n=this._s;if(!m(n)){var r=n._o;n._o=void 0;try{var o=v(r.complete);e=o?o.call(r,e):void 0;}catch(t){try{_(n);}finally{throw t;}}return _(n),e;}}});var w=function t(e){c(this,w,"Observable","_f")._f=u(e);};f(w.prototype,{subscribe:function t(e){return new y(e,this._f);},forEach:function t(e){var n=this;return new(i.Promise||o.Promise)(function(t,r){u(e);var o=n.subscribe({next:function next(t){try{return e(t);}catch(t){r(t),o.unsubscribe();}},error:r,complete:t});});}}),f(w,{from:function t(e){var n="function"==typeof this?this:w,r=v(l(e)[s]);if(r){var o=l(r.call(e));return o.constructor===n?o:new n(function(t){return o.subscribe(t);});}return new n(function(t){var n=!1;return a(function(){if(!n){try{if(h(e,!1,function(e){if(t.next(e),n)return d;})===d)return;}catch(e){if(n)throw e;return void t.error(e);}t.complete();}}),function(){n=!0;};});},of:function t(){for(var e=0,n=arguments.length,r=Array(n);e<n;){r[e]=arguments[e++];}return new("function"==typeof this?this:w)(function(t){var e=!1;return a(function(){if(!e){for(var n=0;n<r.length;++n){if(t.next(r[n]),e)return;}t.complete();}}),function(){e=!0;};});}}),p(w.prototype,s,function(){return this;}),r(r.G,{Observable:w}),n(46)("Observable");},function(t,e,n){var r=n(33),o=n(4),i=r.key,a=r.set;r.exp({defineMetadata:function t(e,n,r,s){a(e,n,o(r),i(s));}});},function(t,e,n){var r=n(33),o=n(4),i=r.key,a=r.map,s=r.store;r.exp({deleteMetadata:function t(e,n){var r=arguments.length<3?void 0:i(arguments[2]),u=a(o(n),r,!1);if(void 0===u||!u.delete(e))return!1;if(u.size)return!0;var l=s.get(n);return l.delete(r),!!l.size||s.delete(n);}});},function(t,e,n){var r=n(171),o=n(147),i=n(33),a=n(4),s=n(22),u=i.keys,l=i.key,c=function c(t,e){var n=u(t,e),i=s(t);if(null===i)return n;var a=c(i,e);return a.length?n.length?o(new r(n.concat(a))):a:n;};i.exp({getMetadataKeys:function t(e){return c(a(e),arguments.length<2?void 0:l(arguments[1]));}});},function(t,e,n){var r=n(33),o=n(4),i=n(22),a=r.has,s=r.get,u=r.key,l=function l(t,e,n){if(a(t,e,n))return s(t,e,n);var r=i(e);return null!==r?l(t,r,n):void 0;};r.exp({getMetadata:function t(e,n){return l(e,o(n),arguments.length<3?void 0:u(arguments[2]));}});},function(t,e,n){var r=n(33),o=n(4),i=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function t(e){return i(o(e),arguments.length<2?void 0:a(arguments[1]));}});},function(t,e,n){var r=n(33),o=n(4),i=r.get,a=r.key;r.exp({getOwnMetadata:function t(e,n){return i(e,o(n),arguments.length<3?void 0:a(arguments[2]));}});},function(t,e,n){var r=n(33),o=n(4),i=n(22),a=r.has,s=r.key,u=function u(t,e,n){if(a(t,e,n))return!0;var r=i(e);return null!==r&&u(t,r,n);};r.exp({hasMetadata:function t(e,n){return u(e,o(n),arguments.length<3?void 0:s(arguments[2]));}});},function(t,e,n){var r=n(33),o=n(4),i=r.has,a=r.key;r.exp({hasOwnMetadata:function t(e,n){return i(e,o(n),arguments.length<3?void 0:a(arguments[2]));}});},function(t,e,n){var r=n(33),o=n(4),i=n(14),a=r.key,s=r.set;r.exp({metadata:function t(e,n){return function t(r,u){s(e,n,(void 0!==u?o:i)(r),a(u));};}});},function(t,e,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(151)("Set")});},function(t,e,n){"use strict";var r=n(0),o=n(114)(!0);r(r.P,"String",{at:function t(e){return o(this,e);}});},function(t,e,n){"use strict";var r=n(0),o=n(24),i=n(11),a=n(74),s=n(72),u=RegExp.prototype,l=function l(t,e){this._r=t,this._s=e;};n(106)(l,"RegExp String",function t(){var e=this._r.exec(this._s);return{value:e,done:null===e};}),r(r.P,"String",{matchAll:function t(e){if(o(this),!a(e))throw TypeError(e+" is not a regexp!");var n=String(this),r="flags"in u?String(e.flags):s.call(e),c=new RegExp(e.source,~r.indexOf("g")?r:"g"+r);return c.lastIndex=i(e.lastIndex),new l(c,n);}});},function(t,e,n){"use strict";var r=n(0),o=n(167);r(r.P,"String",{padEnd:function t(e){return o(this,e,arguments.length>1?arguments[1]:void 0,!1);}});},function(t,e,n){"use strict";var r=n(0),o=n(167);r(r.P,"String",{padStart:function t(e){return o(this,e,arguments.length>1?arguments[1]:void 0,!0);}});},function(t,e,n){"use strict";n(56)("trimLeft",function(t){return function e(){return t(this,1);};},"trimStart");},function(t,e,n){"use strict";n(56)("trimRight",function(t){return function e(){return t(this,2);};},"trimEnd");},function(t,e,n){n(120)("asyncIterator");},function(t,e,n){n(120)("observable");},function(t,e,n){var r=n(0);r(r.S,"System",{global:n(5)});},function(t,e,n){for(var r=n(122),o=n(16),i=n(5),a=n(15),s=n(54),u=n(8),l=u("iterator"),c=u("toStringTag"),f=s.Array,p=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],h=0;h<5;h++){var d=p[h],v=i[d],_=v&&v.prototype,m;if(_){_[l]||a(_,l,f),_[c]||a(_,c,d),s[d]=f;for(m in r){_[m]||o(_,m,r[m],!0);}}}},function(t,e,n){var r=n(0),o=n(118);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear});},function(t,e,n){var r=n(5),o=n(0),i=n(73),a=n(305),s=r.navigator,u=!!s&&/MSIE .\./.test(s.userAgent),l=function l(t){return u?function(e,n){return t(i(a,[].slice.call(arguments,2),"function"==typeof e?e:Function(e)),n);}:t;};o(o.G+o.B+o.F*u,{setTimeout:l(r.setTimeout),setInterval:l(r.setInterval)});},function(t,e,n){n(428),n(367),n(369),n(368),n(371),n(373),n(378),n(372),n(370),n(380),n(379),n(375),n(376),n(374),n(366),n(377),n(381),n(382),n(334),n(336),n(335),n(384),n(383),n(354),n(364),n(365),n(355),n(356),n(357),n(358),n(359),n(360),n(361),n(362),n(363),n(337),n(338),n(339),n(340),n(341),n(342),n(343),n(344),n(345),n(346),n(347),n(348),n(349),n(350),n(351),n(352),n(353),n(415),n(420),n(427),n(418),n(410),n(411),n(416),n(421),n(423),n(406),n(407),n(408),n(409),n(412),n(413),n(414),n(417),n(419),n(422),n(424),n(425),n(426),n(329),n(331),n(330),n(333),n(332),n(318),n(316),n(322),n(319),n(325),n(327),n(315),n(321),n(312),n(326),n(310),n(324),n(323),n(317),n(320),n(309),n(311),n(314),n(313),n(328),n(122),n(400),n(405),n(170),n(401),n(402),n(403),n(404),n(385),n(169),n(171),n(172),n(440),n(429),n(430),n(435),n(438),n(439),n(433),n(436),n(434),n(437),n(431),n(432),n(386),n(387),n(388),n(389),n(390),n(393),n(391),n(392),n(394),n(395),n(396),n(397),n(399),n(398),n(441),n(467),n(470),n(469),n(471),n(472),n(468),n(473),n(474),n(452),n(455),n(451),n(449),n(450),n(453),n(454),n(444),n(466),n(475),n(443),n(445),n(447),n(446),n(448),n(457),n(458),n(460),n(459),n(462),n(461),n(463),n(464),n(465),n(442),n(456),n(478),n(477),n(476),t.exports=n(31);},function(t,e,n){"use strict";function r(t,e,n){var r=t.length,o=e.arrayArgs.length,i=e.indexArgs.length>0,a=[],s=[],u=0,l=0,c,f;for(c=0;c<r;++c){s.push(["i",c,"=0"].join(""));}for(f=0;f<o;++f){for(c=0;c<r;++c){l=u,u=t[c],0===c?s.push(["d",f,"s",c,"=t",f,"p",u].join("")):s.push(["d",f,"s",c,"=(t",f,"p",u,"-s",l,"*t",f,"p",l,")"].join(""));}}for(a.push("var "+s.join(",")),c=r-1;c>=0;--c){u=t[c],a.push(["for(i",c,"=0;i",c,"<s",u,";++i",c,"){"].join(""));}for(a.push(n),c=0;c<r;++c){for(l=u,u=t[c],f=0;f<o;++f){a.push(["p",f,"+=d",f,"s",c].join(""));}i&&(c>0&&a.push(["index[",l,"]-=s",l].join("")),a.push(["++index[",u,"]"].join(""))),a.push("}");}return a.join("\n");}function o(t,e,n,o){for(var i=e.length,a=n.arrayArgs.length,s=n.blockSize,u=n.indexArgs.length>0,l=[],c=0;c<a;++c){l.push(["var offset",c,"=p",c].join(""));}for(var c=t;c<i;++c){l.push(["for(var j"+c+"=SS[",e[c],"]|0;j",c,">0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",e[c],"]=j",c].join(""));}for(var c=0;c<a;++c){for(var f=["offset"+c],p=t;p<i;++p){f.push(["j",p,"*t",c,"p",e[p]].join(""));}l.push(["p",c,"=(",f.join("+"),")"].join(""));}l.push(r(e,n,o));for(var c=t;c<i;++c){l.push("}");}return l.join("\n");}function i(t){for(var e=0,n=t[0].length;e<n;){for(var r=1;r<t.length;++r){if(t[r][e]!==t[0][e])return e;}++e;}return e;}function a(t,e,n){for(var r=t.body,o=[],i=[],a=0;a<t.args.length;++a){var s=t.args[a];if(!(s.count<=0)){var u=new RegExp(s.name,"g"),l="",c=e.arrayArgs.indexOf(a);switch(e.argTypes[a]){case"offset":var f=e.offsetArgIndex.indexOf(a);c=e.offsetArgs[f].array,l="+q"+f;case"array":l="p"+c+l;var p="l"+a,h="a"+c;if(0===e.arrayBlockIndices[c])1===s.count?"generic"===n[c]?s.lvalue?(o.push(["var ",p,"=",h,".get(",l,")"].join("")),r=r.replace(u,p),i.push([h,".set(",l,",",p,")"].join(""))):r=r.replace(u,[h,".get(",l,")"].join("")):r=r.replace(u,[h,"[",l,"]"].join("")):"generic"===n[c]?(o.push(["var ",p,"=",h,".get(",l,")"].join("")),r=r.replace(u,p),s.lvalue&&i.push([h,".set(",l,",",p,")"].join(""))):(o.push(["var ",p,"=",h,"[",l,"]"].join("")),r=r.replace(u,p),s.lvalue&&i.push([h,"[",l,"]=",p].join("")));else{for(var d=[s.name],v=[l],_=0;_<Math.abs(e.arrayBlockIndices[c]);_++){d.push("\\s*\\[([^\\]]+)\\]"),v.push("$"+(_+1)+"*t"+c+"b"+_);}if(u=new RegExp(d.join(""),"g"),l=v.join("+"),"generic"===n[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");r=r.replace(u,[h,"[",l,"]"].join(""));}break;case"scalar":r=r.replace(u,"Y"+e.scalarArgs.indexOf(a));break;case"index":r=r.replace(u,"index");break;case"shape":r=r.replace(u,"shape");}}}return[o.join("\n"),r,i.join("\n")].join("\n").trim();}function s(t){for(var e=new Array(t.length),n=!0,r=0;r<t.length;++r){var o=t[r],i=o.match(/\d+/);i=i?i[0]:"",0===o.charAt(0)?e[r]="u"+o.charAt(1)+i:e[r]=o.charAt(0)+i,r>0&&(n=n&&e[r]===e[r-1]);}return n?e[0]:e.join("");}function u(t,e){for(var n=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,u=new Array(t.arrayArgs.length),c=new Array(t.arrayArgs.length),f=0;f<t.arrayArgs.length;++f){c[f]=e[2*f],u[f]=e[2*f+1];}for(var p=[],h=[],d=[],v=[],_=[],f=0;f<t.arrayArgs.length;++f){t.arrayBlockIndices[f]<0?(d.push(0),v.push(n),p.push(n),h.push(n+t.arrayBlockIndices[f])):(d.push(t.arrayBlockIndices[f]),v.push(t.arrayBlockIndices[f]+n),p.push(0),h.push(t.arrayBlockIndices[f]));for(var m=[],g=0;g<u[f].length;g++){d[f]<=u[f][g]&&u[f][g]<v[f]&&m.push(u[f][g]-d[f]);}_.push(m);}for(var y=["SS"],b=["'use strict'"],w=[],g=0;g<n;++g){w.push(["s",g,"=SS[",g,"]"].join(""));}for(var f=0;f<t.arrayArgs.length;++f){y.push("a"+f),y.push("t"+f),y.push("p"+f);for(var g=0;g<n;++g){w.push(["t",f,"p",g,"=t",f,"[",d[f]+g,"]"].join(""));}for(var g=0;g<Math.abs(t.arrayBlockIndices[f]);++g){w.push(["t",f,"b",g,"=t",f,"[",p[f]+g,"]"].join(""));}}for(var f=0;f<t.scalarArgs.length;++f){y.push("Y"+f);}if(t.shapeArgs.length>0&&w.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var x=new Array(n),f=0;f<n;++f){x[f]="0";}w.push(["index=[",x.join(","),"]"].join(""));}for(var f=0;f<t.offsetArgs.length;++f){for(var E=t.offsetArgs[f],T=[],g=0;g<E.offset.length;++g){0!==E.offset[g]&&(1===E.offset[g]?T.push(["t",E.array,"p",g].join("")):T.push([E.offset[g],"*t",E.array,"p",g].join("")));}0===T.length?w.push("q"+f+"=0"):w.push(["q",f,"=",T.join("+")].join(""));}var O=l([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));w=w.concat(O),b.push("var "+w.join(","));for(var f=0;f<t.arrayArgs.length;++f){b.push("p"+f+"|=0");}t.pre.body.length>3&&b.push(a(t.pre,t,c));var P=a(t.body,t,c),j=i(_);j<n?b.push(o(j,_[0],t,P)):b.push(r(_[0],t,P)),t.post.body.length>3&&b.push(a(t.post,t,c)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+b.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",u[0].join("s"),"m",j,s(c)].join("");return new Function(["function ",A,"(",y.join(","),"){",b.join("\n"),"} return ",A].join(""))();}var l=n(200);t.exports=u;},function(t,e,n){"use strict";function r(t){var e=["'use strict'","var CACHED={}"],n=[],r=t.funcName+"_cwise_thunk";e.push(["return function ",r,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c<t.arrayArgs.length;++c){var f=t.arrayArgs[c];n.push(["t",f,"=array",f,".dtype,","r",f,"=array",f,".order"].join("")),i.push("t"+f),i.push("r"+f),a.push("t"+f),a.push("r"+f+".join()"),s.push("array"+f+".data"),s.push("array"+f+".stride"),s.push("array"+f+".offset|0"),c>0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"));}t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var c=0;c<t.scalarArgs.length;++c){s.push("scalar"+t.scalarArgs[c]);}return n.push(["type=[",a.join(","),"].join()"].join("")),n.push("proc=CACHED[type]"),e.push("var "+n.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",i.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(o.bind(void 0,t));}var o=n(480);t.exports=r;},function(t,e,n){"use strict";(function(e){function r(t,e,n){this.name=t,this.lvalue=e,this.rvalue=n,this.count=0;}function o(t,e,n,r){this.body=t,this.args=e,this.thisVars=n,this.localVars=r;}function i(t){if("eval"===t)throw new Error("cwise-parser: eval() not allowed");return"undefined"!=typeof window?t in window:void 0!==e?t in e:"undefined"!=typeof self&&t in self;}function a(t){for(var e=t.body[0].expression.callee.params,n=new Array(e.length),r=0;r<e.length;++r){n[r]=e[r].name;}return n;}function s(t){function e(t){var e=_+t.replace(/\_/g,"__");return x.push(e),e;}function n(t){var e="this_"+t.replace(/\_/g,"__");return E.push(e),e;}function s(t,e){for(var n=t.range[0],r=t.range[1],o=n+1;o<r;++o){b[o]="";}b[n]=e;}function f(t){return"'"+t.replace(/\_/g,"\\_").replace(/\'/g,"'")+"'";}function p(t){return b.slice(t.range[0],t.range[1]).join("");}function h(t){return"AssignmentExpression"===t.parent.type&&t.parent.left===t?"="===t.parent.operator?O:O|P:"UpdateExpression"===t.parent.type?O|P:P;}for(var d=["(",t,")()"].join(""),v=u.parse(d,{range:!0}),_="_inline_"+c++ +"_",m=a(v),g=new Array(m.length),y=0;y<m.length;++y){g[y]=new r([_,"arg",y,"_"].join(""),!1,!1);}for(var b=new Array(d.length),y=0,w=d.length;y<w;++y){b[y]=d.charAt(y);}var x=[],E=[],T=!1,O=1,P=2;return function t(r,o){if(r.parent=o,"MemberExpression"===r.type)r.computed?(t(r.object,r),t(r.property,r)):"ThisExpression"===r.object.type?s(r,n(r.property.name)):t(r.object,r);else{if("ThisExpression"===r.type)throw new Error("cwise-parser: Computed this is not allowed");if("Identifier"===r.type){var a=r.name,u=m.indexOf(a);if(u>=0){var l=g[u],c=h(r);c&O&&(l.lvalue=!0),c&P&&(l.rvalue=!0),++l.count,s(r,l.name);}else i(a)||s(r,e(a));}else if("Literal"===r.type)"string"==typeof r.value&&s(r,f(r.value));else{if("WithStatement"===r.type)throw new Error("cwise-parser: with() statements not allowed");for(var p=Object.keys(r),d=0,v=p.length;d<v;++d){if("parent"!==p[d]){var _=r[p[d]];if(_)if(_ instanceof Array)for(var y=0;y<_.length;++y){_[y]&&"string"==typeof _[y].type&&t(_[y],r);}else"string"==typeof _.type&&t(_,r);}}}}}(v.body[0].expression.callee.body,void 0),l(x),l(E),new o(p(v.body[0].expression.callee.body),g,E,x);}var u=n(483),l=n(200),c=0;t.exports=s;}).call(e,n(39));},function(t,e,n){var r,o,i;!function(n,a){"use strict";o=[e],r=a,void 0!==(i="function"==typeof r?r.apply(e,o):r)&&(t.exports=i);}(this,function(t){"use strict";function e(t,e){if(!t)throw new Error("ASSERT: "+e);}function n(t){return t>=48&&t<=57;}function r(t){return"0123456789abcdefABCDEF".indexOf(t)>=0;}function o(t){return"01234567".indexOf(t)>=0;}function i(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0;}function a(t){return 10===t||13===t||8232===t||8233===t;}function s(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&ie.NonAsciiIdentifierStart.test(String.fromCharCode(t));}function u(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&ie.NonAsciiIdentifierPart.test(String.fromCharCode(t));}function l(t){switch(t){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1;}}function c(t){switch(t){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1;}}function f(t){return"eval"===t||"arguments"===t;}function p(t){if(ue&&c(t))return!0;switch(t.length){case 2:return"if"===t||"in"===t||"do"===t;case 3:return"var"===t||"for"===t||"new"===t||"try"===t||"let"===t;case 4:return"this"===t||"else"===t||"case"===t||"void"===t||"with"===t||"enum"===t;case 5:return"while"===t||"break"===t||"catch"===t||"throw"===t||"const"===t||"yield"===t||"class"===t||"super"===t;case 6:return"return"===t||"typeof"===t||"delete"===t||"switch"===t||"export"===t||"import"===t;case 7:return"default"===t||"finally"===t||"extends"===t;case 8:return"function"===t||"continue"===t||"debugger"===t;case 10:return"instanceof"===t;default:return!1;}}function h(t,n,r,o,i){var a,s;e("number"==typeof r,"Comment must have valid position"),ve.lastCommentStart>=r||(ve.lastCommentStart=r,a={type:t,value:n},_e.range&&(a.range=[r,o]),_e.loc&&(a.loc=i),_e.comments.push(a),_e.attachComment&&(_e.leadingComments.push(a),_e.trailingComments.push(a)));}function d(t){var e,n,r,o;for(e=le-t,n={start:{line:ce,column:le-fe-t}};le<pe;){if(r=se.charCodeAt(le),++le,a(r))return _e.comments&&(o=se.slice(e+t,le-1),n.end={line:ce,column:le-fe-1},h("Line",o,e,le-1,n)),13===r&&10===se.charCodeAt(le)&&++le,++ce,void(fe=le);}_e.comments&&(o=se.slice(e+t,le),n.end={line:ce,column:le-fe},h("Line",o,e,le,n));}function v(){var t,e,n,r;for(_e.comments&&(t=le-2,e={start:{line:ce,column:le-fe-2}});le<pe;){if(n=se.charCodeAt(le),a(n))13===n&&10===se.charCodeAt(le+1)&&++le,++ce,++le,fe=le,le>=pe&&V({},oe.UnexpectedToken,"ILLEGAL");else if(42===n){if(47===se.charCodeAt(le+1))return++le,++le,void(_e.comments&&(r=se.slice(t+2,le-2),e.end={line:ce,column:le-fe},h("Block",r,t,le,e)));++le;}else++le;}V({},oe.UnexpectedToken,"ILLEGAL");}function _(){var t,e;for(e=0===le;le<pe;){if(t=se.charCodeAt(le),i(t))++le;else if(a(t))++le,13===t&&10===se.charCodeAt(le)&&++le,++ce,fe=le,e=!0;else if(47===t){if(47===(t=se.charCodeAt(le+1)))++le,++le,d(2),e=!0;else{if(42!==t)break;++le,++le,v();}}else if(e&&45===t){if(45!==se.charCodeAt(le+1)||62!==se.charCodeAt(le+2))break;le+=3,d(3);}else{if(60!==t)break;if("!--"!==se.slice(le+1,le+4))break;++le,++le,++le,++le,d(4);}}}function m(t){var e,n,o,i=0;for(n="u"===t?4:2,e=0;e<n;++e){if(!(le<pe&&r(se[le])))return"";o=se[le++],i=16*i+"0123456789abcdef".indexOf(o.toLowerCase());}return String.fromCharCode(i);}function g(){var t,e;for(t=se.charCodeAt(le++),e=String.fromCharCode(t),92===t&&(117!==se.charCodeAt(le)&&V({},oe.UnexpectedToken,"ILLEGAL"),++le,t=m("u"),t&&"\\"!==t&&s(t.charCodeAt(0))||V({},oe.UnexpectedToken,"ILLEGAL"),e=t);le<pe&&(t=se.charCodeAt(le),u(t));){++le,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==se.charCodeAt(le)&&V({},oe.UnexpectedToken,"ILLEGAL"),++le,t=m("u"),t&&"\\"!==t&&u(t.charCodeAt(0))||V({},oe.UnexpectedToken,"ILLEGAL"),e+=t);}return e;}function y(){var t,e;for(t=le++;le<pe;){if(92===(e=se.charCodeAt(le)))return le=t,g();if(!u(e))break;++le;}return se.slice(t,le);}function b(){var t,e,n;return t=le,e=92===se.charCodeAt(le)?g():y(),n=1===e.length?Jt.Identifier:p(e)?Jt.Keyword:"null"===e?Jt.NullLiteral:"true"===e||"false"===e?Jt.BooleanLiteral:Jt.Identifier,{type:n,value:e,lineNumber:ce,lineStart:fe,start:t,end:le};}function w(){var t=le,e=se.charCodeAt(le),n,r=se[le],o,i,a;switch(e){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++le,_e.tokenize&&(40===e?_e.openParenToken=_e.tokens.length:123===e&&(_e.openCurlyToken=_e.tokens.length)),{type:Jt.Punctuator,value:String.fromCharCode(e),lineNumber:ce,lineStart:fe,start:t,end:le};default:if(61===(n=se.charCodeAt(le+1)))switch(e){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return le+=2,{type:Jt.Punctuator,value:String.fromCharCode(e)+String.fromCharCode(n),lineNumber:ce,lineStart:fe,start:t,end:le};case 33:case 61:return le+=2,61===se.charCodeAt(le)&&++le,{type:Jt.Punctuator,value:se.slice(t,le),lineNumber:ce,lineStart:fe,start:t,end:le};}}return">>>="===(a=se.substr(le,4))?(le+=4,{type:Jt.Punctuator,value:a,lineNumber:ce,lineStart:fe,start:t,end:le}):">>>"===(i=a.substr(0,3))||"<<="===i||">>="===i?(le+=3,{type:Jt.Punctuator,value:i,lineNumber:ce,lineStart:fe,start:t,end:le}):(o=i.substr(0,2),r===o[1]&&"+-<>&|".indexOf(r)>=0||"=>"===o?(le+=2,{type:Jt.Punctuator,value:o,lineNumber:ce,lineStart:fe,start:t,end:le}):"<>=!+-*%&|^/".indexOf(r)>=0?(++le,{type:Jt.Punctuator,value:r,lineNumber:ce,lineStart:fe,start:t,end:le}):void V({},oe.UnexpectedToken,"ILLEGAL"));}function x(t){for(var e="";le<pe&&r(se[le]);){e+=se[le++];}return 0===e.length&&V({},oe.UnexpectedToken,"ILLEGAL"),s(se.charCodeAt(le))&&V({},oe.UnexpectedToken,"ILLEGAL"),{type:Jt.NumericLiteral,value:parseInt("0x"+e,16),lineNumber:ce,lineStart:fe,start:t,end:le};}function E(t){for(var e="0"+se[le++];le<pe&&o(se[le]);){e+=se[le++];}return(s(se.charCodeAt(le))||n(se.charCodeAt(le)))&&V({},oe.UnexpectedToken,"ILLEGAL"),{type:Jt.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:ce,lineStart:fe,start:t,end:le};}function T(){var t,e;for(t=le+1;t<pe;++t){if("8"===(e=se[t])||"9"===e)return!1;if(!o(e))return!0;}return!0;}function O(){var t,r,i;if(i=se[le],e(n(i.charCodeAt(0))||"."===i,"Numeric literal must start with a decimal digit or a decimal point"),r=le,t="","."!==i){if(t=se[le++],i=se[le],"0"===t){if("x"===i||"X"===i)return++le,x(r);if(o(i)&&T())return E(r);}for(;n(se.charCodeAt(le));){t+=se[le++];}i=se[le];}if("."===i){for(t+=se[le++];n(se.charCodeAt(le));){t+=se[le++];}i=se[le];}if("e"===i||"E"===i)if(t+=se[le++],i=se[le],"+"!==i&&"-"!==i||(t+=se[le++]),n(se.charCodeAt(le)))for(;n(se.charCodeAt(le));){t+=se[le++];}else V({},oe.UnexpectedToken,"ILLEGAL");return s(se.charCodeAt(le))&&V({},oe.UnexpectedToken,"ILLEGAL"),{type:Jt.NumericLiteral,value:parseFloat(t),lineNumber:ce,lineStart:fe,start:r,end:le};}function P(){var t="",n,r,i,s,u,l,c=!1,f,p;for(f=ce,p=fe,n=se[le],e("'"===n||'"'===n,"String literal must starts with a quote"),r=le,++le;le<pe;){if((i=se[le++])===n){n="";break;}if("\\"===i){if((i=se[le++])&&a(i.charCodeAt(0)))++ce,"\r"===i&&"\n"===se[le]&&++le,fe=le;else switch(i){case"u":case"x":l=le,u=m(i),u?t+=u:(le=l,t+=i);break;case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:o(i)?(s="01234567".indexOf(i),0!==s&&(c=!0),le<pe&&o(se[le])&&(c=!0,s=8*s+"01234567".indexOf(se[le++]),"0123".indexOf(i)>=0&&le<pe&&o(se[le])&&(s=8*s+"01234567".indexOf(se[le++]))),t+=String.fromCharCode(s)):t+=i;}}else{if(a(i.charCodeAt(0)))break;t+=i;}}return""!==n&&V({},oe.UnexpectedToken,"ILLEGAL"),{type:Jt.StringLiteral,value:t,octal:c,startLineNumber:f,startLineStart:p,lineNumber:ce,lineStart:fe,start:r,end:le};}function j(t,e){var n;try{n=new RegExp(t,e);}catch(t){V({},oe.InvalidRegExp);}return n;}function A(){var t,n,r,o,i;for(t=se[le],e("/"===t,"Regular expression literal must start with a slash"),n=se[le++],r=!1,o=!1;le<pe;){if(t=se[le++],n+=t,"\\"===t)t=se[le++],a(t.charCodeAt(0))&&V({},oe.UnterminatedRegExp),n+=t;else if(a(t.charCodeAt(0)))V({},oe.UnterminatedRegExp);else if(r)"]"===t&&(r=!1);else{if("/"===t){o=!0;break;}"["===t&&(r=!0);}}return o||V({},oe.UnterminatedRegExp),i=n.substr(1,n.length-2),{value:i,literal:n};}function S(){var t,e,n,r;for(e="",n="";le<pe&&(t=se[le],u(t.charCodeAt(0)));){if(++le,"\\"===t&&le<pe){if("u"===(t=se[le])){if(++le,r=le,t=m("u"))for(n+=t,e+="\\u";r<le;++r){e+=se[r];}else le=r,n+="u",e+="\\u";X({},oe.UnexpectedToken,"ILLEGAL");}else e+="\\",X({},oe.UnexpectedToken,"ILLEGAL");}else n+=t,e+=t;}return{value:n,literal:e};}function M(){var t,e,n,r,o;return de=null,_(),t=le,e=A(),n=S(),o=j(e.value,n.value),_e.tokenize?{type:Jt.RegularExpression,value:o,lineNumber:ce,lineStart:fe,start:t,end:le}:{literal:e.literal+n.literal,value:o,start:t,end:le};}function k(){var t,e,n,r;return _(),t=le,e={start:{line:ce,column:le-fe}},n=M(),e.end={line:ce,column:le-fe},_e.tokenize||(_e.tokens.length>0&&(r=_e.tokens[_e.tokens.length-1],r.range[0]===t&&"Punctuator"===r.type&&("/"!==r.value&&"/="!==r.value||_e.tokens.pop())),_e.tokens.push({type:"RegularExpression",value:n.literal,range:[t,le],loc:e})),n;}function C(t){return t.type===Jt.Identifier||t.type===Jt.Keyword||t.type===Jt.BooleanLiteral||t.type===Jt.NullLiteral;}function R(){var t,e;if(!(t=_e.tokens[_e.tokens.length-1]))return k();if("Punctuator"===t.type){if("]"===t.value)return w();if(")"===t.value)return e=_e.tokens[_e.openParenToken-1],!e||"Keyword"!==e.type||"if"!==e.value&&"while"!==e.value&&"for"!==e.value&&"with"!==e.value?w():k();if("}"===t.value){if(_e.tokens[_e.openCurlyToken-3]&&"Keyword"===_e.tokens[_e.openCurlyToken-3].type){if(!(e=_e.tokens[_e.openCurlyToken-4]))return w();}else{if(!_e.tokens[_e.openCurlyToken-4]||"Keyword"!==_e.tokens[_e.openCurlyToken-4].type)return w();if(!(e=_e.tokens[_e.openCurlyToken-5]))return k();}return ee.indexOf(e.value)>=0?w():k();}return k();}return"Keyword"===t.type&&"this"!==t.value?k():w();}function I(){var t;return _(),le>=pe?{type:Jt.EOF,lineNumber:ce,lineStart:fe,start:le,end:le}:(t=se.charCodeAt(le),s(t)?b():40===t||41===t||59===t?w():39===t||34===t?P():46===t?n(se.charCodeAt(le+1))?O():w():n(t)?O():_e.tokenize&&47===t?R():w());}function N(){var t,e,n,r;return _(),t={start:{line:ce,column:le-fe}},e=I(),t.end={line:ce,column:le-fe},e.type!==Jt.EOF&&(r=se.slice(e.start,e.end),_e.tokens.push({type:te[e.type],value:r,range:[e.start,e.end],loc:t})),e;}function F(){var t;return t=de,le=t.end,ce=t.lineNumber,fe=t.lineStart,de=void 0!==_e.tokens?N():I(),le=t.end,ce=t.lineNumber,fe=t.lineStart,t;}function U(){var t,e,n;t=le,e=ce,n=fe,de=void 0!==_e.tokens?N():I(),le=t,ce=e,fe=n;}function L(t,e){this.line=t,this.column=e;}function D(t,e,n,r){this.start=new L(t,e),this.end=new L(n,r);}function B(){var t,e,n,r;return t=le,e=ce,n=fe,_(),r=ce!==e,le=t,ce=e,fe=n,r;}function V(t,n){var r,o=Array.prototype.slice.call(arguments,2),i=n.replace(/%(\d)/g,function(t,n){return e(n<o.length,"Message reference must be in range"),o[n];});throw"number"==typeof t.lineNumber?(r=new Error("Line "+t.lineNumber+": "+i),r.index=t.start,r.lineNumber=t.lineNumber,r.column=t.start-fe+1):(r=new Error("Line "+ce+": "+i),r.index=le,r.lineNumber=ce,r.column=le-fe+1),r.description=i,r;}function X(){try{V.apply(null,arguments);}catch(t){if(!_e.errors)throw t;_e.errors.push(t);}}function z(t){if(t.type===Jt.EOF&&V(t,oe.UnexpectedEOS),t.type===Jt.NumericLiteral&&V(t,oe.UnexpectedNumber),t.type===Jt.StringLiteral&&V(t,oe.UnexpectedString),t.type===Jt.Identifier&&V(t,oe.UnexpectedIdentifier),t.type===Jt.Keyword){if(l(t.value))V(t,oe.UnexpectedReserved);else if(ue&&c(t.value))return void X(t,oe.StrictReservedWord);V(t,oe.UnexpectedToken,t.value);}V(t,oe.UnexpectedToken,t.value);}function W(t){var e=F();e.type===Jt.Punctuator&&e.value===t||z(e);}function G(t){var e=F();e.type===Jt.Keyword&&e.value===t||z(e);}function q(t){return de.type===Jt.Punctuator&&de.value===t;}function H(t){return de.type===Jt.Keyword&&de.value===t;}function Y(){var t;return de.type===Jt.Punctuator&&("="===(t=de.value)||"*="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t);}function K(){var t,e=le,n=ce,r=fe,o=de;return 59===se.charCodeAt(le)||q(";")?void F():(t=ce,_(),ce!==t?(le=e,ce=n,fe=r,void(de=o)):void(de.type===Jt.EOF||q("}")||z(de)));}function $(t){return t.type===ne.Identifier||t.type===ne.MemberExpression;}function Q(){var t=[],e;for(e=de,W("[");!q("]");){q(",")?(F(),t.push(null)):(t.push(_t()),q("]")||W(","));}return F(),he.markEnd(he.createArrayExpression(t),e);}function Z(t,e){var n,r,o;return n=ue,o=de,r=zt(),e&&ue&&f(t[0].name)&&X(e,oe.StrictParamName),ue=n,he.markEnd(he.createFunctionExpression(null,t,[],r),o);}function J(){var t,e;return e=de,t=F(),t.type===Jt.StringLiteral||t.type===Jt.NumericLiteral?(ue&&t.octal&&X(t,oe.StrictOctalLiteral),he.markEnd(he.createLiteral(t),e)):he.markEnd(he.createIdentifier(t.value),e);}function tt(){var t,e,n,r,o,i;return t=de,i=de,t.type===Jt.Identifier?(n=J(),"get"!==t.value||q(":")?"set"!==t.value||q(":")?(W(":"),r=_t(),he.markEnd(he.createProperty("init",n,r),i)):(e=J(),W("("),t=de,t.type!==Jt.Identifier?(W(")"),X(t,oe.UnexpectedToken,t.value),r=Z([])):(o=[bt()],W(")"),r=Z(o,t)),he.markEnd(he.createProperty("set",e,r),i)):(e=J(),W("("),W(")"),r=Z([]),he.markEnd(he.createProperty("get",e,r),i))):t.type!==Jt.EOF&&t.type!==Jt.Punctuator?(e=J(),W(":"),r=_t(),he.markEnd(he.createProperty("init",e,r),i)):void z(t);}function et(){var t=[],e,n,r,o,i={},a=String,s;for(s=de,W("{");!q("}");){e=tt(),n=e.key.type===ne.Identifier?e.key.name:a(e.key.value),o="init"===e.kind?re.Data:"get"===e.kind?re.Get:re.Set,r="$"+n,Object.prototype.hasOwnProperty.call(i,r)?(i[r]===re.Data?ue&&o===re.Data?X({},oe.StrictDuplicateProperty):o!==re.Data&&X({},oe.AccessorDataProperty):o===re.Data?X({},oe.AccessorDataProperty):i[r]&o&&X({},oe.AccessorGetSet),i[r]|=o):i[r]=o,t.push(e),q("}")||W(",");}return W("}"),he.markEnd(he.createObjectExpression(t),s);}function nt(){var t;return W("("),t=mt(),W(")"),t;}function rt(){var t,e,n,r;if(q("("))return nt();if(q("["))return Q();if(q("{"))return et();if(t=de.type,r=de,t===Jt.Identifier)n=he.createIdentifier(F().value);else if(t===Jt.StringLiteral||t===Jt.NumericLiteral)ue&&de.octal&&X(de,oe.StrictOctalLiteral),n=he.createLiteral(F());else if(t===Jt.Keyword){if(H("function"))return qt();H("this")?(F(),n=he.createThisExpression()):z(F());}else t===Jt.BooleanLiteral?(e=F(),e.value="true"===e.value,n=he.createLiteral(e)):t===Jt.NullLiteral?(e=F(),e.value=null,n=he.createLiteral(e)):q("/")||q("/=")?(n=void 0!==_e.tokens?he.createLiteral(k()):he.createLiteral(M()),U()):z(F());return he.markEnd(n,r);}function ot(){var t=[];if(W("("),!q(")"))for(;le<pe&&(t.push(_t()),!q(")"));){W(",");}return W(")"),t;}function it(){var t,e;return e=de,t=F(),C(t)||z(t),he.markEnd(he.createIdentifier(t.value),e);}function at(){return W("."),it();}function st(){var t;return W("["),t=mt(),W("]"),t;}function ut(){var t,e,n;return n=de,G("new"),t=ct(),e=q("(")?ot():[],he.markEnd(he.createNewExpression(t,e),n);}function lt(){var t,e,n,r,o=ve.allowIn;for(r=de,ve.allowIn=!0,t=H("new")?ut():rt();;){if(q("."))n=at(),t=he.createMemberExpression(".",t,n);else if(q("("))e=ot(),t=he.createCallExpression(t,e);else{if(!q("["))break;n=st(),t=he.createMemberExpression("[",t,n);}he.markEnd(t,r);}return ve.allowIn=o,t;}function ct(){var t,n,r;for(e(ve.allowIn,"callee of new expression always allow in keyword."),r=de,t=H("new")?ut():rt();q(".")||q("[");){q("[")?(n=st(),t=he.createMemberExpression("[",t,n)):(n=at(),t=he.createMemberExpression(".",t,n)),he.markEnd(t,r);}return t;}function ft(){var t,e,n=de;return t=lt(),de.type===Jt.Punctuator&&(!q("++")&&!q("--")||B()||(ue&&t.type===ne.Identifier&&f(t.name)&&X({},oe.StrictLHSPostfix),$(t)||X({},oe.InvalidLHSInAssignment),e=F(),t=he.markEnd(he.createPostfixExpression(e.value,t),n))),t;}function pt(){var t,e,n;return de.type!==Jt.Punctuator&&de.type!==Jt.Keyword?e=ft():q("++")||q("--")?(n=de,t=F(),e=pt(),ue&&e.type===ne.Identifier&&f(e.name)&&X({},oe.StrictLHSPrefix),$(e)||X({},oe.InvalidLHSInAssignment),e=he.createUnaryExpression(t.value,e),e=he.markEnd(e,n)):q("+")||q("-")||q("~")||q("!")?(n=de,t=F(),e=pt(),e=he.createUnaryExpression(t.value,e),e=he.markEnd(e,n)):H("delete")||H("void")||H("typeof")?(n=de,t=F(),e=pt(),e=he.createUnaryExpression(t.value,e),e=he.markEnd(e,n),ue&&"delete"===e.operator&&e.argument.type===ne.Identifier&&X({},oe.StrictDelete)):e=ft(),e;}function ht(t,e){var n=0;if(t.type!==Jt.Punctuator&&t.type!==Jt.Keyword)return 0;switch(t.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=e?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11;}return n;}function dt(){var t,e,n,r,o,i,a,s,u,l;if(t=de,u=pt(),r=de,0===(o=ht(r,ve.allowIn)))return u;for(r.prec=o,F(),e=[t,de],a=pt(),i=[u,r,a];(o=ht(de,ve.allowIn))>0;){for(;i.length>2&&o<=i[i.length-2].prec;){a=i.pop(),s=i.pop().value,u=i.pop(),n=he.createBinaryExpression(s,u,a),e.pop(),t=e[e.length-1],he.markEnd(n,t),i.push(n);}r=F(),r.prec=o,i.push(r),e.push(de),n=pt(),i.push(n);}for(l=i.length-1,n=i[l],e.pop();l>1;){n=he.createBinaryExpression(i[l-1].value,i[l-2],n),l-=2,t=e.pop(),he.markEnd(n,t);}return n;}function vt(){var t,e,n,r,o;return o=de,t=dt(),q("?")&&(F(),e=ve.allowIn,ve.allowIn=!0,n=_t(),ve.allowIn=e,W(":"),r=_t(),t=he.createConditionalExpression(t,n,r),he.markEnd(t,o)),t;}function _t(){var t,e,n,r,o;return t=de,o=de,r=e=vt(),Y()&&($(e)||X({},oe.InvalidLHSInAssignment),ue&&e.type===ne.Identifier&&f(e.name)&&X(t,oe.StrictLHSAssignment),t=F(),n=_t(),r=he.markEnd(he.createAssignmentExpression(t.value,e,n),o)),r;}function mt(){var t,e=de;if(t=_t(),q(",")){for(t=he.createSequenceExpression([t]);le<pe&&q(",");){F(),t.expressions.push(_t());}he.markEnd(t,e);}return t;}function gt(){for(var t=[],e;le<pe&&!q("}")&&void 0!==(e=Ht());){t.push(e);}return t;}function yt(){var t,e;return e=de,W("{"),t=gt(),W("}"),he.markEnd(he.createBlockStatement(t),e);}function bt(){var t,e;return e=de,t=F(),t.type!==Jt.Identifier&&z(t),he.markEnd(he.createIdentifier(t.value),e);}function wt(t){var e=null,n,r;return r=de,n=bt(),ue&&f(n.name)&&X({},oe.StrictVarName),"const"===t?(W("="),e=_t()):q("=")&&(F(),e=_t()),he.markEnd(he.createVariableDeclarator(n,e),r);}function xt(t){var e=[];do{if(e.push(wt(t)),!q(","))break;F();}while(le<pe);return e;}function Et(){var t;return G("var"),t=xt(),K(),he.createVariableDeclaration(t,"var");}function Tt(t){var e,n;return n=de,G(t),e=xt(t),K(),he.markEnd(he.createVariableDeclaration(e,t),n);}function Ot(){return W(";"),he.createEmptyStatement();}function Pt(){var t=mt();return K(),he.createExpressionStatement(t);}function jt(){var t,e,n;return G("if"),W("("),t=mt(),W(")"),e=Xt(),H("else")?(F(),n=Xt()):n=null,he.createIfStatement(t,e,n);}function At(){var t,e,n;return G("do"),n=ve.inIteration,ve.inIteration=!0,t=Xt(),ve.inIteration=n,G("while"),W("("),e=mt(),W(")"),q(";")&&F(),he.createDoWhileStatement(t,e);}function St(){var t,e,n;return G("while"),W("("),t=mt(),W(")"),n=ve.inIteration,ve.inIteration=!0,e=Xt(),ve.inIteration=n,he.createWhileStatement(t,e);}function Mt(){var t,e,n;return n=de,t=F(),e=xt(),he.markEnd(he.createVariableDeclaration(e,t.value),n);}function kt(){var t,e,n,r,o,i,a,s=ve.allowIn;return t=e=n=null,G("for"),W("("),q(";")?F():(H("var")||H("let")?(ve.allowIn=!1,t=Mt(),ve.allowIn=s,1===t.declarations.length&&H("in")&&(F(),r=t,o=mt(),t=null)):(ve.allowIn=!1,t=mt(),ve.allowIn=s,H("in")&&($(t)||X({},oe.InvalidLHSInForIn),F(),r=t,o=mt(),t=null)),void 0===r&&W(";")),void 0===r&&(q(";")||(e=mt()),W(";"),q(")")||(n=mt())),W(")"),a=ve.inIteration,ve.inIteration=!0,i=Xt(),ve.inIteration=a,void 0===r?he.createForStatement(t,e,n,i):he.createForInStatement(r,o,i);}function Ct(){var t=null,e;return G("continue"),59===se.charCodeAt(le)?(F(),ve.inIteration||V({},oe.IllegalContinue),he.createContinueStatement(null)):B()?(ve.inIteration||V({},oe.IllegalContinue),he.createContinueStatement(null)):(de.type===Jt.Identifier&&(t=bt(),e="$"+t.name,Object.prototype.hasOwnProperty.call(ve.labelSet,e)||V({},oe.UnknownLabel,t.name)),K(),null!==t||ve.inIteration||V({},oe.IllegalContinue),he.createContinueStatement(t));}function Rt(){var t=null,e;return G("break"),59===se.charCodeAt(le)?(F(),ve.inIteration||ve.inSwitch||V({},oe.IllegalBreak),he.createBreakStatement(null)):B()?(ve.inIteration||ve.inSwitch||V({},oe.IllegalBreak),he.createBreakStatement(null)):(de.type===Jt.Identifier&&(t=bt(),e="$"+t.name,Object.prototype.hasOwnProperty.call(ve.labelSet,e)||V({},oe.UnknownLabel,t.name)),K(),null!==t||ve.inIteration||ve.inSwitch||V({},oe.IllegalBreak),he.createBreakStatement(t));}function It(){var t=null;return G("return"),ve.inFunctionBody||X({},oe.IllegalReturn),32===se.charCodeAt(le)&&s(se.charCodeAt(le+1))?(t=mt(),K(),he.createReturnStatement(t)):B()?he.createReturnStatement(null):(q(";")||q("}")||de.type===Jt.EOF||(t=mt()),K(),he.createReturnStatement(t));}function Nt(){var t,e;return ue&&(_(),X({},oe.StrictModeWith)),G("with"),W("("),t=mt(),W(")"),e=Xt(),he.createWithStatement(t,e);}function Ft(){var t,e=[],n,r;for(r=de,H("default")?(F(),t=null):(G("case"),t=mt()),W(":");le<pe&&!(q("}")||H("default")||H("case"));){n=Xt(),e.push(n);}return he.markEnd(he.createSwitchCase(t,e),r);}function Ut(){var t,e,n,r,o;if(G("switch"),W("("),t=mt(),W(")"),W("{"),e=[],q("}"))return F(),he.createSwitchStatement(t,e);for(r=ve.inSwitch,ve.inSwitch=!0,o=!1;le<pe&&!q("}");){n=Ft(),null===n.test&&(o&&V({},oe.MultipleDefaultsInSwitch),o=!0),e.push(n);}return ve.inSwitch=r,W("}"),he.createSwitchStatement(t,e);}function Lt(){var t;return G("throw"),B()&&V({},oe.NewlineAfterThrow),t=mt(),K(),he.createThrowStatement(t);}function Dt(){var t,e,n;return n=de,G("catch"),W("("),q(")")&&z(de),t=bt(),ue&&f(t.name)&&X({},oe.StrictCatchVariable),W(")"),e=yt(),he.markEnd(he.createCatchClause(t,e),n);}function Bt(){var t,e=[],n=null;return G("try"),t=yt(),H("catch")&&e.push(Dt()),H("finally")&&(F(),n=yt()),0!==e.length||n||V({},oe.NoCatchOrFinally),he.createTryStatement(t,[],e,n);}function Vt(){return G("debugger"),K(),he.createDebuggerStatement();}function Xt(){var t=de.type,e,n,r,o;if(t===Jt.EOF&&z(de),t===Jt.Punctuator&&"{"===de.value)return yt();if(o=de,t===Jt.Punctuator)switch(de.value){case";":return he.markEnd(Ot(),o);case"(":return he.markEnd(Pt(),o);}if(t===Jt.Keyword)switch(de.value){case"break":return he.markEnd(Rt(),o);case"continue":return he.markEnd(Ct(),o);case"debugger":return he.markEnd(Vt(),o);case"do":return he.markEnd(At(),o);case"for":return he.markEnd(kt(),o);case"function":return he.markEnd(Gt(),o);case"if":return he.markEnd(jt(),o);case"return":return he.markEnd(It(),o);case"switch":return he.markEnd(Ut(),o);case"throw":return he.markEnd(Lt(),o);case"try":return he.markEnd(Bt(),o);case"var":return he.markEnd(Et(),o);case"while":return he.markEnd(St(),o);case"with":return he.markEnd(Nt(),o);}return e=mt(),e.type===ne.Identifier&&q(":")?(F(),r="$"+e.name,Object.prototype.hasOwnProperty.call(ve.labelSet,r)&&V({},oe.Redeclaration,"Label",e.name),ve.labelSet[r]=!0,n=Xt(),delete ve.labelSet[r],he.markEnd(he.createLabeledStatement(e,n),o)):(K(),he.markEnd(he.createExpressionStatement(e),o));}function zt(){var t,e=[],n,r,o,i,a,s,u,l;for(l=de,W("{");le<pe&&de.type===Jt.StringLiteral&&(n=de,t=Ht(),e.push(t),t.expression.type===ne.Literal);){r=se.slice(n.start+1,n.end-1),"use strict"===r?(ue=!0,o&&X(o,oe.StrictOctalLiteral)):!o&&n.octal&&(o=n);}for(i=ve.labelSet,a=ve.inIteration,s=ve.inSwitch,u=ve.inFunctionBody,ve.labelSet={},ve.inIteration=!1,ve.inSwitch=!1,ve.inFunctionBody=!0;le<pe&&!q("}")&&void 0!==(t=Ht());){e.push(t);}return W("}"),ve.labelSet=i,ve.inIteration=a,ve.inSwitch=s,ve.inFunctionBody=u,he.markEnd(he.createBlockStatement(e),l);}function Wt(t){var e,n=[],r,o,i,a,s;if(W("("),!q(")"))for(i={};le<pe&&(r=de,e=bt(),a="$"+r.value,ue?(f(r.value)&&(o=r,s=oe.StrictParamName),Object.prototype.hasOwnProperty.call(i,a)&&(o=r,s=oe.StrictParamDupe)):t||(f(r.value)?(t=r,s=oe.StrictParamName):c(r.value)?(t=r,s=oe.StrictReservedWord):Object.prototype.hasOwnProperty.call(i,a)&&(t=r,s=oe.StrictParamDupe)),n.push(e),i[a]=!0,!q(")"));){W(",");}return W(")"),{params:n,stricted:o,firstRestricted:t,message:s};}function Gt(){var t,e=[],n,r,o,i,a,s,u,l;return l=de,G("function"),r=de,t=bt(),ue?f(r.value)&&X(r,oe.StrictFunctionName):f(r.value)?(a=r,s=oe.StrictFunctionName):c(r.value)&&(a=r,s=oe.StrictReservedWord),i=Wt(a),e=i.params,o=i.stricted,a=i.firstRestricted,i.message&&(s=i.message),u=ue,n=zt(),ue&&a&&V(a,s),ue&&o&&X(o,s),ue=u,he.markEnd(he.createFunctionDeclaration(t,e,[],n),l);}function qt(){var t,e=null,n,r,o,i,a=[],s,u,l;return l=de,G("function"),q("(")||(t=de,e=bt(),ue?f(t.value)&&X(t,oe.StrictFunctionName):f(t.value)?(r=t,o=oe.StrictFunctionName):c(t.value)&&(r=t,o=oe.StrictReservedWord)),i=Wt(r),a=i.params,n=i.stricted,r=i.firstRestricted,i.message&&(o=i.message),u=ue,s=zt(),ue&&r&&V(r,o),ue&&n&&X(n,o),ue=u,he.markEnd(he.createFunctionExpression(e,a,[],s),l);}function Ht(){if(de.type===Jt.Keyword)switch(de.value){case"const":case"let":return Tt(de.value);case"function":return Gt();default:return Xt();}if(de.type!==Jt.EOF)return Xt();}function Yt(){for(var t,e=[],n,r,o;le<pe&&(n=de,n.type===Jt.StringLiteral)&&(t=Ht(),e.push(t),t.expression.type===ne.Literal);){r=se.slice(n.start+1,n.end-1),"use strict"===r?(ue=!0,o&&X(o,oe.StrictOctalLiteral)):!o&&n.octal&&(o=n);}for(;le<pe&&void 0!==(t=Ht());){e.push(t);}return e;}function Kt(){var t,e;return _(),U(),e=de,ue=!1,t=Yt(),he.markEnd(he.createProgram(t),e);}function $t(){var t,e,n,r=[];for(t=0;t<_e.tokens.length;++t){e=_e.tokens[t],n={type:e.type,value:e.value},_e.range&&(n.range=e.range),_e.loc&&(n.loc=e.loc),r.push(n);}_e.tokens=r;}function Qt(t,e){var n,r,o;n=String,"string"==typeof t||t instanceof String||(t=n(t)),he=ae,se=t,le=0,ce=se.length>0?1:0,fe=0,pe=se.length,de=null,ve={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},_e={},e=e||{},e.tokens=!0,_e.tokens=[],_e.tokenize=!0,_e.openParenToken=-1,_e.openCurlyToken=-1,_e.range="boolean"==typeof e.range&&e.range,_e.loc="boolean"==typeof e.loc&&e.loc,"boolean"==typeof e.comment&&e.comment&&(_e.comments=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(_e.errors=[]);try{if(U(),de.type===Jt.EOF)return _e.tokens;for(r=F();de.type!==Jt.EOF;){try{r=F();}catch(t){if(r=de,_e.errors){_e.errors.push(t);break;}throw t;}}$t(),o=_e.tokens,void 0!==_e.comments&&(o.comments=_e.comments),void 0!==_e.errors&&(o.errors=_e.errors);}catch(t){throw t;}finally{_e={};}return o;}function Zt(t,e){var n,r;r=String,"string"==typeof t||t instanceof String||(t=r(t)),he=ae,se=t,le=0,ce=se.length>0?1:0,fe=0,pe=se.length,de=null,ve={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},_e={},void 0!==e&&(_e.range="boolean"==typeof e.range&&e.range,_e.loc="boolean"==typeof e.loc&&e.loc,_e.attachComment="boolean"==typeof e.attachComment&&e.attachComment,_e.loc&&null!==e.source&&void 0!==e.source&&(_e.source=r(e.source)),"boolean"==typeof e.tokens&&e.tokens&&(_e.tokens=[]),"boolean"==typeof e.comment&&e.comment&&(_e.comments=[]),"boolean"==typeof e.tolerant&&e.tolerant&&(_e.errors=[]),_e.attachComment&&(_e.range=!0,_e.comments=[],_e.bottomRightStack=[],_e.trailingComments=[],_e.leadingComments=[]));try{n=Kt(),void 0!==_e.comments&&(n.comments=_e.comments),void 0!==_e.tokens&&($t(),n.tokens=_e.tokens),void 0!==_e.errors&&(n.errors=_e.errors);}catch(t){throw t;}finally{_e={};}return n;}var Jt,te,ee,ne,re,oe,ie,ae,se,ue,le,ce,fe,pe,he,de,ve,_e;Jt={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9},te={},te[Jt.BooleanLiteral]="Boolean",te[Jt.EOF]="<end>",te[Jt.Identifier]="Identifier",te[Jt.Keyword]="Keyword",te[Jt.NullLiteral]="Null",te[Jt.NumericLiteral]="Numeric",te[Jt.Punctuator]="Punctuator",te[Jt.StringLiteral]="String",te[Jt.RegularExpression]="RegularExpression",ee=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],ne={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},re={Data:1,Get:2,Set:4},oe={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},ie={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ０-９Ａ-Ｚ＿ａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ]")},ae={name:"SyntaxTree",processComment:function processComment(t){var e,n;if(!(t.type===ne.Program&&t.body.length>0)){for(_e.trailingComments.length>0?_e.trailingComments[0].range[0]>=t.range[1]?(n=_e.trailingComments,_e.trailingComments=[]):_e.trailingComments.length=0:_e.bottomRightStack.length>0&&_e.bottomRightStack[_e.bottomRightStack.length-1].trailingComments&&_e.bottomRightStack[_e.bottomRightStack.length-1].trailingComments[0].range[0]>=t.range[1]&&(n=_e.bottomRightStack[_e.bottomRightStack.length-1].trailingComments,delete _e.bottomRightStack[_e.bottomRightStack.length-1].trailingComments);_e.bottomRightStack.length>0&&_e.bottomRightStack[_e.bottomRightStack.length-1].range[0]>=t.range[0];){e=_e.bottomRightStack.pop();}e?e.leadingComments&&e.leadingComments[e.leadingComments.length-1].range[1]<=t.range[0]&&(t.leadingComments=e.leadingComments,delete e.leadingComments):_e.leadingComments.length>0&&_e.leadingComments[_e.leadingComments.length-1].range[1]<=t.range[0]&&(t.leadingComments=_e.leadingComments,_e.leadingComments=[]),n&&(t.trailingComments=n),_e.bottomRightStack.push(t);}},markEnd:function markEnd(t,e){return _e.range&&(t.range=[e.start,le]),_e.loc&&(t.loc=new D(void 0===e.startLineNumber?e.lineNumber:e.startLineNumber,e.start-(void 0===e.startLineStart?e.lineStart:e.startLineStart),ce,le-fe),this.postProcess(t)),_e.attachComment&&this.processComment(t),t;},postProcess:function postProcess(t){return _e.source&&(t.loc.source=_e.source),t;},createArrayExpression:function createArrayExpression(t){return{type:ne.ArrayExpression,elements:t};},createAssignmentExpression:function createAssignmentExpression(t,e,n){return{type:ne.AssignmentExpression,operator:t,left:e,right:n};},createBinaryExpression:function createBinaryExpression(t,e,n){return{type:"||"===t||"&&"===t?ne.LogicalExpression:ne.BinaryExpression,operator:t,left:e,right:n};},createBlockStatement:function createBlockStatement(t){return{type:ne.BlockStatement,body:t};},createBreakStatement:function createBreakStatement(t){return{type:ne.BreakStatement,label:t};},createCallExpression:function createCallExpression(t,e){return{type:ne.CallExpression,callee:t,arguments:e};},createCatchClause:function createCatchClause(t,e){return{type:ne.CatchClause,param:t,body:e};},createConditionalExpression:function createConditionalExpression(t,e,n){return{type:ne.ConditionalExpression,test:t,consequent:e,alternate:n};},createContinueStatement:function createContinueStatement(t){return{type:ne.ContinueStatement,label:t};},createDebuggerStatement:function createDebuggerStatement(){return{type:ne.DebuggerStatement};},createDoWhileStatement:function createDoWhileStatement(t,e){return{type:ne.DoWhileStatement,body:t,test:e};},createEmptyStatement:function createEmptyStatement(){return{type:ne.EmptyStatement};},createExpressionStatement:function createExpressionStatement(t){return{type:ne.ExpressionStatement,expression:t};},createForStatement:function createForStatement(t,e,n,r){return{type:ne.ForStatement,init:t,test:e,update:n,body:r};},createForInStatement:function createForInStatement(t,e,n){return{type:ne.ForInStatement,left:t,right:e,body:n,each:!1};},createFunctionDeclaration:function createFunctionDeclaration(t,e,n,r){return{type:ne.FunctionDeclaration,id:t,params:e,defaults:n,body:r,rest:null,generator:!1,expression:!1};},createFunctionExpression:function createFunctionExpression(t,e,n,r){return{type:ne.FunctionExpression,id:t,params:e,defaults:n,body:r,rest:null,generator:!1,expression:!1};},createIdentifier:function createIdentifier(t){return{type:ne.Identifier,name:t};},createIfStatement:function createIfStatement(t,e,n){return{type:ne.IfStatement,test:t,consequent:e,alternate:n};},createLabeledStatement:function createLabeledStatement(t,e){return{type:ne.LabeledStatement,label:t,body:e};},createLiteral:function createLiteral(t){return{type:ne.Literal,value:t.value,raw:se.slice(t.start,t.end)};},createMemberExpression:function createMemberExpression(t,e,n){return{type:ne.MemberExpression,computed:"["===t,object:e,property:n};},createNewExpression:function createNewExpression(t,e){return{type:ne.NewExpression,callee:t,arguments:e};},createObjectExpression:function createObjectExpression(t){return{type:ne.ObjectExpression,properties:t};},createPostfixExpression:function createPostfixExpression(t,e){return{type:ne.UpdateExpression,operator:t,argument:e,prefix:!1};},createProgram:function createProgram(t){return{type:ne.Program,body:t};},createProperty:function createProperty(t,e,n){return{type:ne.Property,key:e,value:n,kind:t};},createReturnStatement:function createReturnStatement(t){return{type:ne.ReturnStatement,argument:t};},createSequenceExpression:function createSequenceExpression(t){return{type:ne.SequenceExpression,expressions:t};},createSwitchCase:function createSwitchCase(t,e){return{type:ne.SwitchCase,test:t,consequent:e};},createSwitchStatement:function createSwitchStatement(t,e){return{type:ne.SwitchStatement,discriminant:t,cases:e};},createThisExpression:function createThisExpression(){return{type:ne.ThisExpression};},createThrowStatement:function createThrowStatement(t){return{type:ne.ThrowStatement,argument:t};},createTryStatement:function createTryStatement(t,e,n,r){return{type:ne.TryStatement,block:t,guardedHandlers:e,handlers:n,finalizer:r};},createUnaryExpression:function createUnaryExpression(t,e){return"++"===t||"--"===t?{type:ne.UpdateExpression,operator:t,argument:e,prefix:!0}:{type:ne.UnaryExpression,operator:t,argument:e,prefix:!0};},createVariableDeclaration:function createVariableDeclaration(t,e){return{type:ne.VariableDeclaration,declarations:t,kind:e};},createVariableDeclarator:function createVariableDeclarator(t,e){return{type:ne.VariableDeclarator,id:t,init:e};},createWhileStatement:function createWhileStatement(t,e){return{type:ne.WhileStatement,test:t,body:e};},createWithStatement:function createWithStatement(t,e){return{type:ne.WithStatement,object:t,body:e};}},t.version="1.2.5",t.tokenize=Qt,t.parse=Zt,t.Syntax=function(){var t,e={};"function"==typeof Object.create&&(e=Object.create(null));for(t in ne){ne.hasOwnProperty(t)&&(e[t]=ne[t]);}return"function"==typeof Object.freeze&&Object.freeze(e),e;}();});},function(t,e){e.read=function(t,e,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,l=u>>1,c=-7,f=n?o-1:0,p=n?-1:1,h=t[e+f];for(f+=p,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+f],f+=p,c-=8){}for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=p,c-=8){}if(0===i)i=1-l;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=l;}return(h?-1:1)*a*Math.pow(2,i-r);},e.write=function(t,e,n,r,o,i){var a,s,u,l=8*i-o-1,c=(1<<l)-1,f=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+f>=1?p/u:p*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*u-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[n+h]=255&s,h+=d,s/=256,o-=8){}for(a=a<<o|s,l+=o;l>0;t[n+h]=255&a,h+=d,a/=256,l-=8){}t[n+h-d]|=128*v;};},function(t,e,n){"use strict";function r(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=n;}return e;}t.exports=r;},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t);}function r(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0));}/*!
	         * Determine if an object is a Buffer
	         *
	         * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
	         * @license  MIT
	         */t.exports=function(t){return null!=t&&(n(t)||r(t)||!!t._isBuffer);};},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t);};},function(t,e,n){var r=n(49),o=n(29),i=r(o,"DataView");t.exports=i;},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1]);}}var o=n(544),i=n(545),a=n(546),s=n(547),u=n(548);r.prototype.clear=o,r.prototype.delete=i,r.prototype.get=a,r.prototype.has=s,r.prototype.set=u,t.exports=r;},function(t,e,n){var r=n(49),o=n(29),i=r(o,"Promise");t.exports=i;},function(t,e,n){var r=n(49),o=n(29),i=r(o,"Set");t.exports=i;},function(t,e,n){function r(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new o();++e<n;){this.add(t[e]);}}var o=n(124),i=n(569),a=n(570);r.prototype.add=r.prototype.push=i,r.prototype.has=a,t.exports=r;},function(t,e,n){var r=n(29),o=r.Uint8Array;t.exports=o;},function(t,e,n){var r=n(49),o=n(29),i=r(o,"WeakMap");t.exports=i;},function(t,e){function n(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2]);}return t.apply(e,n);}t.exports=n;},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;){if(!e(t[n],n,t))return!1;}return!0;}t.exports=n;},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a);}return i;}t.exports=n;},function(t,e,n){function r(t,e){var n=a(t),r=!n&&i(t),c=!n&&!r&&s(t),p=!n&&!r&&!c&&l(t),h=n||r||c||p,d=h?o(t.length,String):[],v=d.length;for(var _ in t){!e&&!f.call(t,_)||h&&("length"==_||c&&("offset"==_||"parent"==_)||p&&("buffer"==_||"byteLength"==_||"byteOffset"==_)||u(_,v))||d.push(_);}return d;}var o=n(523),i=n(130),a=n(30),s=n(191),u=n(85),l=n(193),c=Object.prototype,f=c.hasOwnProperty;t.exports=r;},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;){if(e(t[n],n,t))return!0;}return!1;}t.exports=n;},function(t,e,n){function r(t,e,n){var r=t[e];s.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||o(t,e,n);}var o=n(177),i=n(87),a=Object.prototype,s=a.hasOwnProperty;t.exports=r;},function(t,e,n){var r=n(179),o=n(530),i=o(r);t.exports=i;},function(t,e,n){function r(t,e){var n=!0;return o(t,function(t,r,o){return n=!!e(t,r,o);}),n;}var o=n(501);t.exports=r;},function(t,e){function n(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;){if(e(t[i],i,t))return i;}return-1;}t.exports=n;},function(t,e,n){var r=n(531),o=r();t.exports=o;},function(t,e,n){function r(t,e,n){var r=e(t);return i(t)?r:o(r,n(t));}var o=n(176),i=n(30);t.exports=r;},function(t,e){function n(t,e){return null!=t&&e in Object(t);}t.exports=n;},function(t,e,n){function r(t){return i(t)&&o(t)==a;}var o=n(65),i=n(67),a="[object Arguments]";t.exports=r;},function(t,e,n){function r(t,e,n,r,_,g){var y=l(t),b=l(e),w=y?d:u(t),x=b?d:u(e);w=w==h?v:w,x=x==h?v:x;var E=w==v,T=x==v,O=w==x;if(O&&c(t)){if(!c(e))return!1;y=!0,E=!1;}if(O&&!E)return g||(g=new o()),y||f(t)?i(t,e,n,r,_,g):a(t,e,w,n,r,_,g);if(!(n&p)){var P=E&&m.call(t,"__wrapped__"),j=T&&m.call(e,"__wrapped__");if(P||j){var A=P?t.value():t,S=j?e.value():e;return g||(g=new o()),_(A,S,n,r,g);}}return!!O&&(g||(g=new o()),s(t,e,n,r,_,g));}var o=n(175),i=n(181),a=n(535),s=n(536),u=n(183),l=n(30),c=n(191),f=n(193),p=1,h="[object Arguments]",d="[object Array]",v="[object Object]",_=Object.prototype,m=_.hasOwnProperty;t.exports=r;},function(t,e,n){function r(t,e,n,r){var u=n.length,l=u,c=!r;if(null==t)return!l;for(t=Object(t);u--;){var f=n[u];if(c&&f[2]?f[1]!==t[f[0]]:!(f[0]in t))return!1;}for(;++u<l;){f=n[u];var p=f[0],h=t[p],d=f[1];if(c&&f[2]){if(void 0===h&&!(p in t))return!1;}else{var v=new o();if(r)var _=r(h,d,p,t,e,v);if(!(void 0===_?i(d,h,a|s,r,v):_))return!1;}}return!0;}var o=n(175),i=n(127),a=1,s=2;t.exports=r;},function(t,e,n){function r(t){return!(!a(t)||i(t))&&(o(t)?d:l).test(s(t));}var o=n(192),i=n(551),a=n(57),s=n(188),u=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,f=Object.prototype,p=c.toString,h=f.hasOwnProperty,d=RegExp("^"+p.call(h).replace(u,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r;},function(t,e,n){function r(t){return a(t)&&i(t.length)&&!!s[o(t)];}var o=n(65),i=n(131),a=n(67),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=r;},function(t,e,n){function r(t){if(!o(t))return i(t);var e=[];for(var n in Object(t)){s.call(t,n)&&"constructor"!=n&&e.push(n);}return e;}var o=n(552),i=n(564),a=Object.prototype,s=a.hasOwnProperty;t.exports=r;},function(t,e,n){function r(t){var e=i(t);return 1==e.length&&e[0][2]?a(e[0][0],e[0][1]):function(n){return n===t||o(n,t,e);};}var o=n(509),i=n(539),a=n(187);t.exports=r;},function(t,e,n){function r(t,e){return s(t)&&u(e)?l(c(t),e):function(n){var r=i(n,t);return void 0===r&&r===e?a(n,t):o(e,r,f|p);};}var o=n(127),i=n(586),a=n(190),s=n(128),u=n(185),l=n(187),c=n(66),f=1,p=2;t.exports=r;},function(t,e,n){function r(t,e){return o(t,e,function(e,n){return i(t,n);});}var o=n(516),i=n(190);t.exports=r;},function(t,e,n){function r(t,e,n){for(var r=-1,s=e.length,u={};++r<s;){var l=e[r],c=o(t,l);n(c,l)&&i(u,a(l,t),c);}return u;}var o=n(126),i=n(520),a=n(83);t.exports=r;},function(t,e){function n(t){return function(e){return null==e?void 0:e[t];};}t.exports=n;},function(t,e,n){function r(t){return function(e){return o(e,t);};}var o=n(126);t.exports=r;},function(t,e){function n(t,e,n,i){for(var a=-1,s=o(r((e-t)/(n||1)),0),u=Array(s);s--;){u[i?s:++a]=t,t+=n;}return u;}var r=Math.ceil,o=Math.max;t.exports=n;},function(t,e,n){function r(t,e,n,r){if(!s(t))return t;e=i(e,t);for(var l=-1,c=e.length,f=c-1,p=t;null!=p&&++l<c;){var h=u(e[l]),d=n;if(l!=f){var v=p[h];d=r?r(v,h,p):void 0,void 0===d&&(d=s(v)?v:a(e[l+1])?[]:{});}o(p,h,d),p=p[h];}return t;}var o=n(500),i=n(83),a=n(85),s=n(57),u=n(66);t.exports=r;},function(t,e,n){var r=n(581),o=n(180),i=n(129),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0});}:i;t.exports=a;},function(t,e){function n(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i);}return n;}t.exports=n;},function(t,e){function n(t,e){for(var n=-1,r=Array(t);++n<t;){r[n]=e(n);}return r;}t.exports=n;},function(t,e,n){function r(t,e){return o(e,function(e){return[e,t[e]];});}var o=n(125);t.exports=r;},function(t,e,n){function r(t){if("string"==typeof t)return t;if(a(t))return i(t,r)+"";if(s(t))return c?c.call(t):"";var e=t+"";return"0"==e&&1/t==-u?"-0":e;}var o=n(64),i=n(125),a=n(30),s=n(90),u=1/0,l=o?o.prototype:void 0,c=l?l.toString:void 0;t.exports=r;},function(t,e){function n(t){return function(e){return t(e);};}t.exports=n;},function(t,e,n){function r(t,e){return o(e,function(e){return t[e];});}var o=n(125);t.exports=r;},function(t,e){function n(t,e){return t.has(e);}t.exports=n;},function(t,e,n){var r=n(29),o=r["__core-js_shared__"];t.exports=o;},function(t,e,n){function r(t,e){return function(n,r){if(null==n)return n;if(!o(n))return t(n,r);for(var i=n.length,a=e?i:-1,s=Object(n);(e?a--:++a<i)&&!1!==r(s[a],a,s);){}return n;};}var o=n(88);t.exports=r;},function(t,e){function n(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break;}return e;};}t.exports=n;},function(t,e,n){function r(t){return function(e,n,r){var s=Object(e);if(!i(e)){var u=o(n,3);e=a(e),n=function n(t){return u(s[t],t,s);};}var l=t(e,n,r);return l>-1?s[u?e[l]:l]:void 0;};}var o=n(82),i=n(88),a=n(50);t.exports=r;},function(t,e,n){function r(t){return function(e,n,r){return r&&"number"!=typeof r&&i(e,n,r)&&(n=r=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),r=void 0===r?e<n?1:-1:a(r),o(e,n,r,t);};}var o=n(519),i=n(184),a=n(196);t.exports=r;},function(t,e,n){function r(t){return function(e){var n=i(e);return n==u?a(e):n==l?s(e):o(e,t(e));};}var o=n(524),i=n(183),a=n(186),s=n(572),u="[object Map]",l="[object Set]";t.exports=r;},function(t,e,n){function r(t,e,n,r,o,E,O){switch(n){case x:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case w:return!(t.byteLength!=e.byteLength||!E(new i(t),new i(e)));case p:case h:case _:return a(+t,+e);case d:return t.name==e.name&&t.message==e.message;case m:case y:return t==e+"";case v:var P=u;case g:var j=r&c;if(P||(P=l),t.size!=e.size&&!j)return!1;var A=O.get(t);if(A)return A==e;r|=f,O.set(t,e);var S=s(P(t),P(e),r,o,E,O);return O.delete(t),S;case b:if(T)return T.call(t)==T.call(e);}return!1;}var o=n(64),i=n(493),a=n(87),s=n(181),u=n(186),l=n(571),c=1,f=2,p="[object Boolean]",h="[object Date]",d="[object Error]",v="[object Map]",_="[object Number]",m="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",w="[object ArrayBuffer]",x="[object DataView]",E=o?o.prototype:void 0,T=E?E.valueOf:void 0;t.exports=r;},function(t,e,n){function r(t,e,n,r,a,u){var l=n&i,c=o(t),f=c.length;if(f!=o(e).length&&!l)return!1;for(var p=f;p--;){var h=c[p];if(!(l?h in e:s.call(e,h)))return!1;}var d=u.get(t);if(d&&u.get(e))return d==e;var v=!0;u.set(t,e),u.set(e,t);for(var _=l;++p<f;){h=c[p];var m=t[h],g=e[h];if(r)var y=l?r(g,m,h,e,t,u):r(m,g,h,t,e,u);if(!(void 0===y?m===g||a(m,g,n,r,u):y)){v=!1;break;}_||(_="constructor"==h);}if(v&&!_){var b=t.constructor,w=e.constructor;b!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(v=!1);}return u.delete(t),u.delete(e),v;}var o=n(538),i=1,a=Object.prototype,s=a.hasOwnProperty;t.exports=r;},function(t,e,n){function r(t){return a(i(t,void 0,o),t+"");}var o=n(585),i=n(568),a=n(573);t.exports=r;},function(t,e,n){function r(t){return o(t,a,i);}var o=n(505),i=n(541),a=n(50);t.exports=r;},function(t,e,n){function r(t){for(var e=i(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,o(a)];}return e;}var o=n(185),i=n(50);t.exports=r;},function(t,e,n){function r(t){var e=a.call(t,u),n=t[u];try{t[u]=void 0;var r=!0;}catch(t){}var o=s.call(t);return r&&(e?t[u]=n:delete t[u]),o;}var o=n(64),i=Object.prototype,a=i.hasOwnProperty,s=i.toString,u=o?o.toStringTag:void 0;t.exports=r;},function(t,e,n){var r=n(497),o=n(592),i=Object.prototype,a=i.propertyIsEnumerable,s=Object.getOwnPropertySymbols,u=s?function(t){return null==t?[]:(t=Object(t),r(s(t),function(e){return a.call(t,e);}));}:o;t.exports=u;},function(t,e){function n(t,e){return null==t?void 0:t[e];}t.exports=n;},function(t,e,n){function r(t,e,n){e=o(e,t);for(var r=-1,c=e.length,f=!1;++r<c;){var p=l(e[r]);if(!(f=null!=t&&n(t,p)))break;t=t[p];}return f||++r!=c?f:!!(c=null==t?0:t.length)&&u(c)&&s(p,c)&&(a(t)||i(t));}var o=n(83),i=n(130),a=n(30),s=n(85),u=n(131),l=n(66);t.exports=r;},function(t,e,n){function r(){this.__data__=o?o(null):{},this.size=0;}var o=n(86);t.exports=r;},function(t,e){function n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e;}t.exports=n;},function(t,e,n){function r(t){var e=this.__data__;if(o){var n=e[t];return n===i?void 0:n;}return s.call(e,t)?e[t]:void 0;}var o=n(86),i="__lodash_hash_undefined__",a=Object.prototype,s=a.hasOwnProperty;t.exports=r;},function(t,e,n){function r(t){var e=this.__data__;return o?void 0!==e[t]:a.call(e,t);}var o=n(86),i=Object.prototype,a=i.hasOwnProperty;t.exports=r;},function(t,e,n){function r(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=o&&void 0===e?i:e,this;}var o=n(86),i="__lodash_hash_undefined__";t.exports=r;},function(t,e,n){function r(t){return a(t)||i(t)||!!(s&&t&&t[s]);}var o=n(64),i=n(130),a=n(30),s=o?o.isConcatSpreadable:void 0;t.exports=r;},function(t,e){function n(t){var e=typeof t==="undefined"?"undefined":_typeof(t);return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t;}t.exports=n;},function(t,e,n){function r(t){return!!i&&i in t;}var o=n(529),i=function(){var t=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:"";}();t.exports=r;},function(t,e){function n(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r);}var r=Object.prototype;t.exports=n;},function(t,e){function n(){this.__data__=[],this.size=0;}t.exports=n;},function(t,e,n){function r(t){var e=this.__data__,n=o(e,t);return!(n<0)&&(n==e.length-1?e.pop():a.call(e,n,1),--this.size,!0);}var o=n(81),i=Array.prototype,a=i.splice;t.exports=r;},function(t,e,n){function r(t){var e=this.__data__,n=o(e,t);return n<0?void 0:e[n][1];}var o=n(81);t.exports=r;},function(t,e,n){function r(t){return o(this.__data__,t)>-1;}var o=n(81);t.exports=r;},function(t,e,n){function r(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this;}var o=n(81);t.exports=r;},function(t,e,n){function r(){this.size=0,this.__data__={hash:new o(),map:new(a||i)(),string:new o()};}var o=n(489),i=n(80),a=n(123);t.exports=r;},function(t,e,n){function r(t){var e=o(this,t).delete(t);return this.size-=e?1:0,e;}var o=n(84);t.exports=r;},function(t,e,n){function r(t){return o(this,t).get(t);}var o=n(84);t.exports=r;},function(t,e,n){function r(t){return o(this,t).has(t);}var o=n(84);t.exports=r;},function(t,e,n){function r(t,e){var n=o(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this;}var o=n(84);t.exports=r;},function(t,e,n){function r(t){var e=o(t,function(t){return n.size===i&&n.clear(),t;}),n=e.cache;return e;}var o=n(589),i=500;t.exports=r;},function(t,e,n){var r=n(567),o=r(Object.keys,Object);t.exports=o;},function(t,e,n){(function(t){var r=n(182),o="object"==(typeof e==="undefined"?"undefined":_typeof(e))&&e&&!e.nodeType&&e,i=o&&"object"==(typeof t==="undefined"?"undefined":_typeof(t))&&t&&!t.nodeType&&t,a=i&&i.exports===o,s=a&&r.process,u=function(){try{return s&&s.binding&&s.binding("util");}catch(t){}}();t.exports=u;}).call(e,n(94)(t));},function(t,e){function n(t){return o.call(t);}var r=Object.prototype,o=r.toString;t.exports=n;},function(t,e){function n(t,e){return function(n){return t(e(n));};}t.exports=n;},function(t,e,n){function r(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var r=arguments,a=-1,s=i(r.length-e,0),u=Array(s);++a<s;){u[a]=r[e+a];}a=-1;for(var l=Array(e+1);++a<e;){l[a]=r[a];}return l[e]=n(u),o(t,this,l);};}var o=n(495),i=Math.max;t.exports=r;},function(t,e){function n(t){return this.__data__.set(t,r),this;}var r="__lodash_hash_undefined__";t.exports=n;},function(t,e){function n(t){return this.__data__.has(t);}t.exports=n;},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t;}),n;}t.exports=n;},function(t,e){function n(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t];}),n;}t.exports=n;},function(t,e,n){var r=n(521),o=n(574),i=o(r);t.exports=i;},function(t,e){function n(t){var e=0,n=0;return function(){var a=i(),s=o-(a-n);if(n=a,s>0){if(++e>=r)return arguments[0];}else e=0;return t.apply(void 0,arguments);};}var r=800,o=16,i=Date.now;t.exports=n;},function(t,e,n){function r(){this.__data__=new o(),this.size=0;}var o=n(80);t.exports=r;},function(t,e){function n(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n;}t.exports=n;},function(t,e){function n(t){return this.__data__.get(t);}t.exports=n;},function(t,e){function n(t){return this.__data__.has(t);}t.exports=n;},function(t,e,n){function r(t,e){var n=this.__data__;if(n instanceof o){var r=n.__data__;if(!i||r.length<s-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new a(r);}return n.set(t,e),this.size=n.size,this;}var o=n(80),i=n(123),a=n(124),s=200;t.exports=r;},function(t,e,n){var r=n(563),o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,s=r(function(t){var e=[];return o.test(t)&&e.push(""),t.replace(i,function(t,n,r,o){e.push(r?o.replace(/\\(\\)?/g,"$1"):n||t);}),e;});t.exports=s;},function(t,e){function n(t){return function(){return t;};}t.exports=n;},function(t,e,n){function r(t,e,n){var r=s(t)?o:i;return n&&u(t,e,n)&&(e=void 0),r(t,a(e,3));}var o=n(496),i=n(502),a=n(82),s=n(30),u=n(184);t.exports=r;},function(t,e,n){var r=n(532),o=n(584),i=r(o);t.exports=i;},function(t,e,n){function r(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var u=null==n?0:a(n);return u<0&&(u=s(r+u,0)),o(t,i(e,3),u);}var o=n(503),i=n(82),a=n(594),s=Math.max;t.exports=r;},function(t,e,n){function r(t){return(null==t?0:t.length)?o(t,1):[];}var o=n(178);t.exports=r;},function(t,e,n){function r(t,e,n){var r=null==t?void 0:o(t,e);return void 0===r?n:r;}var o=n(126);t.exports=r;},function(t,e,n){function r(t){return"number"==typeof t&&i(t);}var o=n(29),i=o.isFinite;t.exports=r;},function(t,e,n){function r(t,e){var n={};return e=a(e,3),i(t,function(t,r,i){o(n,e(t,r,i),t);}),n;}var o=n(177),i=n(179),a=n(82);t.exports=r;},function(t,e,n){function r(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(i);var n=function n(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a;};return n.cache=new(r.Cache||o)(),n;}var o=n(124),i="Expected a function";r.Cache=o,t.exports=r;},function(t,e,n){var r=n(515),o=n(537),i=o(function(t,e){return null==t?{}:r(t,e);});t.exports=i;},function(t,e,n){function r(t){return a(t)?o(s(t)):i(t);}var o=n(517),i=n(518),a=n(128),s=n(66);t.exports=r;},function(t,e){function n(){return[];}t.exports=n;},function(t,e){function n(){return!1;}t.exports=n;},function(t,e,n){function r(t){var e=o(t),n=e%1;return e===e?n?e-n:e:0;}var o=n(196);t.exports=r;},function(t,e,n){function r(t){if("number"==typeof t)return t;if(i(t))return a;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e;}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var n=l.test(t);return n||c.test(t)?f(t.slice(2),n?2:8):u.test(t)?a:+t;}var o=n(57),i=n(90),a=NaN,s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;t.exports=r;},function(t,e,n){var r=n(534),o=n(50),i=r(o);t.exports=i;},function(t,e,n){function r(t){return null==t?"":o(t);}var o=n(525);t.exports=r;},function(t,e,n){function r(t){return null==t?[]:o(t,i(t));}var o=n(527),i=n(50);t.exports=r;},function(t,e,n){"use strict";t.exports=function t(e){var n,r=e.data,o=e.stride[0],i=e.offset,a=0;for(n=e.shape[0]-1;n>=0;n--,i+=o){a+=Math.abs(r[i]);}return a;};},function(t,e,n){"use strict";t.exports=function t(e,n,r){var o,i=n.data,a=r.data,s=n.stride[0],u=r.stride[0],l=n.offset,c=r.offset;for(o=n.shape[0]-1;o>=0;o--,l+=s,c+=u){a[c]+=e*i[l];}};},function(t,e,n){"use strict";t.exports=function t(e,n){var r,o=e.data,i=n.data,a=e.stride[0],s=n.stride[0],u=e.offset,l=n.offset;for(r=e.shape[0]-1;r>=0;r--,u+=a,l+=s){i[l]=o[u];}};},function(t,e,n){"use strict";t.exports=function t(e,n,r){var o,i=n.data,a=r.data,s=n.stride[0],u=r.stride[0],l=n.offset,c=r.offset;for(o=n.shape[0]-1;o>=0;o--,l+=s,c+=u){a[c]=e*i[l];}};},function(t,e,n){"use strict";t.exports=function t(e,n){var r,o,i=e.data,a=e.stride[0],s=e.offset,u=0;if(e===n)for(r=e.shape[0]-1;r>=0;r--,s+=a){o=i[s],u+=o*o;}else{var l=n.data,c=n.stride[0],f=n.offset;for(r=e.shape[0]-1;r>=0;r--,s+=a,f+=c){u+=l[f]*i[s];}}return u;};},function(t,e,n){"use strict";t.exports=function t(e){var n,r,o,i=-1/0,a=e.data,s=e.stride[0],u=e.offset,l=e.shape[0];for(n=0;n<l;n++,u+=s){(r=Math.abs(a[u]))>i&&(i=r,o=n);}return o;};},function(t,e,n){"use strict";var r=function t(e,n){if(0===e&&0===n)return 0;var r=Math.abs(e),o=Math.abs(n),i=Math.min(r,o),a=Math.max(r,o);return i/=a,a*Math.sqrt(1+i*i);};t.exports=function t(e){var n,o,i=e.data,a=e.stride[0],s=e.offset,u=0;for(n=e.shape[0]-1;n>=0;n--,s+=a){o=i[s],u=r(u,o);}return u;};},function(t,e,n){"use strict";Math.sign=Math.sign||function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1;},t.exports=function t(e,n,r){var o=0,i=0,a=0,s=0,u=0;if(0===n?(o=Math.sign(e),i=0,a=Math.abs(e)):0===e?(o=0,i=Math.sign(n),a=Math.abs(n)):Math.abs(e)>Math.abs(n)?(s=n/e,u=Math.sign(e)*Math.sqrt(1+s*s),o=1/u,i=s*o,a=e*u):(s=e/n,u=Math.sign(e)*Math.sqrt(1+s*s),i=1/u,o=s*i,a=n*u),!(void 0!==r&&r.length>2))return[o,i,a];r[0]=o,r[1]=i,r[2]=a;};},function(t,e,n){"use strict";t.exports=function t(e,n){var r,o=n.data,i=n.stride[0],a=n.offset;for(r=n.shape[0]-1;r>=0;r--,a+=i){o[a]*=e;}};},function(t,e,n){"use strict";t.exports=function t(e,n){var r,o,i=e.data,a=n.data,s=e.stride[0],u=n.stride[0],l=e.offset,c=n.offset;for(r=e.shape[0]-1;r>=0;r--,l+=s,c+=u){o=i[l],i[l]=a[c],a[c]=o;}};},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a){for(var s=0,u=0,l=0,c=0,f=0,p=t.shape[0],h=t.shape[1],d=Math.min(e,p-1),v=Math.min(n,h-1),_=void 0===i?1:i,m=void 0===a?0:a;s<=d;){c=0;var g=Math.min(s+v,h-1);for(l=0;l<=g;l++){c+=t.get(s,l)*r.get(l);}o.set(s,c*_+m*o.get(s)),s++;}if(s<p)for(u=0;s+v<h;){for(c=0,l=0;l<=d+v;l++){f=u+l+1,c+=t.get(s,f)*r.get(f);}if(o.set(s,c*_+m*o.get(s)),s++,u++,s===p)break;}if(s<p)for(u++;s-d<h;){for(c=0,l=u;l<h;l++){c+=t.get(s,l)*r.get(l);}if(o.set(s,c*_+m*o.get(s)),s++,u++,s===p)break;}return!0;}t.exports=r;},function(t,e,n){"use strict";function r(t,e,n,r,i){for(var a=o.dot,s=e.shape[0]-1;s>=0;s--){i.set(s,i.get(s)*r+t*a(e.pick(s,null),n));}return!0;}var o=n(91);t.exports=r;},function(t,e,n){"use strict";function r(){console.error("GER (rank 1 operation A := alpha*x*y' + A) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";function r(){console.error("SBMV (symmetric banded matrix vector multiply) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";(function(t){function e(){console.error("SPMV (symmetric packed matrix vector multiply) not yet implemented");}t.exporst=e;}).call(e,n(94)(t));},function(t,e,n){"use strict";function r(){console.error("SPR (symmetric packed rank 1 operation A := alpha*x*y' + A) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";function r(){console.error("SPR (symmetric packed rank 2 operation A := alpha*x*y' + alpha*y*x' + A) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";function r(t,e,n,r,i,a){var s=t.shape[0],u=r||!0,l=void 0===i?1:i,c=void 0===a?0:a,f=0,p=0,h=0,d=0;if(0===c)for(f=0;f<n.shape[0];++f){n.set(f,0);}else 1!==c&&o.scal(c,n);if(0===l)return!0;if(1===l){if(u)for(p=0;p<s;++p){for(h=e.get(p),d=0,n.set(p,n.get(p)+h*t.get(p,p)),f=p+1;f<s;++f){n.set(f,n.get(f)+h*t.get(f,p)),d+=t.get(f,p)*e.get(f);}n.set(p,n.get(p)+d);}else for(p=0;p<s;++p){for(h=e.get(p),d=0,f=0;f<=p-1;++f){n.set(f,n.get(f)+h*t.get(f,p)),d+=t.get(f,p)*e.get(f);}n.set(p,n.get(p)+h*t.get(p,p)+d);}}else if(u)for(p=0;p<s;++p){for(h=l*e.get(p),d=0,n.set(p,n.get(p)+h*t.get(p,p)),f=p+1;f<s;++f){n.set(f,n.get(f)+h*t.get(f,p)),d+=t.get(f,p)*e.get(f);}n.set(p,n.get(p)+l*d);}else for(p=0;p<s;++p){for(h=l*e.get(p),d=0,f=0;f<=p-1;++f){n.set(f,n.get(f)+h*t.get(f,p)),d+=t.get(f,p)*e.get(f);}n.set(p,n.get(p)+h*t.get(p,p)+l*d);}return!0;}var o=n(91);t.exports=r;},function(t,e,n){"use strict";function r(){console.error("SYR (symmetric rank 1 operation A := alpha*x*y' + A) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";function r(){console.error("SYR (symmetric rank 2 operation A := alpha*x*y' + alpha*y*x' + A) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";function r(){console.error("TBMV (triangular banded matrix vector multiply) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";(function(t){function e(){console.error("TBSV (triangular banded matrix solver) not yet implemented");}t.exporst=e;}).call(e,n(94)(t));},function(t,e,n){"use strict";function r(){console.error("TPSV (triangular packed matrix solver) not yet implemented");}t.exports=r;},function(t,e,n){"use strict";function r(t,e,n){var r=o.dot,i=t.shape[1],a=0;if(n)for(a=i-1;a>=0;a--){e.set(a,r(t.pick(a,null).hi(a+1),e.hi(a+1)));}else for(a=0;a<i;a++){e.set(a,r(t.pick(a,null).lo(a),e.lo(a)));}return!0;}var o=n(91);t.exports=r;},function(t,e,n){"use strict";function r(t,e,n){var r=o.dot,i=t.shape[1],a=0;if(n)for(e.set(0,e.get(0)/t.get(0,0)),a=1;a<i;a++){e.set(a,(e.get(a)-r(t.pick(a,null).hi(a),e.hi(a)))/t.get(a,a));}else for(e.set(i-1,e.get(i-1)/t.get(i-1,i-1)),a=i-2;a>=0;a--){e.set(a,(e.get(a)-r(t.pick(a,null).lo(a+1),e.lo(a+1)))/t.get(a,a));}return!0;}var o=n(91);t.exports=r;},function(t,e,n){"use strict";function r(t){return"r"===t?[1,0]:[0,1];}function o(t,e){return"native"===e[1]?[t,"d0=",t,".length,",t,"d1=",t,"[0].length,"].join(""):[t,"d0=",t,".shape[0],",t,"d1=",t,".shape[1],",t,"s0=",t,".stride[0],",t,"s1=",t,".stride[1],",t,"o=",t,".offset,",t,"d=",t,".data,"].join("");}function i(t,e,n,r,o,i){var a=[];return"native"===n[1]?t[0]&&(r?a.push("var ",e,"p=",e,"[",r,"];"):a.push("var ",e,"p=",e,"[0];")):r&&o?i?a.push("var ",e,"t0=",e,"s",t[0],",",e,"t1=",e,"s",t[1],"-",e,"s",t[0],"*",i,",",e,"p=",e,"o+",r,"*",e,"s0+",o,"*",e,"s1;"):a.push("var ",e,"t0=",e,"s",t[0],",",e,"p=",e,"o+",r,"*",e,"s0+",o,"*",e,"s1;"):r?a.push("var ",e,"t0=",e,"s",t[0],",",e,"p=",e,"o+",r,"*",e,"s0;"):o?a.push("var ",e,"t0=",e,"s",t[0],",",e,"p=",e,"o+",o,"*",e,"s1;"):a.push("var ",e,"t0=",e,"s",t[0],",",e,"t1=",e,"s",t[1],"-",e,"s",t[0],"*",e,"d",t[0],",",e,"p=",e,"o;"),a;}function a(t,e,n,r,o){var i=[];return"native"===n[1]?t[0]&&1===r&&i.push(e,"p=",e,"[",o,"+1]"):i.push(e,"p+=",e,"t",r,";"),i;}function s(t,e,n,r,o,i){var a=[];return"native"===n[1]?t[0]?a.push(e,"p[",o,"]=",i,";"):a.push(e,"[",r,"][",o,"]=",i,";"):"generic"===n[1]?a.push(e,"d.set(",e,"p,",i,");"):a.push(e,"d[",e,"p]=",i,";"),a;}function u(t,e,n,r,o){var i=[];return"native"===n[1]?t[0]?i.push(e,"p[",o,"]"):i.push(e,"[",r,"][",o,"]"):"generic"===n[1]?i.push(e,"d.get(",e,"p)"):i.push(e,"d[",e,"p]"),i.join("");}function l(t,e,n,r,o){var l=[],c="r"===t[0]?[1,0]:[0,1],f=[1,0],p=[0,1],h=["i","j"];return l.push.apply(l,i(c,"o",t)),c[1]?(l.push("for(j=0;j<od1;++j){"),l.push("for(i=0;i<od0;++i){")):(l.push("for(i=0;i<od0;++i){"),l.push("for(j=0;j<od1;++j){")),l.push.apply(l,i(f,"a",e,"i")),l.push.apply(l,i(p,"b",n,void 0,"j")),l.push("var r=0.0;","for(k=0;k<ad1;++k){","r+=",u(f,"a",e,"i","k"),"*",u(p,"b",n,"k","j"),";"),l.push.apply(l,a(f,"a",e,0,"k")),l.push.apply(l,a(p,"b",n,0,"k")),l.push("}"),r&&l.push("r*=A;"),o&&l.push("r+=B*",u(c,"o",t,"i","j"),";"),l.push.apply(l,s(c,"o",t,"i","j","r")),l.push.apply(l,a(c,"o",t,0,h[1])),l.push("}"),l.push.apply(l,a(c,"o",t,1,h[0])),l.push("}"),l;}function c(t,e){var n=[],r="r"===t[0]?[1,0]:[0,1],o;return e&&n.push("if(B!==1.0){"),n.push.apply(n,i(r,"o",t)),r[0]?(n.push("for(i=0;i<od0;++i){for(j=0;j<od1;++j){"),o=["i","j"]):(n.push("for(j=0;j<od1;++j){for(i=0;i<od0;++i){"),o=["j","i"]),e?n.push.apply(n,s(r,"o",t,"i","j","B*"+u(r,"o",t,"i","j"))):n.push.apply(n,s(r,"o",t,"i","j","0")),n.push.apply(n,a(r,"o",t,0,o[1])),n.push("}"),n.push.apply(n,a(r,"o",t,1,o[0])),n.push("}"),e&&n.push("}"),n;}function f(t,e,n,r,o){var l=[],f=["od0","od1","ad1"],p=[1,0],d=[1,0],v=[0,1];l.push.apply(l,c(t,o));for(var _=0;_<3;++_){l.push("for(var i",_,"=",f[_],";i",_,">0;){","var w",_,"=",h,";","if(i",_,"<",h,"){","w",_,"=i",_,";","i",_,"=0;","}else{","i",_,"-=",h,";","}");}l.push.apply(l,i(p,"o",t,"i0","i1","w1")),l.push("for(i=0;i<w0;++i){for(j=0;j<w1;++j){var r=0.0;"),l.push.apply(l,i(d,"a",e,"(i0+i)","i2")),l.push.apply(l,i(v,"b",n,"i2","(i1+j)")),l.push("for(k=0;k<w2;++k){"),l.push("r+=",u(d,"a",e,"(i0+i)","(i2+k)"),"*",u(v,"b",n,"(i2+k)","(i1+j)"),";"),l.push.apply(l,a(d,"a",e,0,"(i2+k)")),l.push.apply(l,a(v,"b",n,0,"(i2+k)")),l.push("}");var m="r";return r&&(m="A*r"),l.push.apply(l,s(p,"o",t,"(i0+i)","(i1+j)",m+"+"+u(p,"o",t,"(i0+i)","(i1+j)"))),l.push.apply(l,a(p,"o",t,0,"(i1+j)")),l.push("}"),l.push.apply(l,a(p,"o",t,1,"(i0+i)")),l.push("}}}}"),l;}function p(t,e,n,r,i){var a=["gemm",t[0],t[1],"a",e[0],e[1],"b",n[0],n[1],r?"alpha":"",i?"beta":""].join(""),s=["function ",a,"(o,a,b,A,B){","var ",o("o",t),o("a",e),o("b",n),"i,j,k;"];return"r"===e[0]&&"c"===n[0]?s.push.apply(s,l(t,e,n,r,i)):s.push.apply(s,f(t,e,n,r,i)),s.push("}return ",a),new Function(s.join(""))();}t.exports=p;var h=32;},function(t,e,n){"use strict";function r(t,e){var n,r=[],i=[];if(void 0!==e&&!Array.isArray(e))throw new Error("axes must be an Array list of dimensions to squeeze");for(n=0;n<t.shape.length;n++){(1!==t.shape[n]||void 0!==e&&-1===e.indexOf(n))&&(r.push(t.shape[n]),i.push(t.stride[n]));}return o(t.data,r,i,t.offset);}var o=n(93);t.exports=r;},function(t,e,n){"use strict";function r(){var t,e,n,r;if(2===arguments.length?(e=arguments[0],r=arguments[1]):3===arguments.length&&(n=arguments[0],e=arguments[1],r=arguments[2]),!Array.isArray(r))throw new Error("second argument of tile must be an array of repetition counts for each dimension");var a=e.shape.slice(0),s=a.slice(0),u=Math.max(s.length,r.length);for(t=0;t<u;t++){if(a[t]=void 0===a[t]?1:a[t],r[t]=void 0===r[t]?1:r[t],s[t]=(void 0===s[t]?1:s[t])*r[t],0===s[t])throw new Error("Number of tiles must be greater than zero");}n||(n=o.zeros(s,e.dtype));var l=1;for(t=0;t<r.length;t++){l*=r[t];}var c=new Array(r.length);for(t=0;t<r.length;t++){c[t]=0;}var f=s.slice(0);for(h=0;h<s.length;h++){f[h]=h<e.dimension?null:0;}for(t=0;t<l;t++){for(h=e.dimension;h<s.length;h++){f[h]=c[h];}var p=n.pick.apply(n,f);if(p=p.lo.apply(p,c),p=p.hi.apply(p,e.shape),i.assign(p,e),t===l-1)break;for(var h=u-1;h>=0&&(c[h]+=a[h],c[h]===s[h]);){c[h]=0,h--;}}return n;}var o=n(198),i=n(3);t.exports=r;},function(t,e){},function(t,e){t.exports='// 2D convolution fragment shader - based on im2col + gemm implementation\n// The input texture, X, is already configured as column matrix, after\n// input_transform.glsl is run on it if necessary. The output texture is in column\n// matrix configuration, and will need to be reshaped or transformed prior to the\n// next layer.\n\n// The following code is adapted from weblas, specifically the sgemm parts.\n// https://github.com/waylonflinn/weblas\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2015 Waylon Flinn\n// Modified by Leon Chen, 2017\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the "Software"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D X;\nuniform sampler2D W;\nuniform sampler2D b;\nuniform int inputCols;\nuniform int outputCols;\nuniform int inputColPad;\nuniform int outputColPad;\nuniform int relu;\n\n// sum of products between elements in row i (from X) x col j (from B)\n//\n// Calculate the dot product between the row (from X) and column (from B)\n// identified by the passed indeces (output texture coordinate space).\n// We loop over elements in the row and column and sum the product\n// using the glsl `dot` function to process four elements at a time.\n// This four element optimization requires that the matrix B be\n// transposed before texel packing and that both matrices be padded\n// (with zeros) to a multiple of four (4) in their shared dimension.\nfloat dot_rowcol (float y, float x, sampler2D X, sampler2D W, int K) {\n  float delta_t = 1. / float(K); // space (on texture) between elements\n  float sum = 0.; // sum for this row/column pair\n  float z = 0.5 * (4.0 * delta_t);// position for shared dimension on source textures\n\n  for (int l = 0; l < 4096; ++l) {\n    if (l >= K / 4) break; // stop when we finish the row/column\n    // l is in pixel space, so we divide by four\n\n    // retrieve next four elements from each texture\n    vec4 a_ik = texture2D(X, vec2(z, y));\n    vec4 b_kj = texture2D(W, vec2(z, x));\n\n    // use `dot` to process four elements at a time\n    sum += dot(a_ik, b_kj);\n    z += (4.0 * delta_t); // (z + 0.5)*delta\n  }\n  return sum;\n}\n\nvoid main(void) {\n\n  // get the implied row and column from .y and .x of passed (output)\n  // texture coordinate. These map directly to input texture space when\n  // the relevant dimensions are the same.\n  float row_t = outTex.y;\n  float col_t = outTex.x;\n  vec4 b_v = texture2D(b, vec2(col_t, 0.5));\n\n  vec4 sum_v = vec4(0.0, 0.0, 0.0, 0.0);\n  float col = (col_t * float(outputCols + outputColPad) - 2.0); // index of first element in pixel (matrix space)\n  sum_v.r = dot_rowcol(row_t, (col + 0.5) / float(outputCols), X, W, inputCols + inputColPad);\n  // in the padding region?\n  if (outputColPad > 0 && (col + 4.0) > float(outputCols)) {\n    // pad\n    if (outputColPad < 3) {\n      sum_v.g = dot_rowcol(row_t, (col + 1.5) / float(outputCols), X, W, inputCols + inputColPad);\n    }\n    if (outputColPad < 2) {\n      sum_v.b = dot_rowcol(row_t, (col + 2.5) / float(outputCols), X, W, inputCols + inputColPad);\n    }\n  } else {\n    sum_v.g = dot_rowcol(row_t, (col + 1.5) / float(outputCols), X, W, inputCols + inputColPad);\n    sum_v.b = dot_rowcol(row_t, (col + 2.5) / float(outputCols), X, W, inputCols + inputColPad);\n    sum_v.a = dot_rowcol(row_t, (col + 3.5) / float(outputCols), X, W, inputCols + inputColPad);\n  }\n\n  if (relu == 1) {\n    gl_FragColor = max(sum_v + b_v, 0.0);\n  } else {\n    gl_FragColor = sum_v + b_v;\n  }\n}\n';},function(t,e){t.exports="// Transform input matrix X based on index mappings, indexMappingRow and indexMappingCol.\n// This is an extension of weblas.\n// https://github.com/waylonflinn/weblas\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D X;\nuniform sampler2D indexMappingRow;\nuniform sampler2D indexMappingCol;\nuniform int inputRows;\nuniform int inputCols;\nuniform int outputCols;\nuniform int inputColPad;\nuniform int outputColPad;\n\nfloat select_index(vec4 v, int index) {\n  float val = 0.0;\n  if (index == 0) {\n    val = v.r;\n  } else if (index == 1) {\n    val = v.g;\n  } else if (index == 2) {\n    val = v.b;\n  } else if (index == 3) {\n    val = v.a;\n  }\n  return val;\n}\n\nvoid fix_pad(inout vec4 v, int pad) {\n  v.a = 0.0;\n  if (pad == 2) {\n    v.b = 0.0;\n  } else if (pad == 3) {\n    v.b = 0.0;\n    v.g = 0.0;\n  }\n}\n\nvoid main(void) {\n  // index of first element in pixel (matrix space)\n  float col = floor(outTex.x * float(outputCols + outputColPad) - 1.5);\n\n  vec4 rowIndices = texture2D(indexMappingRow, vec2(outTex.x, outTex.y));\n  vec4 colIndices = texture2D(indexMappingCol, vec2(outTex.x, outTex.y));\n\n  float rowIndex;\n  float colIndex;\n  float inputCoordX;\n  float inputCoordY;\n  vec2 inputCoords;\n  int inputChannel;\n  vec4 mappedValues = vec4(0.0, 0.0, 0.0, 0.0);\n  for (int i = 0; i < 4; i++) {\n    rowIndex = select_index(rowIndices, i);\n    colIndex = select_index(colIndices, i);\n\n    if (rowIndex != -1.0 && colIndex != -1.0) {\n      inputCoordX = (float(colIndex) + 0.5) / float(inputCols + inputColPad);\n      inputCoordY = (float(rowIndex) + 0.5) / float(inputRows);\n      inputCoords = vec2(inputCoordX, inputCoordY);\n      inputChannel = int(mod(colIndex, 4.0));\n      if (i == 0) {\n        mappedValues.r = select_index(texture2D(X, inputCoords), inputChannel);\n      } else if (i == 1) {\n        mappedValues.g = select_index(texture2D(X, inputCoords), inputChannel);\n      } else if (i == 2) {\n        mappedValues.b = select_index(texture2D(X, inputCoords), inputChannel);\n      } else if (i == 3) {\n        mappedValues.a = select_index(texture2D(X, inputCoords), inputChannel);\n      }\n    }\n\n    // set pad values to 0.0, if in padded region of output texture\n    if (outputColPad > 0 && col + 4.0 > float(outputCols)) {\n      fix_pad(mappedValues, outputColPad);\n    }\n  }\n\n  gl_FragColor = mappedValues;\n}\n";},function(t,e){t.exports="precision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D X;\nuniform int relu;\n\nvoid main(void) {\n  if (relu == 1) {\n    gl_FragColor = max(texture2D(X, vec2(outTex.x, outTex.y)), 0.0);\n  } else {\n    gl_FragColor = texture2D(X, vec2(outTex.x, outTex.y));\n  }\n}\n";},function(t,e){t.exports="// Batch normalization op.\n// This is an extension of weblas.\n// https://github.com/waylonflinn/weblas\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D X;\nuniform sampler2D gamma;\nuniform sampler2D beta;\nuniform sampler2D mean;\nuniform sampler2D std;\nuniform float epsilon;\nuniform int outputCols;\nuniform int outputColPad;\n\nvoid fix_pad(inout vec4 v, int pad) {\n  v.a = 0.0;\n  if (pad == 2) {\n    v.b = 0.0;\n  } else if (pad == 3) {\n    v.b = 0.0;\n    v.g = 0.0;\n  }\n}\n\nvoid main(void) {\n  // index of first element in pixel (matrix space)\n  float col = floor(outTex.x * float(outputCols + outputColPad) - 1.5);\n\n  vec4 _x = texture2D(X, vec2(outTex.x, outTex.y));\n  vec4 _mean = texture2D(mean, vec2(outTex.x, 0.5));\n  vec4 _std = texture2D(std, vec2(outTex.x, 0.5));\n  vec4 _gamma = texture2D(gamma, vec2(outTex.x, 0.5));\n  vec4 _beta = texture2D(beta, vec2(outTex.x, 0.5));\n  vec4 sumValues = _beta + _gamma * (_x - _mean) / sqrt(_std + epsilon);\n\n  // set pad values to 0.0, if in padded region of output texture\n  if (outputColPad > 0 && col + 4.0 > float(outputCols)) {\n    fix_pad(sumValues, outputColPad);\n  }\n\n  gl_FragColor = sumValues;\n}\n";},function(t,e){t.exports="// 2D Average Pooling op.\n// This is an extension of weblas.\n// https://github.com/waylonflinn/weblas\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D X;\nuniform sampler2D poolIndexMapping;\nuniform int inputRows;\nuniform int channels;\nuniform int channelsPad;\nuniform int poolElements;\nuniform int poolElementsPad;\n\nfloat select_index(vec4 v, int index) {\n  float val = 0.0;\n  if (index == 0) {\n    val = v.r;\n  } else if (index == 1) {\n    val = v.g;\n  } else if (index == 2) {\n    val = v.b;\n  } else if (index == 3) {\n    val = v.a;\n  }\n  return val;\n}\n\nvoid fix_pad(inout vec4 v, int pad) {\n  v.a = 0.0;\n  if (pad == 2) {\n    v.b = 0.0;\n  } else if (pad == 3) {\n    v.b = 0.0;\n    v.g = 0.0;\n  }\n}\n\nvoid main(void) {\n  // index of first element in pixel (matrix space)\n  float col = floor(outTex.x * float(channels + channelsPad) - 1.5);\n\n  float poolIndexCoordX;\n  vec4 poolIndices;\n  int poolIndexRGBA;\n  float poolIndex;\n  vec4 mappedValues;\n  float inputCoordY;\n  vec4 currentSum = vec4(0.0, 0.0, 0.0, 0.0);\n  int poolElementsEffective = poolElements;\n  for (int i = 0; i < 100; i += 1) {\n    if (i >= poolElements) {\n      break;\n    }\n\n    poolIndexCoordX = (float(i) + 0.5) / float(poolElements + poolElementsPad);\n    poolIndices = texture2D(poolIndexMapping, vec2(poolIndexCoordX, outTex.y));\n    poolIndexRGBA = int(mod(float(i), 4.0));\n    poolIndex = select_index(poolIndices, poolIndexRGBA);\n\n    if (poolIndex != -1.0) {\n      inputCoordY = (poolIndex + 0.5) / float(inputRows);\n      mappedValues = texture2D(X, vec2(outTex.x, inputCoordY));\n      currentSum = currentSum + mappedValues;\n    } else {\n      poolElementsEffective = poolElementsEffective - 1;\n    }\n  }\n\n  currentSum = currentSum / float(poolElementsEffective);\n\n  // set pad values to 0.0, if in padded region of output texture\n  if (channelsPad > 0 && col + 4.0 > float(channels)) {\n    fix_pad(mappedValues, channelsPad);\n  }\n\n  gl_FragColor = currentSum;\n}\n";},function(t,e){t.exports="// 2D Max Pooling op.\n// This is an extension of weblas.\n// https://github.com/waylonflinn/weblas\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D X;\nuniform sampler2D poolIndexMapping;\nuniform int inputRows;\nuniform int channels;\nuniform int channelsPad;\nuniform int poolElements;\nuniform int poolElementsPad;\n\nfloat select_index(vec4 v, int index) {\n  float val = 0.0;\n  if (index == 0) {\n    val = v.r;\n  } else if (index == 1) {\n    val = v.g;\n  } else if (index == 2) {\n    val = v.b;\n  } else if (index == 3) {\n    val = v.a;\n  }\n  return val;\n}\n\nvoid fix_pad(inout vec4 v, int pad) {\n  v.a = 0.0;\n  if (pad == 2) {\n    v.b = 0.0;\n  } else if (pad == 3) {\n    v.b = 0.0;\n    v.g = 0.0;\n  }\n}\n\nvoid main(void) {\n  // index of first element in pixel (matrix space)\n  float col = floor(outTex.x * float(channels + channelsPad) - 1.5);\n\n  float poolIndexCoordX;\n  vec4 poolIndices;\n  int poolIndexRGBA;\n  float poolIndex;\n  vec4 mappedValues;\n  float inputCoordY;\n  const float min = -1.0e+08;\n  vec4 currentMax = vec4(min, min, min, min);\n  for (int i = 0; i < 100; i += 1) {\n    if (i >= poolElements) {\n      break;\n    }\n\n    poolIndexCoordX = (float(i) + 0.5) / float(poolElements + poolElementsPad);\n    poolIndices = texture2D(poolIndexMapping, vec2(poolIndexCoordX, outTex.y));\n    poolIndexRGBA = int(mod(float(i), 4.0));\n    poolIndex = select_index(poolIndices, poolIndexRGBA);\n\n    if (poolIndex != -1.0) {\n      inputCoordY = (poolIndex + 0.5) / float(inputRows);\n      mappedValues = texture2D(X, vec2(outTex.x, inputCoordY));\n    }\n\n    currentMax = max(currentMax, mappedValues);\n  }\n\n  // set pad values to 0.0, if in padded region of output texture\n  if (channelsPad > 0 && col + 4.0 > float(channels)) {\n    fix_pad(mappedValues, channelsPad);\n  }\n\n  gl_FragColor = currentMax;\n}\n";},function(t,e){t.exports="// Copy texture\n// This is an extension of weblas.\n// https://github.com/waylonflinn/weblas\n\nprecision highp float;\n#define GLSLIFY 1\n\nvarying vec2 outTex;\nuniform sampler2D source;\n\nvoid main(void) {\n  gl_FragColor = texture2D(source, vec2(outTex.x, outTex.y));\n}\n";},function(t,e,n){(function(e){!function(e){"use strict";function n(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),s=new h(r||[]);return a._invoke=l(t,n,s),a;}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)};}catch(t){return{type:"throw",arg:t};}}function o(){}function i(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t);};});}function u(t){function n(e,o,i,a){var s=r(t[e],t,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==(typeof l==="undefined"?"undefined":_typeof(l))&&m.call(l,"__await")?Promise.resolve(l.__await).then(function(t){n("next",t,i,a);},function(t){n("throw",t,i,a);}):Promise.resolve(l).then(function(t){u.value=t,i(u);},a);}a(s.arg);}function o(t,e){function r(){return new Promise(function(r,o){n(t,e,r,o);});}return i=i?i.then(r,r):r();}"object"==_typeof(e.process)&&e.process.domain&&(n=e.process.domain.bind(n));var i;this._invoke=o;}function l(t,e,n){var o=O;return function i(a,s){if(o===j)throw new Error("Generator is already running");if(o===A){if("throw"===a)throw s;return v();}for(n.method=a,n.arg=s;;){var u=n.delegate;if(u){var l=c(u,n);if(l){if(l===S)continue;return l;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===O)throw o=A,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=j;var f=r(t,e,n);if("normal"===f.type){if(o=n.done?A:P,f.arg===S)continue;return{value:f.arg,done:n.done};}"throw"===f.type&&(o=A,n.method="throw",n.arg=f.arg);}};}function c(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,c(t,e),"throw"===e.method))return S;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method");}return S;}var o=r(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,S;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,S):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,S);}function f(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function p(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function h(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(f,this),this.reset(!0);}function d(t){if(t){var e=t[b];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;){if(m.call(t,n))return e.value=t[n],e.done=!1,e;}return e.value=g,e.done=!0,e;};return r.next=r;}}return{next:v};}function v(){return{value:g,done:!0};}var _=Object.prototype,m=_.hasOwnProperty,g,y="function"==typeof Symbol?Symbol:{},b=y.iterator||"@@iterator",w=y.asyncIterator||"@@asyncIterator",x=y.toStringTag||"@@toStringTag",E="object"==(typeof t==="undefined"?"undefined":_typeof(t)),T=e.regeneratorRuntime;if(T)return void(E&&(t.exports=T));T=e.regeneratorRuntime=E?t.exports:{},T.wrap=n;var O="suspendedStart",P="suspendedYield",j="executing",A="completed",S={},M={};M[b]=function(){return this;};var k=Object.getPrototypeOf,C=k&&k(k(d([])));C&&C!==_&&m.call(C,b)&&(M=C);var R=a.prototype=o.prototype=Object.create(M);i.prototype=R.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",T.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name));},T.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(R),t;},T.awrap=function(t){return{__await:t};},s(u.prototype),u.prototype[w]=function(){return this;},T.AsyncIterator=u,T.async=function(t,e,r,o){var i=new u(n(t,e,r,o));return T.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next();});},s(R),R[x]="Generator",R[b]=function(){return this;},R.toString=function(){return"[object Generator]";},T.keys=function(t){var e=[];for(var n in t){e.push(n);}return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n;}return n.done=!0,n;};},T.values=d,h.prototype={constructor:h,reset:function reset(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(p),!t)for(var e in this){"t"===e.charAt(0)&&m.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g);}},stop:function stop(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval;},dispatchException:function dispatchException(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r;}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=m.call(o,"catchLoc"),s=m.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc);}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&m.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break;}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,S):this.complete(i);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),S;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),p(n),S;}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;p(n);}return o;}}throw new Error("illegal catch attempt");},delegateYield:function delegateYield(t,e,n){return this.delegate={iterator:d(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),S;}};}("object"==(typeof e==="undefined"?"undefined":_typeof(e))?e:"object"==(typeof window==="undefined"?"undefined":_typeof(window))?window:"object"==(typeof self==="undefined"?"undefined":_typeof(self))?self:this);}).call(e,n(39));},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++){e[n]=arguments[n+1];}var r={callback:t,args:e};return d[h]=r,m(h),h++;}function o(t){delete d[t];}function i(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r);}}function a(t){if(v)setTimeout(a,0,t);else{var e=d[t];if(e){v=!0;try{i(e);}finally{o(t),v=!1;}}}}function s(){m=function m(t){e.nextTick(function(){a(t);});};}function u(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1;},t.postMessage("","*"),t.onmessage=n,e;}}function l(){var e="setImmediate$"+Math.random()+"$",n=function n(_n){_n.source===t&&"string"==typeof _n.data&&0===_n.data.indexOf(e)&&a(+_n.data.slice(e.length));};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),m=function m(n){t.postMessage(e+n,"*");};}function c(){var t=new MessageChannel();t.port1.onmessage=function(t){a(t.data);},m=function m(e){t.port2.postMessage(e);};}function f(){var t=_.documentElement;m=function m(e){var n=_.createElement("script");n.onreadystatechange=function(){a(e),n.onreadystatechange=null,t.removeChild(n),n=null;},t.appendChild(n);};}function p(){m=function m(t){setTimeout(a,0,t);};}if(!t.setImmediate){var h=1,d={},v=!1,_=t.document,m,g=Object.getPrototypeOf&&Object.getPrototypeOf(t);g=g&&g.setTimeout?g:t,"[object process]"==={}.toString.call(t.process)?s():u()?l():t.MessageChannel?c():_&&"onreadystatechange"in _.createElement("script")?f():p(),g.setImmediate=r,g.clearImmediate=o;}}("undefined"==typeof self?void 0===t?this:t:self);}).call(e,n(39),n(132));},function(t,e,n){function r(t,e){this._id=t,this._clearFn=e;}var o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout);},e.setInterval=function(){return new r(o.call(setInterval,window,arguments),clearInterval);},e.clearTimeout=e.clearInterval=function(t){t&&t.close();},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id);},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e;},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1;},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function e(){t._onTimeout&&t._onTimeout();},e));},n(636),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate;},function(t,e,n){"use strict";(function(t,r){function o(t){if(t){var e=t.length||t.byteLength,n=g.log2(e);x[n].push(t);}}function i(t){o(t.buffer);}function a(t){var t=g.nextPow2(t),e=g.log2(t),n=x[e];return n.length>0?n.pop():new ArrayBuffer(t);}function s(t){return new Uint8Array(a(t),0,t);}function u(t){return new Uint16Array(a(2*t),0,t);}function l(t){return new Uint32Array(a(4*t),0,t);}function c(t){return new Int8Array(a(t),0,t);}function f(t){return new Int16Array(a(2*t),0,t);}function p(t){return new Int32Array(a(4*t),0,t);}function h(t){return new Float32Array(a(4*t),0,t);}function d(t){return new Float64Array(a(8*t),0,t);}function v(t){return b?new Uint8ClampedArray(a(t),0,t):s(t);}function _(t){return new DataView(a(t),0,t);}function m(t){t=g.nextPow2(t);var e=g.log2(t),n=E[e];return n.length>0?n.pop():new r(t);}var g=n(297),y=n(174);t.__TYPEDARRAY_POOL||(t.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var b="undefined"!=typeof Uint8ClampedArray,w=t.__TYPEDARRAY_POOL;w.UINT8C||(w.UINT8C=y([32,0])),w.BUFFER||(w.BUFFER=y([32,0]));var x=w.DATA,E=w.BUFFER;e.free=function t(e){if(r.isBuffer(e))E[g.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var n=e.length||e.byteLength,o=0|g.log2(n);x[o].push(e);}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeInt8=e.freeInt16=e.freeInt32=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=i,e.freeArrayBuffer=o,e.freeBuffer=function t(e){E[g.log2(e.length)].push(e);},e.malloc=function t(e,n){if(void 0===n||"arraybuffer"===n)return a(e);switch(n){case"uint8":return s(e);case"uint16":return u(e);case"uint32":return l(e);case"int8":return c(e);case"int16":return f(e);case"int32":return p(e);case"float":case"float32":return h(e);case"double":case"float64":return d(e);case"uint8_clamped":return v(e);case"buffer":return m(e);case"data":case"dataview":return _(e);default:return null;}return null;},e.mallocArrayBuffer=a,e.mallocUint8=s,e.mallocUint16=u,e.mallocUint32=l,e.mallocInt8=c,e.mallocInt16=f,e.mallocInt32=p,e.mallocFloat32=e.mallocFloat=h,e.mallocFloat64=e.mallocDouble=d,e.mallocUint8Clamped=v,e.mallocDataView=_,e.mallocBuffer=m,e.clearCache=function t(){for(var e=0;e<32;++e){w.UINT8[e].length=0,w.UINT16[e].length=0,w.UINT32[e].length=0,w.INT8[e].length=0,w.INT16[e].length=0,w.INT32[e].length=0,w.FLOAT[e].length=0,w.DOUBLE[e].length=0,w.UINT8C[e].length=0,x[e].length=0,E[e].length=0;}};}).call(e,n(39),n(144).Buffer);},function(t,e){function n(t,e){if(!e||"object"!=(typeof e==="undefined"?"undefined":_typeof(e)))return t;for(var n=Object.keys(e),r=n.length;r--;){t[n[r]]=e[n[r]];}return t;}t.exports=n;}]);});
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6).setImmediate, __webpack_require__(6).clearImmediate, __webpack_require__(9)(module)))

/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

	var apply = Function.prototype.apply;
	
	// DOM APIs, for completeness
	
	exports.setTimeout = function() {
	  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
	};
	exports.setInterval = function() {
	  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
	};
	exports.clearTimeout =
	exports.clearInterval = function(timeout) {
	  if (timeout) {
	    timeout.close();
	  }
	};
	
	function Timeout(id, clearFn) {
	  this._id = id;
	  this._clearFn = clearFn;
	}
	Timeout.prototype.unref = Timeout.prototype.ref = function() {};
	Timeout.prototype.close = function() {
	  this._clearFn.call(window, this._id);
	};
	
	// Does not start the time, just sets up the members needed.
	exports.enroll = function(item, msecs) {
	  clearTimeout(item._idleTimeoutId);
	  item._idleTimeout = msecs;
	};
	
	exports.unenroll = function(item) {
	  clearTimeout(item._idleTimeoutId);
	  item._idleTimeout = -1;
	};
	
	exports._unrefActive = exports.active = function(item) {
	  clearTimeout(item._idleTimeoutId);
	
	  var msecs = item._idleTimeout;
	  if (msecs >= 0) {
	    item._idleTimeoutId = setTimeout(function onTimeout() {
	      if (item._onTimeout)
	        item._onTimeout();
	    }, msecs);
	  }
	};
	
	// setimmediate attaches itself to the global object
	__webpack_require__(7);
	exports.setImmediate = setImmediate;
	exports.clearImmediate = clearImmediate;


/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
	    "use strict";
	
	    if (global.setImmediate) {
	        return;
	    }
	
	    var nextHandle = 1; // Spec says greater than zero
	    var tasksByHandle = {};
	    var currentlyRunningATask = false;
	    var doc = global.document;
	    var registerImmediate;
	
	    function setImmediate(callback) {
	      // Callback can either be a function or a string
	      if (typeof callback !== "function") {
	        callback = new Function("" + callback);
	      }
	      // Copy function arguments
	      var args = new Array(arguments.length - 1);
	      for (var i = 0; i < args.length; i++) {
	          args[i] = arguments[i + 1];
	      }
	      // Store and register the task
	      var task = { callback: callback, args: args };
	      tasksByHandle[nextHandle] = task;
	      registerImmediate(nextHandle);
	      return nextHandle++;
	    }
	
	    function clearImmediate(handle) {
	        delete tasksByHandle[handle];
	    }
	
	    function run(task) {
	        var callback = task.callback;
	        var args = task.args;
	        switch (args.length) {
	        case 0:
	            callback();
	            break;
	        case 1:
	            callback(args[0]);
	            break;
	        case 2:
	            callback(args[0], args[1]);
	            break;
	        case 3:
	            callback(args[0], args[1], args[2]);
	            break;
	        default:
	            callback.apply(undefined, args);
	            break;
	        }
	    }
	
	    function runIfPresent(handle) {
	        // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
	        // So if we're currently running a task, we'll need to delay this invocation.
	        if (currentlyRunningATask) {
	            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
	            // "too much recursion" error.
	            setTimeout(runIfPresent, 0, handle);
	        } else {
	            var task = tasksByHandle[handle];
	            if (task) {
	                currentlyRunningATask = true;
	                try {
	                    run(task);
	                } finally {
	                    clearImmediate(handle);
	                    currentlyRunningATask = false;
	                }
	            }
	        }
	    }
	
	    function installNextTickImplementation() {
	        registerImmediate = function(handle) {
	            process.nextTick(function () { runIfPresent(handle); });
	        };
	    }
	
	    function canUsePostMessage() {
	        // The test against `importScripts` prevents this implementation from being installed inside a web worker,
	        // where `global.postMessage` means something completely different and can't be used for this purpose.
	        if (global.postMessage && !global.importScripts) {
	            var postMessageIsAsynchronous = true;
	            var oldOnMessage = global.onmessage;
	            global.onmessage = function() {
	                postMessageIsAsynchronous = false;
	            };
	            global.postMessage("", "*");
	            global.onmessage = oldOnMessage;
	            return postMessageIsAsynchronous;
	        }
	    }
	
	    function installPostMessageImplementation() {
	        // Installs an event handler on `global` for the `message` event: see
	        // * https://developer.mozilla.org/en/DOM/window.postMessage
	        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
	
	        var messagePrefix = "setImmediate$" + Math.random() + "$";
	        var onGlobalMessage = function(event) {
	            if (event.source === global &&
	                typeof event.data === "string" &&
	                event.data.indexOf(messagePrefix) === 0) {
	                runIfPresent(+event.data.slice(messagePrefix.length));
	            }
	        };
	
	        if (global.addEventListener) {
	            global.addEventListener("message", onGlobalMessage, false);
	        } else {
	            global.attachEvent("onmessage", onGlobalMessage);
	        }
	
	        registerImmediate = function(handle) {
	            global.postMessage(messagePrefix + handle, "*");
	        };
	    }
	
	    function installMessageChannelImplementation() {
	        var channel = new MessageChannel();
	        channel.port1.onmessage = function(event) {
	            var handle = event.data;
	            runIfPresent(handle);
	        };
	
	        registerImmediate = function(handle) {
	            channel.port2.postMessage(handle);
	        };
	    }
	
	    function installReadyStateChangeImplementation() {
	        var html = doc.documentElement;
	        registerImmediate = function(handle) {
	            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
	            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
	            var script = doc.createElement("script");
	            script.onreadystatechange = function () {
	                runIfPresent(handle);
	                script.onreadystatechange = null;
	                html.removeChild(script);
	                script = null;
	            };
	            html.appendChild(script);
	        };
	    }
	
	    function installSetTimeoutImplementation() {
	        registerImmediate = function(handle) {
	            setTimeout(runIfPresent, 0, handle);
	        };
	    }
	
	    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
	    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
	    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
	
	    // Don't get fooled by e.g. browserify environments.
	    if ({}.toString.call(global.process) === "[object process]") {
	        // For Node.js before 0.9
	        installNextTickImplementation();
	
	    } else if (canUsePostMessage()) {
	        // For non-IE10 modern browsers
	        installPostMessageImplementation();
	
	    } else if (global.MessageChannel) {
	        // For web workers, where supported
	        installMessageChannelImplementation();
	
	    } else if (doc && "onreadystatechange" in doc.createElement("script")) {
	        // For IE 6–8
	        installReadyStateChangeImplementation();
	
	    } else {
	        // For older browsers
	        installSetTimeoutImplementation();
	    }
	
	    attachTo.setImmediate = setImmediate;
	    attachTo.clearImmediate = clearImmediate;
	}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
	
	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(8)))

/***/ }),
/* 8 */
/***/ (function(module, exports) {

	// shim for using process in browser
	var process = module.exports = {};
	
	// cached from whatever global is present so that test runners that stub it
	// don't break things.  But we need to wrap it in a try catch in case it is
	// wrapped in strict mode code which doesn't define any globals.  It's inside a
	// function because try/catches deoptimize in certain engines.
	
	var cachedSetTimeout;
	var cachedClearTimeout;
	
	function defaultSetTimout() {
	    throw new Error('setTimeout has not been defined');
	}
	function defaultClearTimeout () {
	    throw new Error('clearTimeout has not been defined');
	}
	(function () {
	    try {
	        if (typeof setTimeout === 'function') {
	            cachedSetTimeout = setTimeout;
	        } else {
	            cachedSetTimeout = defaultSetTimout;
	        }
	    } catch (e) {
	        cachedSetTimeout = defaultSetTimout;
	    }
	    try {
	        if (typeof clearTimeout === 'function') {
	            cachedClearTimeout = clearTimeout;
	        } else {
	            cachedClearTimeout = defaultClearTimeout;
	        }
	    } catch (e) {
	        cachedClearTimeout = defaultClearTimeout;
	    }
	} ())
	function runTimeout(fun) {
	    if (cachedSetTimeout === setTimeout) {
	        //normal enviroments in sane situations
	        return setTimeout(fun, 0);
	    }
	    // if setTimeout wasn't available but was latter defined
	    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
	        cachedSetTimeout = setTimeout;
	        return setTimeout(fun, 0);
	    }
	    try {
	        // when when somebody has screwed with setTimeout but no I.E. maddness
	        return cachedSetTimeout(fun, 0);
	    } catch(e){
	        try {
	            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
	            return cachedSetTimeout.call(null, fun, 0);
	        } catch(e){
	            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
	            return cachedSetTimeout.call(this, fun, 0);
	        }
	    }
	
	
	}
	function runClearTimeout(marker) {
	    if (cachedClearTimeout === clearTimeout) {
	        //normal enviroments in sane situations
	        return clearTimeout(marker);
	    }
	    // if clearTimeout wasn't available but was latter defined
	    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
	        cachedClearTimeout = clearTimeout;
	        return clearTimeout(marker);
	    }
	    try {
	        // when when somebody has screwed with setTimeout but no I.E. maddness
	        return cachedClearTimeout(marker);
	    } catch (e){
	        try {
	            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
	            return cachedClearTimeout.call(null, marker);
	        } catch (e){
	            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
	            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
	            return cachedClearTimeout.call(this, marker);
	        }
	    }
	
	
	
	}
	var queue = [];
	var draining = false;
	var currentQueue;
	var queueIndex = -1;
	
	function cleanUpNextTick() {
	    if (!draining || !currentQueue) {
	        return;
	    }
	    draining = false;
	    if (currentQueue.length) {
	        queue = currentQueue.concat(queue);
	    } else {
	        queueIndex = -1;
	    }
	    if (queue.length) {
	        drainQueue();
	    }
	}
	
	function drainQueue() {
	    if (draining) {
	        return;
	    }
	    var timeout = runTimeout(cleanUpNextTick);
	    draining = true;
	
	    var len = queue.length;
	    while(len) {
	        currentQueue = queue;
	        queue = [];
	        while (++queueIndex < len) {
	            if (currentQueue) {
	                currentQueue[queueIndex].run();
	            }
	        }
	        queueIndex = -1;
	        len = queue.length;
	    }
	    currentQueue = null;
	    draining = false;
	    runClearTimeout(timeout);
	}
	
	process.nextTick = function (fun) {
	    var args = new Array(arguments.length - 1);
	    if (arguments.length > 1) {
	        for (var i = 1; i < arguments.length; i++) {
	            args[i - 1] = arguments[i];
	        }
	    }
	    queue.push(new Item(fun, args));
	    if (queue.length === 1 && !draining) {
	        runTimeout(drainQueue);
	    }
	};
	
	// v8 likes predictible objects
	function Item(fun, array) {
	    this.fun = fun;
	    this.array = array;
	}
	Item.prototype.run = function () {
	    this.fun.apply(null, this.array);
	};
	process.title = 'browser';
	process.browser = true;
	process.env = {};
	process.argv = [];
	process.version = ''; // empty string to avoid regexp issues
	process.versions = {};
	
	function noop() {}
	
	process.on = noop;
	process.addListener = noop;
	process.once = noop;
	process.off = noop;
	process.removeListener = noop;
	process.removeAllListeners = noop;
	process.emit = noop;
	process.prependListener = noop;
	process.prependOnceListener = noop;
	
	process.listeners = function (name) { return [] }
	
	process.binding = function (name) {
	    throw new Error('process.binding is not supported');
	};
	
	process.cwd = function () { return '/' };
	process.chdir = function (dir) {
	    throw new Error('process.chdir is not supported');
	};
	process.umask = function() { return 0; };


/***/ }),
/* 9 */
/***/ (function(module, exports) {

	module.exports = function(module) {
		if(!module.webpackPolyfill) {
			module.deprecate = function() {};
			module.paths = [];
			// module.parent = undefined by default
			module.children = [];
			module.webpackPolyfill = 1;
		}
		return module;
	}


/***/ })
/******/ ]);
//# sourceMappingURL=texdraw.js.map