diff --git a/dist/opentmi-client.js b/dist/opentmi-client.js index 0eb54a1..afdc11d 100644 --- a/dist/opentmi-client.js +++ b/dist/opentmi-client.js @@ -131,7 +131,7 @@ module.exports = function xhrAdapter(config) { var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; var response = { data: responseData, - // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201) + // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201) status: request.status === 1223 ? 204 : request.status, statusText: request.status === 1223 ? 'No Content' : request.statusText, headers: responseHeaders, @@ -393,8 +393,6 @@ var defaults = require('./../defaults'); var utils = require('./../utils'); var InterceptorManager = require('./InterceptorManager'); var dispatchRequest = require('./dispatchRequest'); -var isAbsoluteURL = require('./../helpers/isAbsoluteURL'); -var combineURLs = require('./../helpers/combineURLs'); /** * Create a new instance of Axios @@ -426,11 +424,6 @@ Axios.prototype.request = function request(config) { config = utils.merge(defaults, this.defaults, { method: 'get' }, config); config.method = config.method.toLowerCase(); - // Support baseURL config - if (config.baseURL && !isAbsoluteURL(config.url)) { - config.url = combineURLs(config.baseURL, config.url); - } - // Hook up interceptors middleware var chain = [dispatchRequest, undefined]; var promise = Promise.resolve(config); @@ -474,7 +467,7 @@ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { module.exports = Axios; -},{"./../defaults":16,"./../helpers/combineURLs":20,"./../helpers/isAbsoluteURL":22,"./../utils":27,"./InterceptorManager":10,"./dispatchRequest":12}],10:[function(require,module,exports){ +},{"./../defaults":16,"./../utils":27,"./InterceptorManager":10,"./dispatchRequest":12}],10:[function(require,module,exports){ 'use strict'; var utils = require('./../utils'); @@ -555,6 +548,8 @@ var utils = require('./../utils'); var transformData = require('./transformData'); var isCancel = require('../cancel/isCancel'); var defaults = require('../defaults'); +var isAbsoluteURL = require('./../helpers/isAbsoluteURL'); +var combineURLs = require('./../helpers/combineURLs'); /** * Throws a `Cancel` if cancellation has been requested. @@ -574,6 +569,11 @@ function throwIfCancellationRequested(config) { module.exports = function dispatchRequest(config) { throwIfCancellationRequested(config); + // Support baseURL config + if (config.baseURL && !isAbsoluteURL(config.url)) { + config.url = combineURLs(config.baseURL, config.url); + } + // Ensure headers exist config.headers = config.headers || {}; @@ -629,7 +629,7 @@ module.exports = function dispatchRequest(config) { }); }; -},{"../cancel/isCancel":8,"../defaults":16,"./../utils":27,"./transformData":15}],13:[function(require,module,exports){ +},{"../cancel/isCancel":8,"../defaults":16,"./../helpers/combineURLs":20,"./../helpers/isAbsoluteURL":22,"./../utils":27,"./transformData":15}],13:[function(require,module,exports){ 'use strict'; /** @@ -1095,6 +1095,15 @@ module.exports = function normalizeHeaderName(headers, normalizedName) { var utils = require('./../utils'); +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + /** * Parse headers into an object * @@ -1122,7 +1131,14 @@ module.exports = function parseHeaders(headers) { val = utils.trim(line.substr(i + 1)); if (key) { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } } }); @@ -1368,7 +1384,7 @@ function forEach(obj, fn) { } // Force an array if not already something iterable - if (typeof obj !== 'object' && !isArray(obj)) { + if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } @@ -1743,10 +1759,10 @@ module.exports = (function() { * 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. - * + * */ /** - * bluebird build version 3.5.0 + * bluebird build version 3.5.1 * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o (MIT license) - * @api private - */ - -var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; - -var parts = [ - 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor' -]; - -module.exports = function parseuri(str) { - var src = str, - b = str.indexOf('['), - e = str.indexOf(']'); - - if (b != -1 && e != -1) { - str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length); - } - - var m = re.exec(str || ''), - uri = {}, - i = 14; - - while (i--) { - uri[parts[i]] = m[i] || ''; - } - - if (b != -1 && e != -1) { - uri.source = src; - uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':'); - uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':'); - uri.ipv6uri = true; - } - - return uri; -}; +/** + * Parses an URI + * + * @author Steven Levithan (MIT license) + * @api private + */ + +var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; + +var parts = [ + 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor' +]; + +module.exports = function parseuri(str) { + var src = str, + b = str.indexOf('['), + e = str.indexOf(']'); + + if (b != -1 && e != -1) { + str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length); + } + + var m = re.exec(str || ''), + uri = {}, + i = 14; + + while (i--) { + uri[parts[i]] = m[i] || ''; + } + + if (b != -1 && e != -1) { + uri.source = src; + uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':'); + uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':'); + uri.ipv6uri = true; + } + + return uri; +}; },{}],63:[function(require,module,exports){ // shim for using process in browser @@ -31006,7 +31026,7 @@ function tryParse(p, str) { } catch(e){ return error(); } - return p; + return p; } /** @@ -31182,59 +31202,6 @@ module.exports = yeast; },{}],81:[function(require,module,exports){ const invariant = require('invariant'); -const Promise = require('bluebird'); - -// application modules - - -/** - * Schemas object - */ -class Schemas { - /** - * Constructor for Schemas controller. - * Object manage all low level communication and authentication - * @param {Transport} transport - transport layer for communication - */ - constructor(transport) { - invariant(transport, 'transport is mandatory'); - this._transport = transport; - } - - /** - * Get list of available collection names - * @return {Promise.>} list of collections - */ - collections() { - return this._transport.get('/api/v0/schemas') - .then(response => response.data); - } - - /** - * Get collection json schema. - * This can be used for example generate html forms. - * @param collection - * @return {Promise.} - */ - schema(collection) { - return this._transport.get(`/api/v0/schemas/${collection}`) - .then(response => response.data); - } - - /** - * get all schemas - * @return {Promise} - */ - getAllSchemas() { - return this.collections() - .then(colls => Promise.each(colls, this.schema.bind(this))); - } -} - -module.exports = Schemas; - -},{"bluebird":31,"invariant":56}],82:[function(require,module,exports){ -const invariant = require('invariant'); const {debug} = require('./utils'); class Admin { @@ -31262,21 +31229,21 @@ class Admin { /** * Update opentmi server which are connected through Transport - * @param {string} version - tag/commitId to be deployed - * @return {Promise} + * @param {string} revision - tag/commitId to be deployed + * @return {Promise} resolves when upgrade is ready */ - upgrade(version) { + upgrade(revision) { invariant(this._transport.isLoggedIn, 'Transport should be connected'); debug('request opentmi version'); return this._transport - .post('/api/v0/version', {version}) + .post('/api/v0/version', {revision}) .then(response => response.data); } } module.exports = Admin; -},{"./utils":91,"invariant":56}],83:[function(require,module,exports){ +},{"./utils":100,"invariant":56}],82:[function(require,module,exports){ const invariant = require('invariant'); const _ = require('lodash'); const Promise = require('bluebird'); @@ -31284,10 +31251,18 @@ const Promise = require('bluebird'); // application modules const {debug} = require('./utils'); +/** + * Authentication controller + * This class provides login API's like login, logout + * @example + * const auth = new Authentication(transport); + * auth + * .login('user@email.com', 'password') + * .whoami().then(user => console.log(user.toString())); + */ class Authentication { /** - * Constructor for Authentication controller. - * Object manage all low level communication and authentication + * Constructor for Authentication controller * @param {Transport} transport - transport layer for communication */ constructor(transport) { @@ -31297,8 +31272,8 @@ class Authentication { /** * Login to OpenTMI - * @param {string}email - * @param {string}password + * @param {string}email user email address + * @param {string}password user password * @param {string}token - optional token * @return {Promise.} - return a token */ @@ -31327,7 +31302,7 @@ class Authentication { /** * Find out who I'm. * Returns plain object with some details about yourself. - * @return {Promise} + * @return {Promise} resolves user details */ whoami() { return this._transport.emit('whoami'); @@ -31335,7 +31310,7 @@ class Authentication { /** * Logout - * @return {Promise} + * @return {Promise} resolves when logged out succesfully */ logout() { invariant(_.isString(this._transport.token), 'you are not logged in, jwt token missing'); @@ -31347,7 +31322,7 @@ class Authentication { module.exports = Authentication; -},{"./utils":91,"bluebird":31,"invariant":56,"lodash":59}],84:[function(require,module,exports){ +},{"./utils":100,"bluebird":31,"invariant":56,"lodash":59}],83:[function(require,module,exports){ const invariant = require('invariant'); const _ = require('lodash'); // application modules @@ -31382,6 +31357,7 @@ class Cluster { /** * Restart workers. Require admin access. + * @return {Promise} resolves when workers are resterted */ restartWorkers() { invariant(this._transport.isLoggedIn, 'Transport should be logged in as admin'); @@ -31396,6 +31372,10 @@ class Cluster { throw error; }); } + /** + * Reload clusters states + * @returns {undefined} returns nothing + */ refresh() { // @todo not required yet // invariant(this._transport.isLoggedIn, 'Transport should be logged in'); @@ -31414,88 +31394,588 @@ class Cluster { module.exports = Cluster; -},{"./utils":91,"invariant":56,"lodash":59}],85:[function(require,module,exports){ +},{"./utils":100,"invariant":56,"lodash":59}],84:[function(require,module,exports){ +// 3rd party modules // application modules const {Document} = require('./utils'); -class Resource extends Document { +class Group extends Document { /** - * Manage single resource - * @param {Transport} transport - transport layer - * @param {object} resourceJson - plain json object + * Constructor for Resources model + * @param {Transport} transport - Transport object + * @param {Object}groupJson - group as plain json */ - constructor(transport, resourceJson) { - super(transport, `/api/v0/resources/${resourceJson.id}`, resourceJson); + constructor(transport, groupJson) { + super(transport, '/api/v0/groups', groupJson); + } + + static fromId(transport, id) { + const group = new Group(transport, {_id: id}); + return group.refresh(); } /** * Get resource info as short string - * @return {string} + * @return {string} returns group data as single line */ toString() { - return `${this.id}: ${this.name()}`; + return `${this.name}`; } /** - * Get resource name or set it - * @return {string} + * Get group name + * @return {String} returns group name */ - name(value) { return this.getOrSet('name', value); } + get name() { return this.get('name'); } /** - * Manage location information - * @example - * // set site and country - * doc - * .location.site('oulu') - * .location.country('finland') - * @return {{site: (function(this:Resource)), country: (function(this:Resource)), - * city: (function(this:Resource)), address: (function(this:Resource)), postcode: - * (function(this:Resource)), room: (function(this:Resource)), subRoom: - * (function(this:Resource)), geo: (function(this:Resource))}} + * Check if group is a admin + * @return {boolean} returns true if group is admin */ - get location() { - const loc = { - site: function site(value) { return this.getOrSet('location.site', value); }.bind(this), - country: function country(value) { return this.getOrSet('location.country', value); }.bind(this), - city: function city(value) { return this.getOrSet('location.city', value); }.bind(this), - address: function address(value) { return this.getOrSet('location.address', value); }.bind(this), - postcode: function postcode(value) { return this.getOrSet('location.postcode', value); }.bind(this), - room: function room(value) { return this.getOrSet('location.room', value); }.bind(this), - subRoom: function subRoom(value) { return this.get('location.subRoom', value); }.bind(this), - geo: function geo(value) { return this.getOrSet('location.geo', value); }.bind(this) - }; - return loc; + isAdmin() { + return this.name() === 'admin'; } } -module.exports = Resource; - -},{"./utils":91}],86:[function(require,module,exports){ -// 3rd party modules -const invariant = require('invariant'); -const _ = require('lodash'); - +module.exports = Group; +},{"./utils":100}],85:[function(require,module,exports){ // application modules -const Resource = require('./resource'); -const {QueryBase, Collection, notImplemented} = require('./utils'); +const {Document} = require('./utils'); -class ResourcesQuery extends QueryBase { - /* Find resources by id - * @param {string} type - * @return {Query} + +class Item extends Document { + /** + * Manage single resource + * @param {Transport} transport - transport layer + * @param {object} resourceJson - plain json object */ - id(id) { - invariant(_.isString(id), 'id should be a string'); - return this.has({_id: id}); + constructor(transport, resourceJson) { + super(transport, '/api/v0/items', resourceJson); } /** - * Resource has parent - * @param {String} id - optional parent resource id - * @return {MongooseQueryClient} + * Get resource info as short string + * @return {string} returns single line about item + */ + toString() { + return `${this.category()}: ${this.manufacturer() ? this.manufacturer() : ''} - ${this.name()}`; + } + + /** + * Get item name or set it + * @param {String}value new name + * @return {Item|string} returns item name or Item + */ + name(value) { return this.getOrSet('name', value); } + + /** + * Get category or set it + * @param {String}value new category + * @returns {Item|String} return category or Item when update new value + */ + category(value) { + return this.getOrSet('category', value); + } + + /** + * Get manufacturer or set it + * @param {String}name - manufacturer name + * @return {Item|String} return manufactorer or Item + */ + manufacturer(name) { + return this.getOrSet({'manufacturer.name': name}); + } + + /** + * Get item image as buffer + * @return {Promise} image buffer + */ + getImage() { + return this._transport.get(`${this.path}/image`) + .then(response => response.data); + } + + barcode(value) { return this.getOrSet('barcode', value); } + + imageSrc(value) { return this.getOrSet('image_src', value); } + + description(value) { return this.getOrSet('text_description', value); } + + reference(value) { return this.getOrSet('external_reference', value); } +} + +module.exports = Item; + +},{"./utils":100}],86:[function(require,module,exports){ +// 3rd party modules +const _ = require('lodash'); +const invariant = require('invariant'); + +// application modules +const Item = require('./item'); +const {QueryBase, Collection, notImplemented} = require('./utils'); + +/** + * @class ItemsQuery + */ +class ItemsQuery extends QueryBase { + /** + * Find items by barcode + * @param {String}barcode barcore to be find + * @return {ItemsQuery} returns this + */ + barcode(barcode) { + return this.has({barcode: barcode}); + } + + /** + * Find items by name + * @param {String}name item name + * @return {ItemsQuery} returns this + */ + name(name) { + return this.has({name: name}); + } + + /** + * Find items by availability + * @param {Number|undefined}available - should be at least 1 or available amount of resources + * @return {ItemsQuery} returns this + */ + available(available = undefined) { + invariant(_.isNumber(available), 'available should be a number'); + if (_.isUndefined(available)) { + return this.has({available: {$gt: 0}}); + } + return this.has({available: available}); + } + + + /** + * Find items by category + * @param {String}category - resource category, allowed values: + * 'accessory', 'board', 'component', 'other' + * @return {ItemsQuery} returns this + */ + category(category) { + invariant(_.isString(category), 'category should be a string'); + const allowedValues = [ + 'accessory', + 'board', + 'component', + 'other']; + invariant(_.indexOf(allowedValues, category) !== -1, 'should be allowed category'); + return this.has({category: category}); + } + /** + * Find only accessories + * @return {ItemsQuery} return this + */ + categoryAccessories() { return this.category('accessory'); } + /** + * Find only boards + * @return {ItemsQuery} return this + */ + categoryBoards() { return this.category('board'); } + /** + * Find only components + * @return {ItemsQuery} return this + */ + categoryComponents() { return this.category('components'); } + /** + * Find only other category resources + * @return {ItemsQuery} return this + */ + categoryOthers() { return this.category('other'); } + + /** + * Find items by manufacturer + * @param {String}name - manufacturer + * @return {ItemsQuery} return this + */ + manufacturer(name) { + return this.has({'manufacturer.name': name}); + } +} + +class Items extends Collection { + /** + * Constructor for Items model + * @param {Transport} transport - Transport object + */ + constructor(transport) { + super(transport, '/api/v0/items'); + this._notImplemented = notImplemented; + } + + /** + * Find Items + * @return {ResultsQuery} returns Query object + */ + find() { + return new ItemsQuery(this, Item); + } + + /** + * Update documents + * @return {Promise} not implemented + */ + update() { + return this._notImplemented('Item update is not implemented'); + } +} + +module.exports = Items; + +},{"./item":85,"./utils":100,"invariant":56,"lodash":59}],87:[function(require,module,exports){ +// application modules +const {Document} = require('./utils'); +const _ = require('lodash'); +const Item = require('./item'); +const Resource = require('./resource'); +/** @class LoanItem */ +class LoanItem { + /** + * LoanItem constructor + * @param {Object}item plain object + */ + constructor(item) { + this._item = item; + } + /** + * get item as plain json + * @return {Object} returns loanitem as plain json + */ + toJson() { return _.cloneDeep(this._item); } + /** + * returns loan item as single line + * @returns {String} loan item details as single line + */ + toString() { return this._item._id; } + /** + * Get return date + * @return {Date|undefined} Date when loan is returned, otherwise undefined. + */ + returnDate() { + return this.get('return_date'); + } + /** + * get Item + * @return {Item} returns Item + */ + get item() { + return new Item(this._item); + } + /** + * get resource + * @return {Resource} returns Resource + */ + get resource() { + return new Resource(this._item.resource); + } +} + +class Loan extends Document { + /** + * Manage single resource + * @param {Transport} transport - transport layer + * @param {object} resourceJson - plain json object + */ + constructor(transport, resourceJson) { + super(transport, '/api/v0/loans', resourceJson); + } + + /** + * Get loan info as short string + * @return {string} single line about loan + */ + toString() { + return `${this.loaner()}`; + } + + /** + * Get loan date or set it (admin only) + * @param {Date} value optional date when updating + * @return {Loan|string} returns loan date or Loan + */ + loanDate(value) { return this.getOrSet('loan_date', value); } + + /** + * Get loaner or set it (admin only) + * @param {String}value optoinal loaner id when updating + * @return {Loan|string} returns loaner id or Loan + */ + loaner(value) { return this.getOrSet('loaner', value); } + + /** + * Get notes or set it (admin only) + * @param {Stirng}value optional notes when updating + * @return {Loan|String} returns notes or Loan + */ + notes(value) { return this.getOrSet('notes', value); } + + /** + * Resolve loan items + * @return {LoanItem} returns LoanItems + */ + loanItems() { + return _.map(this.get('loan_items', []), item => new LoanItem(item)); + } +} + +module.exports = Loan; + +},{"./item":85,"./resource":89,"./utils":100,"lodash":59}],88:[function(require,module,exports){ +// 3rd party modules +const _ = require('lodash'); +const invariant = require('invariant'); + +// application modules +const Loan = require('./loan'); +const { + QueryBase, Collection, notImplemented, + beginningOfDay, endOfDay +} = require('./utils'); + +/** + * @class ItemsQuery + * @example + * Loans.find() + * .loadItems() // populate loan items + * .loanDate(new Date()) //loaned today + * .exec() // do query + */ +class LoansQuery extends QueryBase { + /** + * Populate loaned items + * @returns {LoansQuery} returns LoansQuery + */ + loadItems() { + return this.populate('items.item'); + } + /** + * Populate unique resources + * @returns {LoansQuery} returns LoansQuery + */ + loadResources() { + return this.populate('items.resource'); + } + /** + * Populate loaner (User) + * @returns {LoansQuery} returns LoansQuery + */ + loadLoaner() { + return this.populate('loaner'); + } + /** + * Find loans by loan date + * @param {Date}date date when loan happens + * @returns {LoansQuery} returns LoansQuery + */ + loanDate(date) { + return this.has({loan_date: {$gte: beginningOfDay(date), $lte: endOfDay(date)}}); + } + /** + * Find loans by loaner + * @param {string}userid user id to be find + * @returns {LoansQuery} returns LoansQuery + */ + loaner(userid) { + return this.has({loaner: userid}); + } + /** + * Find loans which contains note + * @param {string}note string that should contains in loan + * @returns {LoansQuery} returns LoansQuery + */ + hasNotes(note) { + return this.has({notes: `/${note}/`}); + } +} + +/** + * Manage Loans + */ +class Loans extends Collection { + /** + * Constructor for Loans model + * @param {Transport} transport - Transport object + */ + constructor(transport) { + super(transport, '/api/v0/loans'); + this._notImplemented = notImplemented; + } + + /** + * Find loans by user + * @param {User}user user object + * @param {Transport}transport transport layer + * @return {Promise.} resolves Loans + */ + static forUser(user, transport) { + invariant(_.isObject(user), 'user should be an User object'); + const loans = new Loans(transport); + return loans.find().loaner(user.id).exec(); + } + + /** + * Construct Loans query object + * @return {LoansQuery} return loans query + */ + find() { + return new LoansQuery(this, Loan); + } + + /** + * Update documents + * @return {Promise} not implemented + */ + update() { + return this._notImplemented('Loan update is not implemented'); + } +} + +module.exports = Loans; + +},{"./loan":87,"./utils":100,"invariant":56,"lodash":59}],89:[function(require,module,exports){ +// application modules +const {Document} = require('./utils'); + + +class Resource extends Document { + /** + * Manage single resource + * @param {Transport} transport - transport layer + * @param {object} resourceJson - plain json object + */ + constructor(transport, resourceJson) { + super(transport, '/api/v0/resources', resourceJson); + } + + /** + * Get resource info as short string + * @return {string} single line of resource data + */ + toString() { + return `${this.id}: ${this.name()}`; + } + + /** + * Get resource name or set it + * @param {String}value resource name + * @return {string|Resource} resource name or Resource object + */ + name(value) { return this.getOrSet('name', value); } + + /** + * Get resource type of set it + * @param {String}value resource type + * @return {Resource|String} resource type of Resource object + */ + type(value) { return this.getOrSet('type', value); } + + /** + * Manage hw informations + * @example + * doc + * .hw.sn('123') + * .hw.imei('12334') + * .hw.firmware.name('aa') + * .hw.firmware.version('1.0.0') + * @return {Object} hardware object + */ + get hw() { + const self = this; + const hw = { + get firmware() { + return { + name: function name(value) { return this.getOrSet('hw.firmware.name', value); }.bind(self), + version: function version(value) { + return this.getOrSet('hw.firmware.version', value); + }.bind(self) + }; + }, + sn: function sn(value) { return this.getOrSet('hw.sn', value); }.bind(this), + imei: function imei(value) { return this.getOrSet('hw.imei', value); }.bind(this), + id: function id(value) { return this.getOrSet('hw.id', value); }.bind(this) + }; + return hw; + } + /** + * Manage location information + * @example + * // set site and country + * doc + * .location.site('oulu') + * .location.country('finland') + * @return {Object} Location object + */ + get location() { + const loc = { + site: function site(value) { return this.getOrSet('location.site', value); }.bind(this), + country: function country(value) { return this.getOrSet('location.country', value); }.bind(this), + city: function city(value) { return this.getOrSet('location.city', value); }.bind(this), + address: function address(value) { return this.getOrSet('location.address', value); }.bind(this), + postcode: function postcode(value) { return this.getOrSet('location.postcode', value); }.bind(this), + room: function room(value) { return this.getOrSet('location.room', value); }.bind(this), + subRoom: function subRoom(value) { return this.get('location.subRoom', value); }.bind(this), + geo: function geo(value) { return this.getOrSet('location.geo', value); }.bind(this) + }; + return loc; + } +} + +module.exports = Resource; + +},{"./utils":100}],90:[function(require,module,exports){ +// 3rd party modules +const invariant = require('invariant'); +const _ = require('lodash'); + + +// application modules +const Resource = require('./resource'); +const {QueryBase, Collection, notImplemented} = require('./utils'); + +/** + * @class ResourcesQuery + */ +class ResourcesQuery extends QueryBase { + /* Find resources by id + * @param {string} id + * @return {MongooseQueryClient} returns this + */ + id(id) { + invariant(_.isString(id), 'id should be a string'); + return this.has({_id: id}); + } + + /** + * Find resources by hwid + * @param {String} id hardware id as a string + * @return {ResourcesQuery} returns this + */ + hwid(id) { + invariant(_.isString(id), 'id should be a string'); + return this.has({'hw.id': id}); + } + + /** + * Find resources by serial number + * @param {String}sn hardware serial number as a string + * @return {ResourcesQuery} returns this + */ + hwsn(sn) { + invariant(_.isString(sn), 'sn should be a string'); + return this.has({'hw.sn': sn}); + } + + /** + * Resource has parent + * @param {String} id - optional parent resource id + * @return {ResourcesQuery} returns this */ hasParent(id = undefined) { if (_.isUndefined(id)) { @@ -31506,25 +31986,26 @@ class ResourcesQuery extends QueryBase { /** * Resource doesn't have parent - * @return {MongooseQueryClient} + * @return {ResourcesQuery} returns this */ hasNoParent() { return this.has({parent: {$exists: false}}); } /** - * Find resources with type - * @param {string} type - * @return {Query} + * Find resources with name + * @param {string} name resource name + * @return {ResourcesQuery} returns this */ name(name) { invariant(_.isString(name), 'type should be a string'); return this.has({name}); } + /** * Find resources by type - * @param {string} type - * @return {Query} + * @param {string} type resource type + * @return {ResourcesQuery} returns this */ type(type) { invariant(_.isString(type), 'type should be a string'); @@ -31533,8 +32014,8 @@ class ResourcesQuery extends QueryBase { /** * Find resources by status - * @param {string} status - * @return {Query} + * @param {string} status resource status. One of 'active', 'maintenance', 'broken' + * @return {ResourcesQuery} returns this */ status(status) { const STATUS = ['active', 'maintenance', 'broken']; @@ -31544,8 +32025,8 @@ class ResourcesQuery extends QueryBase { /** * Find resources by usage type - * @param {String} usageType - * @return {MongooseQueryClient} + * @param {String} usageType resource usage type + * @return {ResourcesQuery} returns this */ usageType(usageType) { invariant(_.isString(usageType), 'usageType should be a string'); @@ -31554,19 +32035,21 @@ class ResourcesQuery extends QueryBase { /** * Find resources by a tag - * @param {string} tag - * @param {bool} isTrue - optional - default: true - * @return {Query} + * @param {string} tag tag name + * @param {bool} isTrue tag value, optional. default: true + * @return {ResourcesQuery} returns this */ haveTag(tag, isTrue = true) { invariant(_.isBoolean(isTrue), 'isTrue should be a boolean'); - return this.has({tags: {tag: isTrue}}); + const obj = {tags: {}}; + obj.tags[tag] = isTrue; + return this.has(obj); } /** * Find resources by multiple tags - * @param {array} tags - * @return {Query} + * @param {array} tags array of tag names + * @return {ResourcesQuery} returns this */ haveTags(tags) { invariant(_.isArray(tags), 'tags should be an array'); @@ -31582,12 +32065,12 @@ class Resources extends Collection { */ constructor(transport) { super(transport, '/api/v0/resources'); - this._notImplemented = notImplemented(); + this._notImplemented = notImplemented; } /** * Find Resources - * @return {ResourcesQuery} + * @return {ResourcesQuery} returns Query object */ find() { return new ResourcesQuery(this, Resource); @@ -31595,7 +32078,7 @@ class Resources extends Collection { /** * Update documents - * @return {*} + * @return {Promise} not implemented */ update() { return this._notImplemented(); @@ -31604,7 +32087,7 @@ class Resources extends Collection { module.exports = Resources; -},{"./resource":85,"./utils":91,"invariant":56,"lodash":59}],87:[function(require,module,exports){ +},{"./resource":89,"./utils":100,"invariant":56,"lodash":59}],91:[function(require,module,exports){ // 3rd party modules // application modules const {Document} = require('./utils'); @@ -31613,40 +32096,52 @@ const {Document} = require('./utils'); class Result extends Document { /** * Constructor for Resources model - * @param {Transport} transport - Transport object + * @param {Transport}transport - Transport object + * @param {Object}resultJson result as a plain json + * @private */ constructor(transport, resultJson) { - super(transport, `/api/v0/results/${resultJson._id}`, resultJson); + super(transport, '/api/v0/results', resultJson); } /** - * Get resource info as short string - * @return {string} + * Get result as short string + * @return {string} returns result as single line */ toString() { return `${this.time()}: ${this.name} - ${this.verdict()}`; } /** - * Get resource name or set it - * @return {string} + * Get test case id + * @param {String}value set tc id + * @return {string} test case id */ - tcid() { - return this.get('tcid'); + tcid(value) { + return this.getOrSet('tcid', value); } + + /** + * Get test case id + */ get name() { return this.tcid(); } + /** + * Get test case id + */ get testcaseId() { return this.tcid(); } /** * Get result verdict - * @return {String} + * @param {String}value set verdict + * @return {String} returns test verdict */ - verdict() { - return this.get('exec.verdict'); + verdict(value) { + return this.getOrSet('exec.verdict', value); } /** * Get result creation time + * @returns {Date} result creation time */ time() { return this.get('cre.time'); @@ -31654,7 +32149,7 @@ class Result extends Document { /** * Get execution duration - * @return {*} + * @return {Number} test execution duration */ duration() { return this.get('exec.duration'); @@ -31663,120 +32158,389 @@ class Result extends Document { module.exports = Result; -},{"./utils":91}],88:[function(require,module,exports){ +},{"./utils":100}],92:[function(require,module,exports){ // 3rd party modules const _ = require('lodash'); const invariant = require('invariant'); // application modules const Result = require('./result'); -const {QueryBase, Collection, notImplemented} = require('./utils'); +const { + QueryBase, Collection, Document, notImplemented +} = require('./utils'); + +/** + * @class ResultsQuery + */ +class ResultsQuery extends QueryBase { + /** + * Find results which are using hw dut(s) + * @return {ResultsQuery} returns this + */ + isHW() { + return this.has({'exec.dut.type': 'hw'}); + } + + /** + * Find results by verdict + * @param {String}verdict test verdict + * @return {ResultsQuery} returns this + */ + verdict(verdict) { + invariant(_.isString(verdict), 'verdictr should be a string'); + return this.has({'exec.verdict': verdict}); + } + + /** + * Find failed test results + * @return {ResultsQuery} returns this + */ + isFailed() { + return this.verdict('fail'); + } + + /** + * Find pass test results + * @return {ResultsQuery} returns this + */ + isPass() { + return this.verdict('pass'); + } + + /** + * Find inconclusive results + * @return {ResultsQuery} returns this + */ + isInconclusive() { + return this.verdict(('inconclusive')); + } + + /** + * Find results which belong to campaign + * @param {String}campaign Campaign name + * @return {ResultsQuery} returns this + */ + belongToCampaign(campaign) { + invariant(_.isString(campaign), 'campaign should be a string'); + return this.has({'campaign.id': campaign}); + } + /** + * Find results which belong to job + * @param {String}job job name + * @return {ResultsQuery} returns this + */ + belongToJob(job) { + invariant(_.isString(job), 'job should be a string'); + return this.has({'job.id': job}); + } + + /** + * Find results which note contains text + * @param {String}str string that contains in note + * @return {ResultsQuery} returns this + */ + containsNote(str) { + invariant(_.isString(str), 'str should be a string'); + return this.has({'exec.note': `/${str}/`}); + } +} + +class Results extends Collection { + /** + * Constructor for Resources model + * @param {Transport} transport - Transport object + */ + constructor(transport) { + super(transport, '/api/v0/results'); + this._notImplemented = notImplemented; + this._namespace = '/results'; + } + + /** + * connects to results related sio namespace + * @returns {Promise} resolves when connected + */ + connect() { + return this._transport.connect(this._namespace); + } + + /** + * Disconnect results related sio namespace + * @return {Promise} resolves when disconnected + */ + disconnect() { + return this._transport.disconnectNamespace(this._namespace); + } + + /** + * Listen results related events + * @param {String}event event to be listen. Supported events: 'new' + * @param {Function}callback callback which is called when event received + * @return {Promise} resolves when start listening + */ + on(event, callback) { + if (event === 'new') { + return this._transport.sio('/results') + .then((socket) => { + socket.on('new', (data) => { + const result = new Result(this._transport, data); + callback(result); + }); + }); + } + return Promise.reject(new Error('Event is not supported')); + } + + /** + * Find Results + * @return {ResultsQuery} returns ResultsQuery object + * @example + * Results.find() + * .limit(10) + * .exec() // find last 10 results + */ + find() { + return new ResultsQuery(this, Result); + } + + /** + * Update documents + * @return {Promise} not implemented + */ + update() { + return this._notImplemented('results update is not implemented'); + } + + create() { + const NewResult = Document.IsNewDocument(Result); + const doc = new NewResult(this._transport); + return doc; + } +} + +module.exports = Results; + +},{"./result":91,"./utils":100,"invariant":56,"lodash":59}],93:[function(require,module,exports){ +const invariant = require('invariant'); +const Promise = require('bluebird'); + + +/** + * Schemas object + */ +class Schemas { + /** + * Constructor for Schemas controller. + * Object manage all low level communication and authentication + * @param {Transport} transport - transport layer for communication + */ + constructor(transport) { + invariant(transport, 'transport is mandatory'); + this._transport = transport; + } + + /** + * Get list of available collection names + * @return {Promise.>} list of collections + */ + collections() { + return this._transport.get('/api/v0/schemas') + .then(response => response.data); + } + + /** + * Get collection json schema. + * This can be used for example generate html forms. + * @param {String}collection collection name + * @return {Promise.} resolves collection schema as json-schema -format + */ + schema(collection) { + return this._transport.get(`/api/v0/schemas/${collection}`) + .then(response => response.data); + } + + /** + * get all schemas + * @return {Promise.} resolves array of schema objects + */ + getAllSchemas() { + return this.collections() + .then(colls => Promise.each(colls, this.schema.bind(this))); + } +} + +module.exports = Schemas; + +},{"bluebird":31,"invariant":56}],94:[function(require,module,exports){ +// 3rd party modules +// application modules +const {Document} = require('./utils'); + + +class Testcase extends Document { + /** + * Constructor for Testcase model + * @param {Transport}transport - Transport object + * @param {Object}testcaseJson testcase as a plain json + * @private + */ + constructor(transport, testcaseJson) { + super(transport, '/api/v0/testcases', testcaseJson); + } -class ResultsQuery extends QueryBase { /** - * Find results which are using hw dut(s) - * @return {ResultsQuery} + * Get result as short string + * @return {string} returns result as single line */ - isHW() { - return this.has({'exec.dut.type': 'hw'}); + toString() { + return `${this.name}: ${this.purpose()} (avg: ${this.duration()}s)`; } /** - * Find results by verdict - * @param {String}verdict - * @return {ResultsQuery} + * Get test case id + * @param {String|Testcase}value get or set testcase + * @return {string} test case id */ - verdict(verdict) { - invariant(_.isString(verdict), 'verdictr should be a string'); - return this.has({'exec.verdict': verdict}); + tcid(value) { + return this.getOrSet('tcid', value); } /** - * Find failed test results - * @return {ResultsQuery} + * Get test case id */ - isFailed() { - return this.verdict('fail'); + get name() { return this.tcid(); } + /** + * Get test case id + */ + get testcaseId() { return this.tcid(); } + + /** + * Get average execution time + * @return {Number} test execution duration in seconds + */ + duration() { + return this.get('history.durationAvg'); } /** - * Find pass test results - * @return {ResultsQuery} + * Get or set test case purpose + * @param {String}purpose purpose of tc + * @return {Testcase|String} returns purpose or Testcase */ - isPass() { - return this.verdict('pass'); + purpose(purpose) { + return this.getOrSet('other_info.purpose', purpose); } +} + +module.exports = Testcase; + +},{"./utils":100}],95:[function(require,module,exports){ +// 3rd party modules +const invariant = require('invariant'); + +// application modules +const Testcase = require('./testcase'); +const { + QueryBase, + Collection, + Document, + notImplemented +} = require('./utils'); +/** + * @class TestcasesQuery + */ +class TestcasesQuery extends QueryBase { /** - * Find inconclusive results - * @return {ResultsQuery} + * Find testcases by id + * @param {String}id testcase id + * @return {ItemsQuery} returns this */ - isInconclusive() { - return this.verdict(('inconclusive')); + tcid(id) { + return this.has({tcid: `/${id}/`}); } /** - * Find results which belong to campaign - * @param {String}campaign - * @return {ResultsQuery} + * Test case is marked as skip + * @return {TestcasesQuery} returns this */ - belongToCampaign(campaign) { - invariant(_.isString(campaign), 'campaign should be a string'); - return this.has({'campaign.id': campaign}); + isSkip() { + return this.has({'execution.skip': true}); } /** - * Find results which belong to job - * @param {String}job - * @return {ResultsQuery} + * Test case is marked as archived + * @return {TestcasesQuery} returns this */ - belongToJob(job) { - invariant(_.isString(job), 'job should be a string'); - return this.has({'job.id': job}); + isArchived() { + return this.has({'archive.value': true}); } /** - * Find results which note contains text - * @param {String}str - * @return {ResultsQuery} + * Find tests with type + * @param {String}type test case type e.g. smoke, acceptance,... + * @return {TestcasesQuery} returns this */ - containsNote(str) { - invariant(_.isString(str), 'str should be a string'); - return this.has({'exec.note': str}); + type(type) { + const ALLOWED_TYPES = [ + 'installation', + 'compatibility', + 'smoke', + 'regression', + 'acceptance', + 'alpha', + 'beta', + 'stability', + 'functional', + 'destructive', + 'performance', + 'reliability' + ]; + invariant(ALLOWED_TYPES.indexOf(type) !== 0, 'not allowed type'); + return this.has({'other_info.type': type}); } } -class Results extends Collection { +class Testcases extends Collection { /** - * Constructor for Resources model + * Constructor for Items model * @param {Transport} transport - Transport object */ constructor(transport) { - super(transport, '/api/v0/results'); - this._notImplemented = notImplemented(); + super(transport, '/api/v0/testcases'); + this._notImplemented = notImplemented; } /** - * Find Results - * @return {ResultsQuery} + * Find Testcases + * @return {TestcasesQuery} returns Query object */ find() { - return new ResultsQuery(this, Result); + return new TestcasesQuery(this, Testcase); } /** * Update documents - * @return {Promise} + * @return {Promise} not implemented */ update() { - return this._notImplemented(); + return this._notImplemented('Item update is not implemented'); + } + + /** + * Create new test case + * @return {Testcase} returns new test case without id + */ + create() { + const NewTestcase = Document.IsNewDocument(Testcase); + return new NewTestcase(this._transport); } } -module.exports = Results; +module.exports = Testcases; -},{"./result":87,"./utils":91,"invariant":56,"lodash":59}],89:[function(require,module,exports){ +},{"./testcase":94,"./utils":100,"invariant":56}],96:[function(require,module,exports){ // 3rd party modules const SocketIO = require('socket.io-client'); const axios = require('axios'); @@ -31791,8 +32555,9 @@ const {debug, timeSince} = require('../utils'); class Transport { /** * Constructor for default transport layer - * @param Rest axios(default) -kind of object which provide REST API - * @param IO socket.io-client(default) -kind of object which provide event based communication + * @param {String}host opentmi uri + * @param {Axios}Rest axios(default) -kind of object which provide REST API + * @param {SocketIO}IO socket.io-client(default) -kind of object which provide event based communication */ constructor(host = '', Rest = axios, IO = SocketIO) { this.Rest = Rest; @@ -31801,10 +32566,16 @@ class Transport { this._host = host; this._latency = undefined; this._ioRequests = {}; + this._sockets = {}; } + + get _socket() { + return _.get(this._sockets, ''); + } + /** * get authentication token - * @return {string} + * @return {string} returns token */ get token() { return this._token; @@ -31812,7 +32583,7 @@ class Transport { /** * set new token - * @param {string} token + * @param {string} token set token */ set token(token) { invariant(_.isUndefined(token) || _.isString(token), 'You should call login() first'); @@ -31821,7 +32592,7 @@ class Transport { /** * get current latency based on IO ping-pong packages - * @return {float} + * @return {float} returns IO latency */ get latency() { return this._latency; @@ -31829,7 +32600,7 @@ class Transport { /** * Check if we have logged in - and have a token - * @return {boolean} + * @return {boolean} returns true have token */ get isLoggedIn() { return _.isString(this.token); @@ -31837,11 +32608,10 @@ class Transport { /** * Check if IO is connected - * @return {boolean} + * @return {boolean} returns true when IO is connected */ get isConnected() { - const namespace = ''; - return !_.isUndefined(this._sockets[namespace]); + return !_.isUndefined(this._socket); } get _headers() { @@ -31855,7 +32625,7 @@ class Transport { /** * Connect socketIO * @param {string} namespace - optional namespace - * @return {Promise} + * @return {Promise} resolves IO connection */ connect(namespace = '') { return new Promise((resolve, reject) => { @@ -31866,64 +32636,75 @@ class Transport { }; const sioUrl = `${this._url()}${namespace}`; debug(`socketIO url: ${sioUrl}, options: ${JSON.stringify(options)}`); - this._socket = this.IO(sioUrl, options); - this._socket.once('connect', resolve); - this._socket.once('reconnect', () => { + const socket = this.IO(sioUrl, options); + socket.once('connect', () => resolve(socket)); + socket.once('reconnect', () => { debug('reconnecting'); }); - this._socket.once('connect_error', reject); - }).then(() => { + socket.once('connect_error', reject); + this._sockets[namespace] = socket; + }).then((socket) => { debug('SocketIO connected'); - this._socket.on('error', (error) => { + socket.on('error', (error) => { debug(error); }); - this._socket.on('reconnect', () => { + socket.on('reconnect', () => { debug('socketIO reconnect'); }); - this._socket.on('reconnect_attempt', () => { + socket.on('reconnect_attempt', () => { debug('socketIO reconnect_attempt'); }); - this._socket.on('reconnecting', (attempt) => { + socket.on('reconnecting', (attempt) => { debug(`socketIO reconnecting, attempt: ${attempt}`); }); - this._socket.on('reconnect_error', (error) => { + socket.on('reconnect_error', (error) => { debug(error); }); - this._socket.on('reconnect_failed', (error) => { + socket.on('reconnect_failed', (error) => { debug(error); }); - this._socket.on('exit', () => { + socket.on('exit', () => { debug('Server is attemt to exit...'); }); - this._socket.on('pong', (latency) => { + socket.on('pong', (latency) => { this._latency = latency; debug(`pong latency: ${latency}ms`); }); - return this._socket; + return socket; }) - .catch((error) => { - debug(`socketIO connection fails: ${error.message}`); - throw error; - }); + .catch((error) => { + debug(`socketIO connection fails: ${error.message}`); + throw error; + }); } /** * Disconnect SIO - * @return {Promise} + * @return {Promise} resolves when IO is disconnected */ disconnect() { + const nss = Object.keys(this._sockets); + const pending = _.map(nss, ns => this.disconnectNamespace(ns)); + return Promise.all(pending); + } + + disconnectNamespace(namespace = '') { + debug(`Disconnecting ns: ${namespace}`); + const socket = _.get(this._sockets, namespace); return new Promise((resolve) => { - invariant(this._socket, 'token is not configured'); - this._socket.once('disconnect', resolve); - this._socket.disconnect(); - }) + invariant(socket, 'socket is not open'); + socket.once('disconnect', resolve); + socket.disconnect(); + }) .then(() => { debug('SocketIO disconnected'); + _.unset(this._sockets, namespace); }); } /** * low level request for IO channel * @param {object} req - event: , data: [, timeout: { - socket.emit(req.event, req.data, (error, data) => { + this._socket.emit(req.event, req.data, (error, data) => { if (pending.isPending()) { debug(`Response in ${(new Date() - req.time)}ms`); if (error) reject(error); @@ -31971,9 +32750,10 @@ class Transport { * @param {string} event - event name * @param {object} data - optional data * @param {number} timeout - optional timeout - * @return {*} + * @return {Promise} resolves when emit is done */ emit(event, data = {}, timeout = undefined) { + invariant(_.isString(event), 'event should be a string'); return this.requestIO({event, data, timeout}); } /** @@ -31982,18 +32762,18 @@ class Transport { * default parameters: * url: '/', * method: 'get' + * @returns {Promise} resolves when request success */ request(req) { - const CancelToken = this.Rest.CancelToken; + const {CancelToken} = this.Rest; const source = CancelToken.source(); - const config = _.defaults( - req, { - url: '/', - method: 'get', - baseURL: this._host, - headers: this._headers, - cancelToken: source.token - }); + const config = _.defaults(req, { + url: '/', + method: 'get', + baseURL: this._host, + headers: this._headers, + cancelToken: source.token + }); debug(`Requesting: ${JSON.stringify(config)}`); const startTime = new Date(); return this.Rest @@ -32018,7 +32798,16 @@ class Transport { .then(() => this.request(req)); } } - throw new Error(data.message); + _.set( + error, 'message', + _.get( + error, 'response.data.message', // take message by default + _.get( + error, 'response.data.error', // then error if message not exists + error.message // last option to take original request failure reason + ) + ) + ); } else if (this.Rest.isCancel(error)) { debug(`Request canceled: ${error.message}`); } else if (error.request) { @@ -32039,45 +32828,239 @@ class Transport { * HTTP Get request to server * @param {string} url - path to the server * @param {object} data - json data - * @return {Promise} + * @return {Promise} - resolves response object */ get(url, data = undefined) { return this.request({url, data}); } + /** * HTTP post request to server * @param {string} url - path to the server * @param {object} data - optional json data * @param {object} headers - optional headers as json object - * @return {Promise} + * @return {Promise} - resolves response object */ post(url, data, headers = undefined) { - return this.request({url, method: 'post', data, headers}); + return this.request({ + url, method: 'post', data, headers + }); } + + /** + * Put request + * @param {String}url uri for request + * @param {object}data json object to be send + * @return {Promise} - resolves response object + */ put(url, data) { return this.request({url, method: 'put', data}); } + + /** + * delete request + * @param {String}url uri for request + * @return {Promise} - resolves response object + */ delete(url) { return this.request({url, method: 'delete'}); } + /** * get socketIO instance - * @return {SocketIO-client} + * @param {String}namespace namespace which socket to be get + * @return {Promise} resolves SocketIO-client object for namespace */ - get sio() { - invariant(this._socket, 'You should call Connect first'); - return this._socket; + sio(namespace = '') { + const socket = _.get(this._sockets, namespace); + return socket ? Promise.resolve(socket) : Promise.reject(new Error('No socket open for this namespace')); } } module.exports = Transport; -},{"../utils":91,"axios":3,"bluebird":31,"invariant":56,"lodash":59,"socket.io-client":67}],90:[function(require,module,exports){ +},{"../utils":100,"axios":3,"bluebird":31,"invariant":56,"lodash":59,"socket.io-client":67}],97:[function(require,module,exports){ +// 3rd party modules +const _ = require('lodash'); +const Promise = require('bluebird'); + +// application modules +const {Document} = require('./utils'); +const Group = require('./group'); +const Loans = require('./loans'); + + +class User extends Document { + /** + * Constructor for Resources model + * @param {Transport} transport - Transport object + * @param {Object}userJson User data as plain json object + */ + constructor(transport, userJson) { + super(transport, `/api/v0/users/${userJson._id}`, userJson); + } + + /** + * Get resource info as short string + * @return {string} user information as single line + */ + toString() { + return `${this.name}`; + } + + /** + * Get user name + * @return {String} returns user name + */ + get name() { return this.get('name'); } + + /** + * Get or set email address + * @param {String}email user email address + * @return {User|string} email address or this when updating + */ + email(email) { + return this.getOrSet('email', email); + } + + /** + * Get user owned apikeys + * @return {String|Object} returns apikeys + */ + apikeys() { + return this.get('apikeys'); + } + + /** + * Get last visited date + * @return {Date} returns last visited as a Date + */ + lastVisited() { + return new Date(this.get('lastVisited')); + } + + /** + * Get user registeration date + * @return {Date} returns registered date + */ + registered() { + return new Date(this.get('registered')); + } + + /** + * Get user groups + * @return {Promise.} resolves user groups + */ + groups() { + const promises = _.map( + this.get('groups'), + group => Group.fromId(this._transport, group) + ); + return Promise.all(promises); + } + + /** + * Check if user belong to admin group + * @return {Promise.} not implemented + */ + isAdmin() { + return this._isNotImplemented('is admin is not implemented'); + } + + /** + * Resolve user loans + * @return {Promise.} resolves user loans + */ + myLoans() { + return Loans.forUser(this, this._transport); + } +} + +module.exports = User; + +},{"./group":84,"./loans":88,"./utils":100,"bluebird":31,"lodash":59}],98:[function(require,module,exports){ +// 3rd party modules +const invariant = require('invariant'); +const _ = require('lodash'); + + +// application modules +const User = require('./user'); +const {QueryBase, Collection, notImplemented} = require('./utils'); + +/** + * @class UsersQuery + * @extends QueryBase + */ +class UsersQuery extends QueryBase { + /* Find users by id + * @param {string} type + * @return {Query} + */ + id(id) { + invariant(_.isString(id), 'id should be a string'); + return this.has({_id: id}); + } +} + +/** + * @extends Collection + */ +class Users extends Collection { + /** + * Constructor for Resources model + * @param {Transport} transport - transport object + */ + constructor(transport) { + super(transport, '/api/v0/users'); + this._notImplemented = notImplemented; + } + + /** + * Find Users + * @return {UsersQuery} Returns query object to find Users + */ + find() { + return new UsersQuery(this, User); + } + + /** + * Find out who am I based on login + * @return {Promise.} resolves User object + */ + whoami() { + return this._transport + .get('/auth/me') + .then(response => new User(this._transport, response.data)); + } + + /** + * Find out who am I based on login + * @param {Transport}transport Transport layer + * @return {Promise.} resolves User object + */ + static WHOAMI(transport) { + const users = new Users(transport); + return users.whoami(); + } + + /** + * Update documents + * @return {Promise} not implemented + */ + update() { + return this._notImplemented('Users update is not implemented'); + } +} + +module.exports = Users; + +},{"./user":97,"./utils":100,"invariant":56,"lodash":59}],99:[function(require,module,exports){ const debug = require('debug')('opentmi-client'); module.exports = debug; -},{"debug":36}],91:[function(require,module,exports){ +},{"debug":36}],100:[function(require,module,exports){ const debug = require('./debug'); const QueryBase = require('./rest/queryBase'); const Collection = require('./rest/collection'); @@ -32097,7 +33080,7 @@ module.exports = { objectMerge }; -},{"./debug":90,"./object-merge":92,"./rest/collection":94,"./rest/document":95,"./rest/queryBase":97,"./retry":98,"./utils":99}],92:[function(require,module,exports){ +},{"./debug":99,"./object-merge":101,"./rest/collection":103,"./rest/document":104,"./rest/queryBase":106,"./retry":107,"./utils":108}],101:[function(require,module,exports){ /* eslint-disable */ // https://github.com/rsms/js-object-merge @@ -32184,15 +33167,18 @@ objectMerge = function (o, a, b, objOrShallow) { module.exports = objectMerge; -},{}],93:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ const invariant = require('invariant'); const {notImplemented} = require('../utils'); +/** + * @private + */ class Base { /** * General base constructor for Rest resources * @param {Transport} transport - Transport object< - * @param {string} path - path for REST API + * @param {string} path - path for collection REST API */ constructor(transport, path) { invariant(transport, 'transport is mandatory'); @@ -32200,11 +33186,24 @@ class Base { this._path = path; this._notImplemented = notImplemented; } + docPath(id) { + return `${this._path}/${id}`; + } + colPath() { return this._path; } + /** + * set rest path + * @param {String}path path uri + * @return {Base} returns this + */ + setPath(path) { + this._path = path; + return this; + } } module.exports = Base; -},{"../utils":99,"invariant":56}],94:[function(require,module,exports){ +},{"../utils":108,"invariant":56}],103:[function(require,module,exports){ // 3rd party modules const invariant = require('invariant'); const _ = require('lodash'); @@ -32217,7 +33216,7 @@ class Collection extends Base { _find(query) { invariant(_.isString(query), 'query hould be a string'); invariant(this._transport.isLoggedIn, 'Transport should be logged in'); - return this._transport.get(`${this._path}?${query}`) + return this._transport.get(`${this.colPath()}?${query}`) .then(resp => resp.data); } @@ -32229,8 +33228,11 @@ class Collection extends Base { }); } - _get() { - return this._notImplemented(); + _get(id) { + invariant(_.isString(id), 'id hould be a string'); + invariant(this._transport.isLoggedIn, 'Transport should be logged in'); + return this._transport.get(this.docPath(id)) + .then(resp => resp.data); } _delete() { @@ -32244,34 +33246,51 @@ class Collection extends Base { module.exports = Collection; -},{"./base":93,"invariant":56,"lodash":59}],95:[function(require,module,exports){ +},{"./base":102,"invariant":56,"lodash":59}],104:[function(require,module,exports){ const invariant = require('invariant'); const _ = require('lodash'); +const debug = require('../debug'); const Base = require('./base'); const retryUpdate = require('./../retry'); - +/** + * Low level Document object, which handle modifications and storing + */ class Document extends Base { /** - * Low level Document object, which handle modifications and storing - * @param transport - * @param path - * @param originalJson + * Document constructor + * @param {Transport}transport transport layer + * @param {String}path Document rest uri + * @param {Object}originalJson document data as plain json */ constructor(transport, path, originalJson) { super(transport, path); - this._idProperty = originalJson.id ? 'id' : '_id'; - invariant(_.isPlainObject(originalJson), 'originalJson should be plain object'); - invariant(_.isString(originalJson[this._idProperty]), 'originalJson should have id'); - this._original = _.cloneDeep(originalJson); - this._resource = _.cloneDeep(originalJson); + this._idProperty = '_id'; + if (_.isUndefined(originalJson)) { + debug('Construct new document'); + // new object + this._original = undefined; + this._resource = {}; + } else { + debug('Construct existing document'); + // old object + invariant(_.isPlainObject(originalJson), 'originalJson should be plain object'); + invariant(_.isString(originalJson[this._idProperty]), 'originalJson should have id'); + this._original = _.cloneDeep(originalJson); + this._resource = _.cloneDeep(originalJson); + } this._changes = {}; + this._update = this._update.bind(this); + } + + get isNew() { + return _.isUndefined(this._original); } /** * Get resource data as plain json object - * @return {object} + * @return {object} returns document as plain json */ toJson() { return _.cloneDeep(this._resource); @@ -32279,7 +33298,7 @@ class Document extends Base { /** * get changes as json object - * @return {object} + * @return {object} returns changes as plain json */ getChanges() { return _.cloneDeep(this._changes); @@ -32287,7 +33306,7 @@ class Document extends Base { /** * returns true when there is changes made by client - * @return {boolean} + * @return {boolean} check if document is "dirty" - has local changes */ isDirty() { return !_.isEqual(this._original, this._resource); @@ -32297,15 +33316,18 @@ class Document extends Base { * Save document. If conflicts happen try merge and save again. * if there is no retries left or some server side changes causes conflict * promise is rejected and reason property tells was it no retries left or merge conflicts. - * @return {Promise} + * @param {Number}retryCount count how many times we try to save. + * @return {Promise} Resolves Document itself when save success */ save(retryCount = 2) { + invariant(_.isNumber(retryCount), 'retryCount should be a number'); if (this.isDirty()) { + debug('Saving existing document'); const changes = this.getChanges(); invariant(changes[this._idProperty] !== this._original[this._idProperty], `${this._idProperty} is not the same!!`); changes.version = this.version; - return retryUpdate(this._original, changes, this._update.bind(this), retryCount) + return retryUpdate(this._original, changes, this._update, retryCount) .then(() => this); } return Promise.reject(new Error('no changes')); @@ -32314,16 +33336,17 @@ class Document extends Base { /** * Get resource value by Key. * @param {String} key - key can be nested as well like "a.b.c" + * @param {String} defaultValue optional default value * @return {String|Object} value for the key or undefined if not found */ - get(key) { - return _.get(this._resource, key); + get(key, defaultValue = undefined) { + return _.get(this._resource, key, defaultValue); } /** * Set value for a key - * @param {String} key - * @param {*}value + * @param {String} key key for update + * @param {*}value value for update * @return {Document} returns this */ set(key, value) { @@ -32356,61 +33379,125 @@ class Document extends Base { } /** * getter for Document version - * @return {number} + * @return {number} returns document version number */ get version() { return this.get('__v'); } /** * Get resource identity - * @return {string} + * @return {string} returns document id */ get id() { return this.get(this._idProperty); } + get path() { return this.docPath(this.id); } + /** - * reload document information from backend - * @return {Promise} + * reload document information from backend. + * This also revert all client modified data back that is not saved! + * @return {Promise} resolves Document */ refresh() { return this._transport - .get({path: this._path}) - .then((data) => { this._original = data; }); + .get(this.path) + .then((response) => { + this._original = _.cloneDeep(response.data); + this._resource = _.cloneDeep(response.data); + }) + .then(() => this); } /** * delete this document - * @return {Promise} + * @return {Promise} Resolves when operation success */ delete() { - return this._transport.delete({path: this._path}); + return this._transport.delete({path: this.path}); } + /** + * Update document + * @param {Object}data data to be updated + * @returns {Promise} resolves when opration success + */ _update(data) { - return this._transport.put(this._path, data); + return this._transport.put(this.path, data); } } +/** + * Mix Document object so that it is + * possible to store new document + * @param {Document}base Document object + * @return {NewDocument} returns mixed Document object + * @constructor + */ +function IsNewDocument(base) { + class NewDocument extends base { + /** + * Wrap save method for first save + * @return {Promise.} resolves Document + */ + save() { + // wrap save only at the beginning. + // when document is stored first time succesfully + // wrap original save function. + debug('Saving new document'); + return this._create(this._resource) + .then((response) => { + this._original = _.cloneDeep(response.data); + this._resource = _.cloneDeep(response.data); + }) + .then(() => { + this.save = super.save; // continue old behavior + this._create = undefined; // no need create -api anymore + return this; + }); + } + /** + * create document + * @param {Object}data document data to be stored + * @returns {Promise} resolves when opration success + */ + _create(data) { + return this._transport.post(this.colPath(), data); + } + } + return NewDocument; +} +Document.IsNewDocument = IsNewDocument; module.exports = Document; -},{"./../retry":98,"./base":93,"invariant":56,"lodash":59}],96:[function(require,module,exports){ +},{"../debug":99,"./../retry":107,"./base":102,"invariant":56,"lodash":59}],105:[function(require,module,exports){ const invariant = require('invariant'); const _ = require('lodash'); const querystring = require('querystring'); /** Query class - * Is pair for [mongoose-query](https://github.com/jupe/mongoose-query) -library which allows to - * manage DB queries based on rest query parameters + * Is pair for {@link https://github.com/jupe/mongoose-query|mongoose-query} -library which allows to + * construct DB queries based on rest query parameters + * @example + * mongooseQuery + * .skip(10) // skip first 10 docs + * .limit(10) // fetch only 10 docs + * .has({a: '1'}) // find docs where a == '1' */ class MongooseQueryClient { /** * Query Constructor */ constructor() { + /** + * Raw query object which can be converted as url parameter + * @type {{q: {}}} + * @private + */ this._query = {q: {}}; } /** * parse query from string - * @param str + * @param {String}str uri parameters as a string + * @returns {MongooseQueryClient} returns itself */ fromString(str) { invariant(_.isString(str), 'str should be string'); @@ -32418,11 +33505,12 @@ class MongooseQueryClient { if (_.has(this._query, 'q')) { this._query.q = JSON.parse(_.get(this._query, 'q')); } + return this; } /** * Returns query as a url string - * @return {string} + * @return {string} returns query as a url parameters string */ toString() { const query = _.cloneDeep(this._query); @@ -32433,7 +33521,7 @@ class MongooseQueryClient { /** * Return find -part object from query - * @return {MongooseQueryClient._query.q|{}} + * @return {MongooseQueryClient._query.q|{}} returns q part of query */ get query() { return this._query.q; @@ -32446,9 +33534,10 @@ class MongooseQueryClient { get type() { return this._query.t; } + /** * do default find query - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} returns itself */ find() { this._query.t = 'find'; @@ -32462,9 +33551,10 @@ class MongooseQueryClient { get queryType() { return _.get(this._query, 't', 'find'); } + /** * do distinct query - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ distinct() { this._query.t = 'distinct'; @@ -32473,7 +33563,7 @@ class MongooseQueryClient { /** * fetch only first match document - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ findOne() { this._query.t = 'findOne'; @@ -32482,7 +33572,7 @@ class MongooseQueryClient { /** * get just count of match document - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ count() { this._query.t = 'count'; @@ -32491,7 +33581,7 @@ class MongooseQueryClient { /** * aggregate query - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ aggregate() { this._query.t = 'aggregate'; @@ -32500,8 +33590,8 @@ class MongooseQueryClient { /** * mapReduce - * @param mapFunction - * @return {MongooseQueryClient} + * @param {Function|String}mapFunction map function + * @return {MongooseQueryClient} return itself */ mapReduce(mapFunction) { if (_.isFunction(mapFunction)) { @@ -32517,19 +33607,33 @@ class MongooseQueryClient { /** * Populate selected fields - * @param {array} fields - * @return {MongooseQueryClient} + * @param {array|String|Object} fields field(s) to be populated + * @return {MongooseQueryClient} return itself */ populate(fields) { - invariant(_.isArray(fields), 'fields should be array'); - this._query.p = _.uniq(fields).join(' '); + invariant( + _.isArray(fields) || _.isString(fields) || _.isPlainObject(fields), + 'fields should be string, array or plain object' + ); + if (_.isString(fields)) { + // eslint-disable-next-line no-param-reassign + fields = [fields]; + } + if (_.isArray(fields)) { + let p = _.get(this._query, 'p', '').split(' '); + p = _.filter(p, s => s.length); + p.push(...fields); + this._query.p = _.uniq(p).join(' '); + } else { + this._query.p = _.cloneDeep(fields); + } return this; } /** * Select fields * @param {array} fields to be fetch, e.g. ['name'] - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ select(fields) { invariant(_.isArray(fields), 'fields should be array'); @@ -32540,7 +33644,7 @@ class MongooseQueryClient { /** * Result as a flat. * e.g. {"a.b": "b"} - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ asFlat() { this._query.fl = true; @@ -32550,7 +33654,7 @@ class MongooseQueryClient { /** * Result as a json * e.g. {"a": {"b": "b"}} - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ asJson() { this._query.fl = false; @@ -32560,7 +33664,7 @@ class MongooseQueryClient { /** * limit results * @param {number} limit - maximum number of results to be fetched - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ limit(limit) { invariant(_.isNumber(limit), 'limit should be number'); @@ -32571,7 +33675,7 @@ class MongooseQueryClient { /** * Skip number of results * @param {number} skip - number of document to be skip - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself */ skip(skip) { invariant(_.isNumber(skip), 'skip should be number'); @@ -32582,7 +33686,11 @@ class MongooseQueryClient { /** * Document has "something", e.g. {name: "jussi"} * @param {object} something object to be included in query - * @return {MongooseQueryClient} + * @return {MongooseQueryClient} return itself + * @example + * MongooseQueryClient + * .has({'a': 'b'}) + * .has({'a': 'b'}) */ has(something) { _.isPlainObject(something, 'something should be plain object'); @@ -32593,7 +33701,7 @@ class MongooseQueryClient { module.exports = MongooseQueryClient; -},{"invariant":56,"lodash":59,"querystring":66}],97:[function(require,module,exports){ +},{"invariant":56,"lodash":59,"querystring":66}],106:[function(require,module,exports){ // 3rd party modules const Promise = require('bluebird'); const _ = require('lodash'); @@ -32602,8 +33710,16 @@ const invariant = require('invariant'); // application modules const MongooseQueryClient = require('./mongooseQueryClient'); - +/** + * @extends MongooseQueryClient + */ class QueryBase extends MongooseQueryClient { + /** + * Constructor for QueryBase + * @param {Collection}collection collection object + * @param {Document}baseClass Class that collection holds + * @private + */ constructor(collection, baseClass) { super(); this._collection = collection; @@ -32632,7 +33748,7 @@ class QueryBase extends MongooseQueryClient { module.exports = QueryBase; -},{"./mongooseQueryClient":96,"bluebird":31,"invariant":56,"lodash":59}],98:[function(require,module,exports){ +},{"./mongooseQueryClient":105,"bluebird":31,"invariant":56,"lodash":59}],107:[function(require,module,exports){ // 3rd party modules const _ = require('lodash'); const Promise = require('bluebird'); @@ -32664,7 +33780,12 @@ const retryUpdate = function (original, changes, update, retryCount = 2, retryIn module.exports = retryUpdate; -},{"./debug":90,"./object-merge":92,"bluebird":31,"lodash":59}],99:[function(require,module,exports){ +},{"./debug":99,"./object-merge":101,"bluebird":31,"lodash":59}],108:[function(require,module,exports){ +/** + * Return object which contains duration between given date and current date + * @param {Date}when first date to be compared against current date + * @returns {Object} object which contains durations + */ module.exports.timeSince = (when) => { const obj = {}; obj._milliseconds = (new Date()).valueOf() - when.valueOf(); @@ -32682,17 +33803,56 @@ module.exports.timeSince = (when) => { return obj; }; -module.exports.notImplemented = () => Promise.reject(new Error('not implemented')); +/** + * Rejects with message "not implemented" (default msg) + * @param {String} msg - reject message + * @returns {Promise} - reject + */ +module.exports.notImplemented = (msg = 'not implemented') => Promise.reject(new Error(msg)); + +/** + * return date which are beginnign of given day + * @param {Date} date - input date + * @returns {Date} - date beginning of given day + */ +module.exports.beginningOfDay = (date) => { + const dateZero = new Date(date); + dateZero.setHours(0); + dateZero.setMinutes(0); + dateZero.setSeconds(0); + dateZero.setMilliseconds(0); + return dateZero; +}; +/** + * return date which are end of given day + * @param {Date} date - input date + * @returns {Date} - date end of given day + */ +module.exports.endOfDay = (date) => { + const dateEnd = new Date(date); + dateEnd.setHours(23); + dateEnd.setMinutes(59); + dateEnd.setSeconds(59); + dateEnd.setMilliseconds(999); + return dateEnd; +}; },{}],"opentmiClient":[function(require,module,exports){ const Authentication = require('./authentication'); -const Schemas = require('./Schemas'); +const Schemas = require('./schemas'); const Admin = require('./admin'); +const Users = require('./users'); const Cluster = require('./cluster'); const Resources = require('./resources'); const Resource = require('./resource'); const Results = require('./results'); const Result = require('./result'); +const Testcases = require('./testcases'); +const Testcase = require('./testcase'); +const Items = require('./items'); +const Item = require('./item'); +const Loans = require('./loans'); +const Loan = require('./loan'); const utils = require('./utils'); const Transport = require('./transports'); @@ -32700,14 +33860,21 @@ module.exports = { Authentication, Schemas, Admin, + Users, Cluster, Resources, Resource, Results, Result, + Testcases, + Testcase, + Items, + Item, + Loans, + Loan, utils, Transport }; -},{"./Schemas":81,"./admin":82,"./authentication":83,"./cluster":84,"./resource":85,"./resources":86,"./result":87,"./results":88,"./transports":89,"./utils":91}]},{},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,"opentmiClient",85,86,87,88,89,90,91,92,93,94,95,96,97,98,99])("opentmiClient") +},{"./admin":81,"./authentication":82,"./cluster":83,"./item":85,"./items":86,"./loan":87,"./loans":88,"./resource":89,"./resources":90,"./result":91,"./results":92,"./schemas":93,"./testcase":94,"./testcases":95,"./transports":96,"./users":98,"./utils":100}]},{},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,"opentmiClient",85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108])("opentmiClient") }); \ No newline at end of file diff --git a/dist/opentmi-client.min.js b/dist/opentmi-client.min.js index a209d1d..4ba61e1 100644 --- a/dist/opentmi-client.min.js +++ b/dist/opentmi-client.min.js @@ -1 +1 @@ -(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.opentmiClient=e()}})(function(){var e=Math.ceil,t=String.fromCharCode,n=Math.abs,r=Math.max,o=Math.min,a=Math.floor,i,s,l;return function p(c,e,t){function r(i,o){if(!e[i]){if(!c[i]){var s="function"==typeof require&&require;if(!o&&s)return s(i,!0);if(n)return n(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var d=e[i]={exports:{}};c[i][0].call(d.exports,function(t){var e=c[i][1][t];return r(e?e:t)},d,d.exports,p,c,e,t)}return e[i].exports}for(var n="function"==typeof require&&require,a=0;a=o.count)throw new Error("after called too many times");--o.count,e?(a=!0,t(e),t=r):0===o.count&&!a&&t(null,n)}var a=!1;return r=r||n,o.count=e,0===e?t():o}},{}],2:[function(e,t){t.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(0>t&&(t+=r),0>n&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),a=new Uint8Array(n-t),s=t,i=0;se}};s.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){s.headers[e]={}}),o.forEach(["post","put","patch"],function(e){s.headers[e]=o.merge(i)}),t.exports=s}).call(this,e("_process"))},{"./adapters/http":4,"./adapters/xhr":4,"./helpers/normalizeHeaderName":24,"./utils":27,_process:63}],17:[function(e,t){"use strict";t.exports=function(e,t){return function(){for(var n=Array(arguments.length),r=0;r>8-8*(o%1))){if(s=t.charCodeAt(o+=3/4),255=e.jitter?e.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=a(t*this.jitter*e);e=0==(1&a(10*t))?e-n:e+n}return 0|o(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},{}],29:[function(e,t,n){(function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r>2],o+=e[(3&n[a])<<4|n[a+1]>>4],o+=e[(15&n[a+1])<<2|n[a+2]>>6],o+=e[63&n[a+2]];return 2==r%3?o=o.substring(0,o.length-1)+"=":1==r%3&&(o=o.substring(0,o.length-2)+"=="),o},n.decode=function(e){var n=0.75*e.length,r=e.length,o=0,a,i,s,l,p;"="===e[e.length-1]&&(n--,"="===e[e.length-2]&&n--);var c=new ArrayBuffer(n),d=new Uint8Array(c);for(a=0;a>4,d[o++]=(15&s)<<4|l>>2,d[o++]=(3&l)<<6|63&p;return c}})()},{}],30:[function(e,t){(function(e){function n(e){for(var t=0,n;tt&&(t=r(0,t+e.length)),e[t]}var s=e("./util"),l=s.canEvaluate,p=s.isIdentifier,c;t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if(!!("number"==typeof e))t=i;else if(l){var n=c(e);t=null===n?a:n}else t=a;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t){"use strict";t.exports=function(t,n,r,o){var a=e("./util"),i=a.tryCatch,s=a.errorObj,l=t._async;t.prototype["break"]=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}else e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||0>=this._branchesRemainingToCancel},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):!(this._branchHasCancelled(),!this._enoughBranchesHaveCancelled())&&(this._invokeOnCancel(),!0)},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){0, no stack trace)"}function T(e){var t=41;return e.lengthe)){for(var t=[],n={},r=0,o=this;void 0!==o;++r)t.push(o),o=o._parent;e=this._length=r;for(var r=e-1,a;0<=r;--r)a=t[r].stack,void 0===n[a]&&(n[a]=r);for(var r=0;ro||0>a||!i||!l||i!==l||o>=a||(Z=function(e){if(B.test(e))return!0;var t=E(e);return t&&t.fileName===i&&o<=t.line&&t.line<=a})}},warn:g,deprecated:function(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),g(n)},CapturedTrace:w,fireDomEvent:K,fireGlobalEvent:Q}}},{"./errors":12,"./util":36}],10:[function(e,t){"use strict";t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype["return"]=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype["throw"]=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(1>=arguments.length)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(n){if(1>=arguments.length)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();return this.caught(n,function(){return r})}}},{}],11:[function(e,t){"use strict";t.exports=function(e,t){function n(){return o(this)}var r=e.reduce,o=e.all;e.prototype.each=function(e){return r(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,o){return r(e,o,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t){"use strict";function n(e,t){function n(r){return this instanceof n?void(p(this,"message","string"==typeof r?r:t),p(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)):new n(r)}return l(n,Error),n}function r(e){return this instanceof r?void(p(this,"name","OperationalError"),p(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(p(this,"message",e.message),p(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)):new r(e)}var o=e("./es5"),a=o.freeze,s=e("./util"),l=s.inherits,p=s.notEnumerableProp,c=n("Warning","warning"),d=n("CancellationError","cancellation error"),u=n("TimeoutError","timeout error"),_=n("AggregateError","aggregate error"),h,g;try{h=TypeError,g=RangeError}catch(t){h=n("TypeError","type error"),g=n("RangeError","range error")}for(var f="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;yn)){if(1<=l&&this._inFlight>=l)return r[n]=e,this._queue.push(n),!1;null!==s&&(s[n]=e);var p=this._promise,c=this._callback,_=p._boundValue();p._pushContext();var h=d(c).call(_,e,n,a),g=p._popContext();if(i.checkForgottenReturns(h,g,null===s?"Promise.map":"Promise.filter",p),h===u)return this._reject(h.e),!0;var f=o(h,this._promise);if(f instanceof t){f=f._target();var y=f._bitField;if(0==(50397184&y))return 1<=l&&this._inFlight++,r[n]=f,f._proxy(this,-1*(n+1)),!1;if(0!=(33554432&y))h=f._value();else return 0==(16777216&y)?(this._cancel(),!0):(this._reject(f._reason()),!0)}r[n]=h}else if(n=-1*n-1,r[n]=e,1<=l&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0;var m=++this._totalResolved;return!!(m>=a)&&(null===s?this._resolve(r):this._filter(r,s),!0)},s.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;0>>16)){if(e===this){var n=p();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0==(134217728&t)?y.settlePromises(this):this._settlePromises())}},a.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16))return this._setRejected(),this._fulfillmentHandler0=e,this._isFinal()?y.fatalError(e,_.isNode):void(0<(65535&t)?y.settlePromises(this):this._ensurePossibleRejectionHandled())},a.prototype._fulfillPromises=function(e,t){for(var n=1;n=this._length)&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n=this._length){var r;if(this._isMap)r=u(this._values);else{r={};for(var o=this.length(),a=0,i=this.length();a>1},t.prototype.props=function(){return i(this)},t.props=function(e){return i(e)}}},{"./es5":13,"./util":36}],26:[function(e,t){"use strict";function n(e,t,n,r,o){for(var a=0;a=this._length)&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(e,t){var n=new a;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},o.prototype._promiseRejected=function(e,t){var n=new a;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new o(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t){"use strict";t.exports=function(t,n,r){function o(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function a(e,t){if((0|t)!==t||0>t)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new o(e),a=n.promise();return n.setHowMany(t),n.init(),a}var i=e("./util"),s=e("./errors").RangeError,l=e("./errors").AggregateError,p=i.isArray,c={};i.inherits(o,n),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=p(this._values);!this._isResolved()&&e&&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(e){this._howMany=e},o.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),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(e){return this._addRejected(e),this._checkOutcome()},o.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new l,e=this.length();e=p)return c._fulfill();var a=l(e[s++]);if(a instanceof t&&a._isDisposable()){try{a=r(a._getDisposer().tryDispose(n),e.promise)}catch(t){return i(t)}if(a instanceof t)return a._then(o,i,null,null,null)}o()}var s=0,p=e.length,c=new t(a);return o(),c}function c(e,t,n){this._data=e,this._promise=t,this._context=n}function d(e,t,n){this.constructor$(e,t,n)}function u(e){return c.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function _(e){this.length=e,this.promise=null,this[e-1]=null}var h=e("./util"),g=e("./errors").TypeError,f=e("./util").inherits,y=h.errorObj,m=h.tryCatch,b={};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():b},c.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t===b?null:this.doDispose(t,e);return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},c.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},f(d,c),d.prototype.doDispose=function(e,t){var n=this.data();return n.call(e,e,t)},_.prototype._resultCancelled=function(){for(var e=this.length,n=0,r;ne)return n("you must pass at least 2 arguments to Promise.using");var o=arguments[e-1];if("function"!=typeof o)return n("expecting a function but got "+h.classString(o));var a=!0,l;2===e&&Array.isArray(arguments[0])?(l=arguments[0],e=l.length,a=!1):(l=arguments,e--);for(var d=new _(e),g=0,f;g";c=document.createElement(e)}catch(t){c=document.createElement("iframe"),c.name=o.iframeId,c.src="javascript:0"}c.id=o.iframeId,o.form.appendChild(c),o.iframe=c}var o=this;if(!this.form){var a=document.createElement("form"),i=document.createElement("textarea"),p=this.iframeId="eio_iframe_"+this.index,c;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=p,a.method="POST",a.setAttribute("accept-charset","utf-8"),i.name="d",a.appendChild(i),document.body.appendChild(a),this.form=a,this.area=i}this.form.action=this.uri(),r(),e=e.replace(l,"\\\n"),this.area.value=e.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&n()}:this.iframe.onload=n}}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./polling":45,"component-inherit":35}],44:[function(e,t){(function(n){function r(){}function o(e){if(l.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,n.location){var t="https:"===location.protocol,r=location.port;r||(r=t?443:80),this.xd=e.hostname!==n.location.hostname||r!==e.port,this.xs=e.secure!==t}}function a(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0===e.data?null:e.data,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function i(){for(var e in a.requests)a.requests.hasOwnProperty(e)&&a.requests[e].abort()}var s=e("xmlhttprequest-ssl"),l=e("./polling"),p=e("component-emitter"),c=e("component-inherit"),d=e("debug")("engine.io-client:polling-xhr");t.exports=o,t.exports.Request=a,c(o,l),o.prototype.supportsBinary=!0,o.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new a(e)},o.prototype.doWrite=function(e,t){var n=this.request({method:"POST",data:e,isBinary:"string"!=typeof e&&e!==void 0}),r=this;n.on("success",t),n.on("error",function(e){r.onError("xhr post error",e)}),this.sendXhr=n},o.prototype.doPoll=function(){d("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},p(a.prototype),a.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized},t=this.xhr=new s(e),r=this;try{d("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var o in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&t.setRequestHeader(o,this.extraHeaders[o])}catch(t){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{t.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState){var e;try{e=t.getResponseHeader("Content-Type")}catch(t){}"application/octet-stream"===e&&(t.responseType="arraybuffer")}4!==t.readyState||(200===t.status||1223===t.status?r.onLoad():setTimeout(function(){r.onError(t.status)},0))},d("xhr data %s",this.data),t.send(this.data)}catch(t){return void setTimeout(function(){r.onError(t)},0)}n.document&&(this.index=a.requestsCount++,a.requests[this.index]=this)},a.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},a.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},a.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},a.prototype.cleanup=function(e){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r,e)try{this.xhr.abort()}catch(t){}n.document&&delete a.requests[this.index],this.xhr=null}},a.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(t){}e="application/octet-stream"===t?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(t){this.onError(t)}null!=e&&this.onData(e)},a.prototype.hasXDR=function(){return"undefined"!=typeof n.XDomainRequest&&!this.xs&&this.enablesXDR},a.prototype.abort=function(){this.cleanup()},a.requestsCount=0,a.requests={},n.document&&(n.attachEvent?n.attachEvent("onunload",i):n.addEventListener&&n.addEventListener("beforeunload",i,!1))}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./polling":45,"component-emitter":34,"component-inherit":35,debug:48,"xmlhttprequest-ssl":47}],45:[function(e,t){function n(e){var t=e&&e.forceBase64;(!p||t)&&(this.supportsBinary=!1),r.call(this,e)}var r=e("../transport"),o=e("parseqs"),a=e("engine.io-parser"),i=e("component-inherit"),s=e("yeast"),l=e("debug")("engine.io-client:polling");t.exports=n;var p=function(){var t=e("xmlhttprequest-ssl"),n=new t({xdomain:!1});return null!=n.responseType}();i(n,r),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(e){function t(){l("paused"),n.readyState="paused",e()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(l("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){l("pre-pause polling complete"),--r||t()})),this.writable||(l("we are currently writing - waiting to pause"),r++,this.once("drain",function(){l("pre-pause writing complete"),--r||t()}))}else t()},n.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(e){var t=this;l("polling got data %s",e);a.decodePayload(e,this.socket.binaryType,function(e){return"opening"===t.readyState&&t.onOpen(),"close"===e.type?(t.onClose(),!1):void t.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l("ignoring poll - transport state \"%s\"",this.readyState))},n.prototype.doClose=function(){function e(){l("writing close packet"),t.write([{type:"close"}])}var t=this;"open"===this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},n.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};a.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},n.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";!1!==this.timestampRequests&&(e[this.timestampParam]=s()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"==t&&443!==+this.port||"http"==t&&80!==+this.port)&&(n=":"+this.port),e.length&&(e="?"+e);var r=-1!==this.hostname.indexOf(":");return t+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+e}},{"../transport":41,"component-inherit":35,debug:48,"engine.io-parser":50,parseqs:61,"xmlhttprequest-ssl":47,yeast:80}],46:[function(e,t){(function(n){function r(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=c&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(u=d),o.call(this,e)}var o=e("../transport"),a=e("engine.io-parser"),i=e("parseqs"),s=e("component-inherit"),l=e("yeast"),p=e("debug")("engine.io-client:websocket"),c=n.WebSocket||n.MozWebSocket,d;if("undefined"==typeof window)try{d=e("ws")}catch(t){}var u=c;u||"undefined"!=typeof window||(u=d),t.exports=r,s(r,o),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new u(e,t):new u(e):new u(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(n){t.onError("websocket error",n)}},r.prototype.write=function(e){function t(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var o=e.length,s=0,i=o;s=o&&n>>10),o=56320|1023&o),r+=f(o);return r}function l(e,t){if(55296<=e&&57343>=e){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function p(e,t){return f(128|63&e>>t)}function c(e,t){if(0==(4294967168&e))return f(e);var n="";return 0==(4294965248&e)?n=f(192|31&e>>6):0==(4294901760&e)?(!l(e,t)&&(e=65533),n=f(224|15&e>>12),n+=p(e,6)):0==(4292870144&e)&&(n=f(240|7&e>>18),n+=p(e,12),n+=p(e,6)),n+=f(128|63&e),n}function d(){if(k>=b)throw Error("Invalid byte index");var e=255&m[k];if(k++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function u(e){var t,n,r,o,a;if(k>b)throw Error("Invalid byte index");if(k==b)return!1;if(t=255&m[k],k++,0==(128&t))return t;if(192==(224&t)){if(n=d(),a=(31&t)<<6|n,128<=a)return a;throw Error("Invalid continuation byte")}if(224==(240&t)){if(n=d(),r=d(),a=(15&t)<<12|n<<6|r,2048<=a)return l(a,e)?a:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=d(),r=d(),o=d(),a=(7&t)<<18|n<<12|r<<6|o,65536<=a&&1114111>=a))return a;throw Error("Invalid UTF-8 detected")}var _="object"==typeof r&&r,h="object"==typeof n&&n&&n.exports==_&&n,g="object"==typeof e&&e;(g.global===g||g.window===g)&&(o=g);var f=t,y={version:"2.1.2",encode:function(e,t){t=t||{};for(var n=!1!==t.strict,r=a(e),o=r.length,i=-1,s="",l;++i"']/g,dt=RegExp(pt.source),ut=RegExp(ct.source),_t=/<%-([\s\S]+?)%>/g,ht=/<%([\s\S]+?)%>/g,ft=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yt=/^\w*$/,mt=/^\./,bt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kt=/[\\^$.*+?()[\]{}|]/g,xt=RegExp(kt.source),Ct=/^\s+|\s+$/g,vt=/^\s+/,jt=/\s+$/,Tt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,St=/\{\n\/\* \[wrapped with (.+)\] \*/,Et=/,? & /,wt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,At=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Rt=/\w*$/,Pt=/^[-+]0x[0-9a-f]+$/i,Ot=/^0b[01]+$/i,Bt=/^\[object .+?Constructor\]$/,It=/^0o[0-7]+$/i,qt=/^(?:0|[1-9]\d*)$/,Nt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dt=/($^)/,Lt=/['\n\r\u2028\u2029\\]/g,Ut="\\ud800-\\udfff",Ht="\\u2700-\\u27bf",Mt="a-z\\xdf-\\xf6\\xf8-\\xff",zt="A-Z\\xc0-\\xd6\\xd8-\\xde",Vt="\\xac\\xb1\\xd7\\xf7"+"\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"+"\\u2000-\\u206f"+" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wt="['\u2019]",Xt="["+Vt+"]",$t="["+("\\u0300-\\u036f"+"\\ufe20-\\ufe2f"+"\\u20d0-\\u20ff")+"]",Kt="\\d+",Qt="["+Mt+"]",Gt="[^"+Ut+Vt+Kt+Ht+Mt+zt+"]",Yt="\\ud83c[\\udffb-\\udfff]",Jt="[^"+Ut+"]",Zt="(?:\\ud83c[\\udde6-\\uddff]){2}",en="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+zt+"]",nn="(?:"+Qt+"|"+Gt+")",rn="(?:"+Wt+"(?:d|ll|m|re|s|t|ve))?",on="(?:"+Wt+"(?:D|LL|M|RE|S|T|VE))?",an="(?:"+$t+"|"+Yt+")"+"?",sn="["+"\\ufe0e\\ufe0f"+"]?",ln="(?:"+"\\u200d"+"(?:"+[Jt,Zt,en].join("|")+")"+sn+an+")*",pn=sn+an+ln,cn="(?:"+["["+Ht+"]",Zt,en].join("|")+")"+pn,dn="(?:"+[Jt+$t+"?",$t,Zt,en,"["+Ut+"]"].join("|")+")",un=/['’]/g,_n=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g,hn=RegExp(Yt+"(?="+Yt+")|"+dn+pn,"g"),gn=RegExp([tn+"?"+Qt+"+"+rn+"(?="+[Xt,tn,"$"].join("|")+")","(?:"+tn+"|"+Gt+")"+"+"+on+"(?="+[Xt,tn+nn,"$"].join("|")+")",tn+"?"+nn+"+"+rn,tn+"+"+on,"\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",Kt,cn].join("|"),"g"),fn=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/,yn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bn=-1,kn={};kn[Ye]=kn[Je]=kn[Ze]=kn[et]=kn[tt]=kn[nt]=kn[rt]=kn[ot]=kn[at]=!0,kn[Oe]=kn[Be]=kn[Qe]=kn[Ie]=kn[Ge]=kn[qe]=kn[Ne]=kn[De]=kn[Ue]=kn[He]=kn[Me]=kn[Ve]=kn[We]=kn[Xe]=kn[Ke]=!1;var xn={};xn[Oe]=xn[Be]=xn[Qe]=xn[Ge]=xn[Ie]=xn[qe]=xn[Ye]=xn[Je]=xn[Ze]=xn[et]=xn[tt]=xn[Ue]=xn[He]=xn[Me]=xn[Ve]=xn[We]=xn[Xe]=xn[$e]=xn[nt]=xn[rt]=xn[ot]=xn[at]=!0,xn[Ne]=xn[De]=xn[Ke]=!1;var Cn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vn=parseFloat,jn=parseInt,Tn="object"==typeof t&&t&&t.Object===Object&&t,Sn="object"==typeof self&&self&&self.Object===Object&&self,En=Tn||Sn||Function("return this")(),wn="object"==typeof s&&s&&!s.nodeType&&s,An=wn&&"object"==typeof n&&n&&!n.nodeType&&n,Fn=An&&An.exports===wn,Rn=Fn&&Tn.process,Pn=function(){try{return Rn&&Rn.binding&&Rn.binding("util")}catch(t){}}(),On=Pn&&Pn.isArrayBuffer,Bn=Pn&&Pn.isDate,In=Pn&&Pn.isMap,qn=Pn&&Pn.isRegExp,Nn=Pn&&Pn.isSet,Dn=Pn&&Pn.isTypedArray,Ln=P("length"),Un=O({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Hn=O({"&":"&","<":"<",">":">",'"':""","'":"'"}),Mn=O({"&":"&","<":"<",">":">",""":"\"","'":"'"}),zn=function t(n){function i(e){if(za(e)&&!Pl(e)&&!(e instanceof j)){if(e instanceof _)return e;if(Oi.call(e,"__wrapped__"))return _a(e)}return new _(e)}function s(){}function _(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function j(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Re,this.__views__=[]}function O(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Zt(e,t,n,r,o,a){var i=t&ue,s=t&_e,l;if(n&&(l=o?n(e,r,o,a):n(e)),void 0!==l)return l;if(!Ma(e))return e;var p=Pl(e);if(!p){var c=Ms(e),d=c==De||c==Le;if(Bl(e))return qr(e,i);if(c!=Me&&c!=Oe&&(!d||o)){if(!xn[c])return o?e:{};l=zo(e,c,Zt,i)}else if(l=s||d?{}:Mo(e),!i)return s?Yr(e,Qt(l,e)):Gr(e,Kt(l,e))}else if(l=Ho(e),!i)return Kr(e,l);a||(a=new wt);var _=a.get(e);if(_)return _;a.set(e,l);var h=t&he?s?Fo:Ao:s?oi:ri,g=p?void 0:h(e);return u(g||e,function(r,o){g&&(o=r,r=e[o]),Wt(l,o,Zt(r,t,n,o,e,a))}),l}function en(e){var t=ri(e);return function(n){return tn(n,e,t)}}function tn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ji(e);r--;){var o=n[r],a=t[o],i=e[o];if(void 0===i&&!(o in e)||!a(i))return!1}return!0}function nn(e,t,n){if("function"!=typeof e)throw new Ei(pe);return Ws(function(){e.apply(void 0,n)},t)}function rn(e,t,n,r){var o=-1,a=y,i=!0,s=e.length,l=[],p=t.length;if(!s)return l;n&&(t=b(t,L(n))),r?(a=m,i=!1):t.length>=le&&(a=H,i=!1,t=new ie(t));outer:for(;++on&&(n=-n>o?0:o+n),r=void 0===r||r>o?o:Ga(r),0>r&&(r+=o),r=n>r?0:Ya(r);nt}function Tn(e,t){return null!=e&&Oi.call(e,t)}function Sn(e,t){return null!=e&&t in ji(e)}function wn(e,t,n){return e>=ps(t,n)&&et?n:0,Xo(t,n)?e[t]:void 0}function or(e,t,n){var r=-1;t=b(t.length?t:[ui],L(Oo()));var o=Jn(e,function(e){var n=b(t,function(t){return t(e)});return{criteria:n,index:++r,value:e}});return I(o,function(e,t){return Wr(e,t,n)})}function ar(e,t){return ir(e,t,function(t,n){return ni(e,n)})}function ir(e,t,n){for(var r=-1,o=t.length,a={};++rt||t>Ae)return n;do t%2&&(n+=e),t=ns(t/2),t&&(e+=e);while(t);return n}function _r(e,t){return Xs(oa(e,t,ui),e+"")}function hr(e){return Ht(si(e))}function gr(e,t){var n=si(e);return pa(n,Jt(t,0,n.length))}function fr(e,t,n,r){if(!Ma(e))return e;t=Br(t,e);for(var o=-1,a=t.length,i=e;null!=i&&++ot&&(t=-t>o?0:o+t),n=n>o?o:n,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=bi(o);++r>>1){for(;r>>1,i=e[a];null!==i&&!$a(i)&&(n?i<=t:i=le){var p=t?null:Ds(e);if(p)return Z(p);i=!1,o=H,l=new ie}else l=t?[]:s;outer:for(;++rr)return r?Tr(e[0]):[];for(var o=-1,a=bi(r);++o=r?e:mr(e,t,n)}function qr(e,t){if(t)return e.slice();var n=e.length,r=zi?zi(n):new e.constructor(n);return e.copy(r),r}function Nr(e){var t=new e.constructor(e.byteLength);return new Mi(t).set(new Mi(e)),t}function Dr(e,t){var n=t?Nr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Lr(e,t,n){var r=t?n(G(e),ue):G(e);return x(r,l,new e.constructor)}function Ur(e){var t=new e.constructor(e.source,Rt.exec(e));return t.lastIndex=e.lastIndex,t}function Hr(e,t,n){var r=t?n(Z(e),ue):Z(e);return x(r,p,new e.constructor)}function Mr(e){return ws?ji(ws.call(e)):{}}function zr(e,t){var n=t?Nr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Vr(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e===e,a=$a(e),i=void 0!==t,s=null===t,l=t===t,p=$a(t);if(!s&&!p&&!a&&e>t||a&&i&&l&&!s&&!p||r&&i&&l||!n&&l||!o)return 1;if(!r&&!a&&!p&&e=s)return l;var p=n[r];return l*("desc"==p?-1:1)}return e.index-t.index}function Xr(e,t,n,r){for(var o=-1,a=e.length,i=n.length,s=-1,l=t.length,p=ls(a-i,0),c=bi(l+p),d=!r;++so?void 0:a,o=1),t=ji(t);++ra&&i[0]!==l&&i[a-1]!==l?[]:J(i,l);if(a-=p.length,an)return n?ur(t,e):t;var r=ur(t,ts(e/re(t)));return $(t)?Ir(oe(r),0,e).join(""):r.slice(0,e)}function go(e,t,n,r){function o(){for(var t=-1,s=arguments.length,l=-1,p=r.length,d=bi(p+s),u=this&&this!==En&&this instanceof o?i:e;++ls))return!1;var p=a.get(e);if(p&&a.get(t))return p==t;var c=-1,d=!0,u=n&fe?new ie:void 0;for(a.set(e,t),a.set(t,e);++ct.length?e:gn(e,mr(t,0,-1))}function ia(e,t){for(var n=e.length,r=ps(t.length,n),o=Kr(e),a;r--;)a=t[r],e[r]=Xo(a,n)?o[a]:void 0;return e}function sa(e,t,n){var r=t+"";return Xs(e,Vo(r,ua(Lo(r),n)))}function la(e){var t=0,n=0;return function(){var r=cs(),o=16-(r-n);if(n=r,!(0=800)return arguments[0];return e.apply(void 0,arguments)}}function pa(e,t){var n=-1,r=e.length;for(t=void 0===t?r:t;++no&&(o=ls(r+o,0)),E(e,Oo(t,3),o)}function ga(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=Ga(n),o=0>n?ls(r+o,0):ps(o,r-1)),E(e,Oo(t,3),o,!0)}function fa(e){var t=null==e?0:e.length;return t?pn(e,1):[]}function ya(e){return e&&e.length?e[0]:void 0}function ma(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function ba(e,t){return e&&e.length&&t&&t.length?lr(e,t):e}function ka(e){return null==e?e:_s.call(e)}function xa(e){if(!(e&&e.length))return[];var t=0;return e=f(e,function(e){if(Na(e))return t=ls(e.length,t),!0}),N(t,function(t){return b(e,P(t))})}function Ca(e,t){if(!(e&&e.length))return[];var n=xa(e);return null==t?n:b(n,function(e){return c(t,void 0,e)})}function va(e){var t=i(e);return t.__chain__=!0,t}function ja(e,t){return t(e)}function Ta(e,t){var n=Pl(e)?u:Rs;return n(e,Oo(t,3))}function Sa(e,t){var n=Pl(e)?h:Ps;return n(e,Oo(t,3))}function Ea(e,t){var n=Pl(e)?b:Jn;return n(e,Oo(t,3))}function wa(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,xo(e,je,void 0,void 0,void 0,void 0,t)}function Aa(e,t){var n;if("function"!=typeof t)throw new Ei(pe);return e=Ga(e),function(){return 0<--e&&(n=t.apply(this,arguments)),1>=e&&(t=void 0),n}}function Fa(e,t,n){t=n?void 0:t;var r=xo(e,ke,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=Fa.placeholder,r}function Ra(e,t,n){t=n?void 0:t;var r=xo(e,xe,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=Ra.placeholder,r}function Pa(e,t,n){function r(t){var n=h,r=g;return h=g=void 0,c=t,y=e.apply(r,n),y}function o(e){return c=e,m=Ws(s,t),d?r(e):y}function a(e){var n=e-b,r=e-c,o=t-n;return u?ps(o,f-r):o}function i(e){var n=e-b,r=e-c;return void 0==b||n>=t||0>n||u&&r>=f}function s(){var e=kl();return i(e)?l(e):void(m=Ws(s,a(e)))}function l(e){return(m=void 0,_&&h)?r(e):(h=g=void 0,y)}function p(){var e=kl(),n=i(e);if(h=arguments,g=this,b=e,n){if(void 0===m)return o(b);if(u)return m=Ws(s,t),r(b)}return void 0===m&&(m=Ws(s,t)),y}var c=0,d=!1,u=!1,_=!0,h,g,f,y,m,b;if("function"!=typeof e)throw new Ei(pe);return t=Ja(t)||0,Ma(n)&&(d=!!n.leading,u="maxWait"in n,f=u?ls(Ja(n.maxWait)||0,t):f,_="trailing"in n?!!n.trailing:_),p.cancel=function(){void 0!==m&&Ns(m),c=0,h=b=g=m=void 0},p.flush=function(){return void 0===m?y:l(kl())},p}function Oa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ei(pe);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(Oa.Cache||ae),n}function Ba(e){if("function"!=typeof e)throw new Ei(pe);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2]);}return!e.apply(this,t)}}function Ia(e,t){return e===t||e!==e&&t!==t}function qa(e){return null!=e&&Ha(e.length)&&!La(e)}function Na(e){return za(e)&&qa(e)}function Da(e){if(!za(e))return!1;var t=yn(e);return t==Ne||t=="[object DOMException]"||"string"==typeof e.message&&"string"==typeof e.name&&!Wa(e)}function La(e){if(!Ma(e))return!1;var t=yn(e);return t==De||t==Le||t=="[object AsyncFunction]"||t=="[object Proxy]"}function Ua(e){return"number"==typeof e&&e==Ga(e)}function Ha(e){return"number"==typeof e&&-1e?-1:1;return t*1.7976931348623157e308}return e===e?e:0}function Ga(e){var t=Qa(e),n=t%1;return t===t?n?t-n:t:0}function Ya(e){return e?Jt(Ga(e),0,Re):0}function Ja(e){if("number"==typeof e)return e;if($a(e))return Fe;if(Ma(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ma(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ct,"");var n=Ot.test(e);return n||It.test(e)?jn(e.slice(2),n?2:8):Pt.test(e)?Fe:+e}function Za(e){return Qr(e,oi(e))}function ei(e){return null==e?"":jr(e)}function ti(e,t,n){var r=null==e?void 0:gn(e,t);return void 0===r?n:r}function ni(e,t){return null!=e&&Uo(e,t,Sn)}function ri(e){return qa(e)?Ut(e):Qn(e)}function oi(e){return qa(e)?Ut(e,!0):Gn(e)}function ai(e,t){if(null==e)return{};var n=b(Fo(e),function(e){return[e]});return t=Oo(t),ir(e,n,function(e,n){return t(e,n[0])})}function ii(e,t,n){t=Br(t,e);var r=-1,o=t.length;for(o||(o=1,e=void 0);++rn)return!1;var r=t.length-1;return n==r?t.pop():$i.call(t,n,1),--this.size,!0},te.prototype.get=function(e){var t=this.__data__,n=Xt(t,e);return 0>n?void 0:t[n][1]},te.prototype.has=function(e){return-1r?(++this.size,n.push([e,t])):n[r][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new O,map:new(gs||te),string:new O}},ae.prototype["delete"]=function(e){var t=Bo(this,e)["delete"](e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Bo(this,e).get(e)},ae.prototype.has=function(e){return Bo(this,e).has(e)},ae.prototype.set=function(e,t){var n=Bo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ie.prototype.add=ie.prototype.push=function(e){return this.__data__.set(e,ce),this},ie.prototype.has=function(e){return this.__data__.has(e)},wt.prototype.clear=function(){this.__data__=new te,this.size=0},wt.prototype["delete"]=function(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n},wt.prototype.get=function(e){return this.__data__.get(e)},wt.prototype.has=function(e){return this.__data__.has(e)},wt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!gs||r.length=t}),Rl=Ln(function(){return arguments}())?Ln:function(e){return za(e)&&Oi.call(e,"callee")&&!Xi.call(e,"callee")},Pl=bi.isArray,Ol=On?L(On):function(e){return za(e)&&yn(e)==Qe},Bl=os||mi,Il=Bn?L(Bn):function(e){return za(e)&&yn(e)==qe},ql=In?L(In):function(e){return za(e)&&Ms(e)==Ue},Nl=qn?L(qn):function(e){return za(e)&&yn(e)==Ve},Dl=Nn?L(Nn):function(e){return za(e)&&Ms(e)==We},Ll=Dn?L(Dn):function(e){return za(e)&&Ha(e.length)&&!!kn[yn(e)]},Ul=yo(Yn),Hl=yo(function(e,t){return e<=t}),Ml=Zr(function(e,t){if(Jo(t)||qa(t))return void Qr(t,ri(t),e);for(var n in t)Oi.call(t,n)&&Wt(e,n,t[n])}),zl=Zr(function(e,t){Qr(t,oi(t),e)}),Vl=Zr(function(e,t,n,r){Qr(t,oi(t),e,r)}),Wl=Zr(function(e,t,n,r){Qr(t,ri(t),e,r)}),Xl=wo(Yt),$l=_r(function(e){return e.push(void 0,Co),c(Vl,void 0,e)}),Kl=_r(function(e){return e.push(void 0,vo),c(Zl,void 0,e)}),Ql=co(function(e,t,n){e[t]=n},di(ui)),Gl=co(function(e,t,n){Oi.call(e,t)?e[t].push(n):e[t]=[n]},Oo),Yl=_r(Pn),Jl=Zr(function(e,t,n){tr(e,t,n)}),Zl=Zr(function(e,t,n,r){tr(e,t,n,r)}),ep=wo(function(e,t){var n={};if(null==e)return n;var r=!1;t=b(t,function(t){return t=Br(t,e),r||(r=1--e)return t.apply(this,arguments)}},i.ary=wa,i.assign=Ml,i.assignIn=zl,i.assignInWith=Vl,i.assignWith=Wl,i.at=Xl,i.before=Aa,i.bind=xl,i.bindAll=_p,i.bindKey=Cl,i.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pl(e)?e:[e]},i.chain=va,i.chunk=function(e,t,n){t=(n?$o(e,t,n):void 0===t)?1:ls(Ga(t),0);var r=null==e?0:e.length;if(!r||1>t)return[];for(var o=0,a=0,i=bi(ts(r/t));ot?0:t,r)):[]},i.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?(t=n||void 0===t?1:Ga(t),t=r-t,mr(e,0,0>t?0:t)):[]},i.dropRightWhile=function(e,t){return e&&e.length?wr(e,Oo(t,3),!0,!0):[]},i.dropWhile=function(e,t){return e&&e.length?wr(e,Oo(t,3),!0):[]},i.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&$o(e,t,n)&&(n=0,r=o),sn(e,t,n,r)):[]},i.filter=function(e,t){var n=Pl(e)?f:ln;return n(e,Oo(t,3))},i.flatMap=function(e,t){return pn(Ea(e,t),1)},i.flatMapDeep=function(e,t){return pn(Ea(e,t),we)},i.flatMapDepth=function(e,t,n){return n=void 0===n?1:Ga(n),pn(Ea(e,t),n)},i.flatten=fa,i.flattenDeep=function(e){var t=null==e?0:e.length;return t?pn(e,we):[]},i.flattenDepth=function(e,t){var n=null==e?0:e.length;return n?(t=void 0===t?1:Ga(t),pn(e,t)):[]},i.flip=function(e){return xo(e,Se)},i.flow=hp,i.flowRight=gp,i.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={},o;++t>>0,!n)?[]:(e=ei(e),e&&("string"==typeof t||null!=t&&!Nl(t))&&(t=jr(t),!t&&$(e))?Ir(oe(e),0,n):e.split(t,n))},i.spread=function(e,t){if("function"!=typeof e)throw new Ei(pe);return t=null==t?0:ls(Ga(t),0),_r(function(n){var r=n[t],o=Ir(n,0,t);return r&&k(o,r),c(e,this,o)})},i.tail=function(e){var t=null==e?0:e.length;return t?mr(e,1,t):[]},i.take=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:Ga(t),mr(e,0,0>t?0:t)):[]},i.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?(t=n||void 0===t?1:Ga(t),t=r-t,mr(e,0>t?0:t,r)):[]},i.takeRightWhile=function(e,t){return e&&e.length?wr(e,Oo(t,3),!1,!0):[]},i.takeWhile=function(e,t){return e&&e.length?wr(e,Oo(t,3)):[]},i.tap=function(e,t){return t(e),e},i.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Ei(pe);return Ma(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Pa(e,t,{leading:r,maxWait:t,trailing:o})},i.thru=ja,i.toArray=Ka,i.toPairs=np,i.toPairsIn=rp,i.toPath=function(e){return Pl(e)?b(e,ca):$a(e)?[e]:Kr($s(ei(e)))},i.toPlainObject=Za,i.transform=function(e,t,n){var r=Pl(e),o=r||Bl(e)||Ll(e);if(t=Oo(t,4),null==n){var a=e&&e.constructor;n=o?r?new a:[]:Ma(e)?La(a)?Fs(Vi(e)):{}:{}}return(o?u:cn)(e,function(e,r,o){return t(n,e,r,o)}),n},i.unary=function(e){return wa(e,1)},i.union=nl,i.unionBy=rl,i.unionWith=ol,i.uniq=function(e){return e&&e.length?Tr(e):[]},i.uniqBy=function(e,t){return e&&e.length?Tr(e,Oo(t,2)):[]},i.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Tr(e,void 0,t):[]},i.unset=function(e,t){return null==e||Sr(e,t)},i.unzip=xa,i.unzipWith=Ca,i.update=function(e,t,n){return null==e?e:Er(e,t,Or(n))},i.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Er(e,t,Or(n),r)},i.values=si,i.valuesIn=function(e){return null==e?[]:U(e,oi(e))},i.without=al,i.words=ci,i.wrap=function(e,t){return Sl(Or(t),e)},i.xor=il,i.xorBy=sl,i.xorWith=ll,i.zip=pl,i.zipObject=function(e,t){return Rr(e||[],t||[],Wt)},i.zipObjectDeep=function(e,t){return Rr(e||[],t||[],fr)},i.zipWith=cl,i.entries=np,i.entriesIn=rp,i.extend=zl,i.extendWith=Vl,hi(i,i),i.add=vp,i.attempt=up,i.camelCase=op,i.capitalize=li,i.ceil=jp,i.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=Ja(n),n=n===n?n:0),void 0!==t&&(t=Ja(t),t=t===t?t:0),Jt(Ja(e),t,n)},i.clone=function(e){return Zt(e,he)},i.cloneDeep=function(e){return Zt(e,ue|he)},i.cloneDeepWith=function(e,t){return t="function"==typeof t?t:void 0,Zt(e,ue|he,t)},i.cloneWith=function(e,t){return t="function"==typeof t?t:void 0,Zt(e,he,t)},i.conformsTo=function(e,t){return null==t||tn(e,t,ri(t))},i.deburr=pi,i.defaultTo=function(e,t){return null==e||e!==e?t:e},i.divide=Tp,i.endsWith=function(e,t,n){e=ei(e),t=jr(t);var r=e.length;n=void 0===n?r:Jt(Ga(n),0,r);var o=n;return n-=t.length,0<=n&&e.slice(n,o)==t},i.eq=Ia,i.escape=function(e){return e=ei(e),e&&ut.test(e)?e.replace(ct,Hn):e},i.escapeRegExp=function(e){return e=ei(e),e&&xt.test(e)?e.replace(kt,"\\$&"):e},i.every=function(e,t,n){var r=Pl(e)?g:on;return n&&$o(e,t,n)&&(t=void 0),r(e,Oo(t,3))},i.find=_l,i.findIndex=ha,i.findKey=function(e,t){return S(e,Oo(t,3),cn)},i.findLast=hl,i.findLastIndex=ga,i.findLastKey=function(e,t){return S(e,Oo(t,3),dn)},i.floor=Sp,i.forEach=Ta,i.forEachRight=Sa,i.forIn=function(e,t){return null==e?e:Os(e,Oo(t,3),oi)},i.forInRight=function(e,t){return null==e?e:Bs(e,Oo(t,3),oi)},i.forOwn=function(e,t){return e&&cn(e,Oo(t,3))},i.forOwnRight=function(e,t){return e&&dn(e,Oo(t,3))},i.get=ti,i.gt=Al,i.gte=Fl,i.has=function(e,t){return null!=e&&Uo(e,t,Tn)},i.hasIn=ni,i.head=ya,i.identity=ui,i.includes=function(e,t,n,r){e=qa(e)?e:si(e),n=n&&!r?Ga(n):0;var o=e.length;return 0>n&&(n=ls(o+n,0)),Xa(e)?n<=o&&-1o&&(o=ls(r+o,0)),w(e,t,o)},i.inRange=function(e,t,n){return t=Qa(t),void 0===n?(n=t,t=0):n=Qa(n),e=Ja(e),wn(e,t,n)},i.invoke=Yl,i.isArguments=Rl,i.isArray=Pl,i.isArrayBuffer=Ol,i.isArrayLike=qa,i.isArrayLikeObject=Na,i.isBoolean=function(e){return!0===e||!1===e||za(e)&&yn(e)==Ie},i.isBuffer=Bl,i.isDate=Il,i.isElement=function(e){return za(e)&&1===e.nodeType&&!Wa(e)},i.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Pl(e)||"string"==typeof e||"function"==typeof e.splice||Bl(e)||Ll(e)||Rl(e)))return!e.length;var t=Ms(e);if(t==Ue||t==We)return!e.size;if(Jo(e))return!Qn(e).length;for(var n in e)if(Oi.call(e,n))return!1;return!0},i.isEqual=function(e,t){return Vn(e,t)},i.isEqualWith=function(e,t,n){n="function"==typeof n?n:void 0;var r=n?n(e,t):void 0;return void 0===r?Vn(e,t,void 0,n):!!r},i.isError=Da,i.isFinite=function(e){return"number"==typeof e&&as(e)},i.isFunction=La,i.isInteger=Ua,i.isLength=Ha,i.isMap=ql,i.isMatch=function(e,t){return e===t||Xn(e,t,Io(t))},i.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Xn(e,t,Io(t),n)},i.isNaN=function(e){return Va(e)&&e!=+e},i.isNative=function(e){if(zs(e))throw new xi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return $n(e)},i.isNil=function(e){return null==e},i.isNull=function(e){return null===e},i.isNumber=Va,i.isObject=Ma,i.isObjectLike=za,i.isPlainObject=Wa,i.isRegExp=Nl,i.isSafeInteger=function(e){return Ua(e)&&e>=-Ae&&e<=Ae},i.isSet=Dl,i.isString=Xa,i.isSymbol=$a,i.isTypedArray=Ll,i.isUndefined=function(e){return void 0===e},i.isWeakMap=function(e){return za(e)&&Ms(e)==Ke},i.isWeakSet=function(e){return za(e)&&yn(e)=="[object WeakSet]"},i.join=function(e,t){return null==e?"":is.call(e,t)},i.kebabCase=ap,i.last=ma,i.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=Ga(n),o=0>o?ls(r+o,0):ps(o,r-1)),t===t?ne(e,t,o):E(e,F,o,!0)},i.lowerCase=ip,i.lowerFirst=sp,i.lt=Ul,i.lte=Hl,i.max=function(e){return e&&e.length?an(e,ui,Cn):void 0},i.maxBy=function(e,t){return e&&e.length?an(e,Oo(t,2),Cn):void 0},i.mean=function(e){return R(e,ui)},i.meanBy=function(e,t){return R(e,Oo(t,2))},i.min=function(e){return e&&e.length?an(e,ui,Yn):void 0},i.minBy=function(e,t){return e&&e.length?an(e,Oo(t,2),Yn):void 0},i.stubArray=yi,i.stubFalse=mi,i.stubObject=function(){return{}},i.stubString=function(){return""},i.stubTrue=function(){return!0},i.multiply=Ep,i.nth=function(e,t){return e&&e.length?rr(e,Ga(t)):void 0},i.noConflict=function(){return En._===this&&(En._=Di),this},i.noop=gi,i.now=kl,i.pad=function(e,t,n){e=ei(e),t=Ga(t);var r=t?re(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return ho(ns(o),n)+e+ho(ts(o),n)},i.padEnd=function(e,t,n){e=ei(e),t=Ga(t);var r=t?re(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=us();return ps(e+o*(t-e+vn("1e-"+((o+"").length-1))),t)}return cr(e,t)},i.reduce=function(e,t,n){var r=Pl(e)?x:B,o=3>arguments.length;return r(e,Oo(t,4),n,o,Rs)},i.reduceRight=function(e,t,n){var r=Pl(e)?C:B,o=3>arguments.length;return r(e,Oo(t,4),n,o,Ps)},i.repeat=function(e,t,n){return t=(n?$o(e,t,n):void 0===t)?1:Ga(t),ur(ei(e),t)},i.replace=function(){var e=arguments,t=ei(e[0]);return 3>e.length?t:t.replace(e[1],e[2])},i.result=ii,i.round=wp,i.runInContext=t,i.sample=function(e){var t=Pl(e)?Ht:hr;return t(e)},i.size=function(e){if(null==e)return 0;if(qa(e))return Xa(e)?re(e):e.length;var t=Ms(e);return t==Ue||t==We?e.size:Qn(e).length},i.snakeCase=lp,i.some=function(e,t,n){var r=Pl(e)?v:br;return n&&$o(e,t,n)&&(t=void 0),r(e,Oo(t,3))},i.sortedIndex=function(e,t){return kr(e,t)},i.sortedIndexBy=function(e,t,n){return xr(e,t,Oo(n,2))},i.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=kr(e,t);if(re||e>Ae)return[];var n=Re,r=ps(e,Re);t=Oo(t),e-=Re;for(var o=N(r,t);++n=a)return e;var s=n-re(r);if(1>s)return r;var l=i?Ir(i,0,s).join(""):e.slice(0,s);if(void 0===o)return l+r;if(i&&(s+=l.length-s),Nl(o)){if(e.slice(s).search(o)){var p=l,c;for(o.global||(o=Ti(o.source,ei(Rt.exec(o))+"g")),o.lastIndex=0;c=o.exec(p);)var d=c.index;l=l.slice(0,void 0===d?s:d)}}else if(e.indexOf(jr(o),s)!=s){var u=l.lastIndexOf(o);-1n.__dir__?"Right":"")}),n},j.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),u(["filter","map","takeWhile"],function(e,t){var n=t+1;j.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Oo(e,3),type:n}),t.__filtered__=t.__filtered__||n==Ee||n==3,t}}),u(["head","last"],function(e,t){var n="take"+(t?"Right":"");j.prototype[e]=function(){return this[n](1).value()[0]}}),u(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");j.prototype[e]=function(){return this.__filtered__?new j(this):this[n](1)}}),j.prototype.compact=function(){return this.filter(ui)},j.prototype.find=function(e){return this.filter(e).head()},j.prototype.findLast=function(e){return this.reverse().find(e)},j.prototype.invokeMap=_r(function(e,t){return"function"==typeof e?new j(this):this.map(function(n){return Pn(n,e,t)})}),j.prototype.reject=function(e){return this.filter(Ba(Oo(e)))},j.prototype.slice=function(e,t){e=Ga(e);var n=this;return n.__filtered__&&(0t)?new j(n):(0>e?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(t=Ga(t),n=0>t?n.dropRight(-t):n.take(t-e)),n)},j.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},j.prototype.toArray=function(){return this.take(Re)},cn(j.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=i[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(i.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof j,p=s[0],c=l||Pl(t),d=function(e){var t=o.apply(i,k([e],s));return r&&u?t[0]:t};c&&n&&"function"==typeof p&&1!=p.length&&(l=c=!1);var u=this.__chain__,h=!!this.__actions__.length,g=a&&!u,f=l&&!h;if(!a&&c){t=f?t:new j(this);var y=e.apply(t,s);return y.__actions__.push({func:ja,args:[d],thisArg:void 0}),new _(y,u)}return g&&f?e.apply(this,s):(y=this.thru(d),g?r?y.value()[0]:y.value():y)})}),u(["pop","push","shift","sort","splice","unshift"],function(e){var t=wi[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);i.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Pl(o)?o:[],e)}return this[n](function(n){return t.apply(Pl(n)?n:[],e)})}}),cn(j.prototype,function(e,t){var n=i[t];if(n){var r=n.name+"",o=xs[r]||(xs[r]=[]);o.push({name:t,func:n})}}),xs[po(void 0,me).name]=[{name:"wrapper",func:void 0}],j.prototype.clone=function(){var e=new j(this.__wrapped__);return e.__actions__=Kr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Kr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Kr(this.__views__),e},j.prototype.reverse=function(){if(this.__filtered__){var e=new j(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},j.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pl(e),r=0>t,o=n?e.length:0,a=Do(0,o,this.__views__),i=a.start,s=a.end,l=s-i,p=r?s:i-1,c=this.__iteratees__,d=c.length,u=0,_=ps(l,this.__takeCount__);if(!n||!r&&o==l&&_==l)return Ar(e,this.__actions__);var h=[];outer:for(;l--&&u<_;){p+=t;for(var g=-1,f=e[p];++g=this.__values__.length,t=e?void 0:this.__values__[this.__index__++];return{done:e,value:t}},i.prototype.plant=function(e){for(var t=this,n,r;t instanceof s;){r=_a(t),r.__index__=0,r.__values__=void 0,n?o.__wrapped__=r:n=r;var o=r;t=t.__wrapped__}return o.__wrapped__=e,n},i.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof j){var t=e;return this.__actions__.length&&(t=new j(this)),t=t.reverse(),t.__actions__.push({func:ja,args:[ka],thisArg:void 0}),new _(t,this.__chain__)}return this.thru(ka)},i.prototype.toJSON=i.prototype.valueOf=i.prototype.value=function(){return Ar(this.__wrapped__,this.__actions__)},i.prototype.first=i.prototype.head,Qi&&(i.prototype[Qi]=function(){return this}),i}();"function"==typeof i&&"object"==typeof i.amd&&i.amd?(En._=zn,i(function(){return zn})):An?((An.exports=zn)._=zn,wn._=zn):En._=zn}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],60:[function(t,n){function r(e){if(e+="",!(100=u?t(e/u)+"d":e>=c?t(e/c)+"h":e>=s?t(e/s)+"m":e>=p?t(e/p)+"s":e+"ms"}function i(e){return l(e,u,"day")||l(e,c,"hour")||l(e,s,"minute")||l(e,p,"second")||e+" ms"}function l(t,r,n){return tp&&(c=p);for(var d=0;d=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();p("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(p("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(p("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(p("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},n.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},{"./on":69,"./socket":70,backo2:28,"component-bind":33,"component-emitter":34,debug:72,"engine.io-client":38,indexof:55,"socket.io-parser":75}],69:[function(e,t){t.exports=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}},{}],70:[function(e,t,n){function r(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}var o=e("socket.io-parser"),a=e("component-emitter"),i=e("to-array"),s=e("./on"),l=e("component-bind"),p=e("debug")("socket.io-client:socket"),c=e("parseqs");t.exports=n=r;var d={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},u=a.prototype.emit;a(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[s(e,"open",l(this,"onopen")),s(e,"packet",l(this,"onpacket")),s(e,"close",l(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},r.prototype.send=function(){var e=i(arguments);return e.unshift("message"),this.emit.apply(this,e),this},r.prototype.emit=function(e){if(d.hasOwnProperty(e))return u.apply(this,arguments),this;var t=i(arguments),n={type:o.EVENT,data:t};return n.options={},n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(p("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),delete this.flags,this},r.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},r.prototype.onopen=function(){if(p("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;p("sending connect packet with query %s",e),this.packet({type:o.CONNECT,query:e})}else this.packet({type:o.CONNECT})},r.prototype.onclose=function(e){p("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},r.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(e);break;case o.BINARY_EVENT:this.onevent(e);break;case o.ACK:this.onack(e);break;case o.BINARY_ACK:this.onack(e);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",e.data);}},r.prototype.onevent=function(e){var t=e.data||[];p("emitting event %j",t),null!=e.id&&(p("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?u.apply(this,t):this.receiveBuffer.push(t)},r.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=i(arguments);p("sending ack %j",r),t.packet({type:o.ACK,id:e,data:r})}}},r.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(p("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):p("bad ack %s",e.id)},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var e;for(e=0;ee.data)}schema(e){return this._transport.get(`/api/v0/schemas/${e}`).then((e)=>e.data)}getAllSchemas(){return this.collections().then((e)=>r.each(e,this.schema.bind(this)))}}},{bluebird:31,invariant:56}],82:[function(e,t){const n=e("invariant"),{debug:r}=e("./utils");t.exports=class{constructor(e){n(e,"transport is mandatory"),this._transport=e}version(){return n(this._transport.isLoggedIn,"Transport should be connected"),r("request opentmi version"),this._transport.get("/api/v0/version").then((e)=>e.data)}upgrade(e){return n(this._transport.isLoggedIn,"Transport should be connected"),r("request opentmi version"),this._transport.post("/api/v0/version",{version:e}).then((e)=>e.data)}}},{"./utils":91,invariant:56}],83:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("bluebird"),{debug:a}=e("./utils");t.exports=class{constructor(e){n(e,"transport is mandatory"),this._transport=e}login(e,t,o=void 0){return n(!r.isString(this._transport.token),"is logged out alread!"),r.isString(o)&&(this._transport.token=o),n(r.isString(e),"email should be string"),n(r.isString(t),"password should be string"),this._transport.post("/auth/login",{email:e,password:t},{}).then((e)=>(n(e.data.token,"there should be token"),a(`Login response: ${JSON.stringify(e.data)}`),this._transport.token=e.data.token,this._transport.token)).catch((e)=>{throw a(`Login error: ${e.message}`),this._transport.token=void 0,e})}whoami(){return this._transport.emit("whoami")}logout(){return n(r.isString(this._transport.token),"you are not logged in, jwt token missing"),this._transport._token=void 0,this._transport.isConnected?this._transport.disconnect():o.resolve()}}},{"./utils":91,bluebird:31,invariant:56,lodash:59}],84:[function(e,t){const n=e("invariant"),r=e("lodash"),{debug:o}=e("./utils");class a{constructor(e){this._clusters=void 0,this._transport=e}get data(){return n(this._clusters,"you should call refresh() before data"),this._clusters}get workers(){return n(this._clusters,"you should call refresh() before workers"),r.get(this._clusters,"workers",void 0)}get status(){return n(this._clusters,"you should call refresh() before status"),r.omit(this._clusters,["workers"])}restartWorkers(){return n(this._transport.isLoggedIn,"Transport should be logged in as admin"),o("attempt to restart all workers"),this._transport.post("/api/v0/restart").then((e)=>(o("workers restarting...",e.data),e.data)).catch((e)=>{throw o(e),e})}refresh(){return this._transport.get("/api/v0/clusters").then((e)=>{o(e.data),this._clusters=e.data}).catch((e)=>{throw o(e),this._clusters=void 0,e})}}t.exports=a},{"./utils":91,invariant:56,lodash:59}],85:[function(e,t){const{Document:n}=e("./utils");class r extends n{constructor(e,t){super(e,`/api/v0/resources/${t.id}`,t)}toString(){return`${this.id}: ${this.name()}`}name(e){return this.getOrSet("name",e)}get location(){const e={site:function(e){return this.getOrSet("location.site",e)}.bind(this),country:function(e){return this.getOrSet("location.country",e)}.bind(this),city:function(e){return this.getOrSet("location.city",e)}.bind(this),address:function(e){return this.getOrSet("location.address",e)}.bind(this),postcode:function(e){return this.getOrSet("location.postcode",e)}.bind(this),room:function(e){return this.getOrSet("location.room",e)}.bind(this),subRoom:function(e){return this.get("location.subRoom",e)}.bind(this),geo:function(e){return this.getOrSet("location.geo",e)}.bind(this)};return e}}t.exports=r},{"./utils":91}],86:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("./resource"),{QueryBase:a,Collection:i,notImplemented:s}=e("./utils");class l extends a{id(e){return n(r.isString(e),"id should be a string"),this.has({_id:e})}hasParent(e=void 0){return r.isUndefined(e)?this.has({parent:{$exists:!0}}):this.has({parent:e})}hasNoParent(){return this.has({parent:{$exists:!1}})}name(e){return n(r.isString(e),"type should be a string"),this.has({name:e})}type(e){return n(r.isString(e),"type should be a string"),this.has({type:e})}status(e){const t=["active","maintenance","broken"];return n(r.contains(t,e),`Status is not one of ${t.join(", ")}`),this.has({status:{value:e}})}usageType(e){return n(r.isString(e),"usageType should be a string"),this.has({usage:{type:e}})}haveTag(e,t=!0){return n(r.isBoolean(t),"isTrue should be a boolean"),this.has({tags:{tag:t}})}haveTags(e){return n(r.isArray(e),"tags should be an array"),r.reduce(e,this.haveTag.bind(this),this)}}t.exports=class extends i{constructor(e){super(e,"/api/v0/resources"),this._notImplemented=s()}find(){return new l(this,o)}update(){return this._notImplemented()}}},{"./resource":85,"./utils":91,invariant:56,lodash:59}],87:[function(e,t){const{Document:n}=e("./utils");class r extends n{constructor(e,t){super(e,`/api/v0/results/${t._id}`,t)}toString(){return`${this.time()}: ${this.name} - ${this.verdict()}`}tcid(){return this.get("tcid")}get name(){return this.tcid()}get testcaseId(){return this.tcid()}verdict(){return this.get("exec.verdict")}time(){return this.get("cre.time")}duration(){return this.get("exec.duration")}}t.exports=r},{"./utils":91}],88:[function(e,t){const n=e("lodash"),r=e("invariant"),o=e("./result"),{QueryBase:a,Collection:i,notImplemented:s}=e("./utils");class l extends a{isHW(){return this.has({"exec.dut.type":"hw"})}verdict(e){return r(n.isString(e),"verdictr should be a string"),this.has({"exec.verdict":e})}isFailed(){return this.verdict("fail")}isPass(){return this.verdict("pass")}isInconclusive(){return this.verdict("inconclusive")}belongToCampaign(e){return r(n.isString(e),"campaign should be a string"),this.has({"campaign.id":e})}belongToJob(e){return r(n.isString(e),"job should be a string"),this.has({"job.id":e})}containsNote(e){return r(n.isString(e),"str should be a string"),this.has({"exec.note":e})}}t.exports=class extends i{constructor(e){super(e,"/api/v0/results"),this._notImplemented=s()}find(){return new l(this,o)}update(){return this._notImplemented()}}},{"./result":87,"./utils":91,invariant:56,lodash:59}],89:[function(e,t){const n=e("socket.io-client"),r=e("axios"),o=e("bluebird"),a=e("invariant"),i=e("lodash"),{debug:s,timeSince:l}=e("../utils");class p{constructor(e="",t=r,o=n){this.Rest=t,this.IO=o,this._token=void 0,this._host=e,this._latency=void 0,this._ioRequests={}}get token(){return this._token}set token(e){a(i.isUndefined(e)||i.isString(e),"You should call login() first"),this._token=e}get latency(){return this._latency}get isLoggedIn(){return i.isString(this.token)}get isConnected(){return!i.isUndefined(this._sockets[""])}get _headers(){return this.isLoggedIn?{Authorization:`Bearer ${this.token}`}:{}}_url(e=""){return`${this._host}${e}`}connect(e=""){return new o((t,n)=>{a(this.isLoggedIn,"token is not configured"),s("Create socketIO connection");const r={query:`token=${this.token}`},o=`${this._url()}${e}`;s(`socketIO url: ${o}, options: ${JSON.stringify(r)}`),this._socket=this.IO(o,r),this._socket.once("connect",t),this._socket.once("reconnect",()=>{s("reconnecting")}),this._socket.once("connect_error",n)}).then(()=>(s("SocketIO connected"),this._socket.on("error",(e)=>{s(e)}),this._socket.on("reconnect",()=>{s("socketIO reconnect")}),this._socket.on("reconnect_attempt",()=>{s("socketIO reconnect_attempt")}),this._socket.on("reconnecting",(e)=>{s(`socketIO reconnecting, attempt: ${e}`)}),this._socket.on("reconnect_error",(e)=>{s(e)}),this._socket.on("reconnect_failed",(e)=>{s(e)}),this._socket.on("exit",()=>{s("Server is attemt to exit...")}),this._socket.on("pong",(e)=>{this._latency=e,s(`pong latency: ${e}ms`)}),this._socket)).catch((e)=>{throw s(`socketIO connection fails: ${e.message}`),e})}disconnect(){return new o((e)=>{a(this._socket,"token is not configured"),this._socket.once("disconnect",e),this._socket.disconnect()}).then(()=>{s("SocketIO disconnected")})}requestIO(e){a(i.isObject(this._socket),"Should be Connected"),a(i.isString(this._token),"you are not logged in, jwt token missing"),a(i.isPlainObject(e),"request should be object"),i.defaults(e,{timeout:6e5,data:{},time:new Date}),a(i.isString(e.event),"event should be string"),a(i.isPlainObject(e.data),"data should be object"),a(i.isNumber(e.timeout),"timeout should be number"),s(`requestIO: ${JSON.stringify(e)}`),this._ioRequests[e.time]=e;const t=this._sockets[""],n=new o((r,o)=>{t.emit(e.event,e.data,(t,a)=>{n.isPending()?(s(`Response in ${new Date-e.time}ms`),t?o(t):r(a)):s("Response received too late - Promise was rejected already")})}).timeout(e.timeout).catch(o.TimeoutError,(e)=>{throw e}).finally(()=>{delete this._ioRequests[e.time]});return n}emit(e,t={},n=void 0){return this.requestIO({event:e,data:t,timeout:n})}request(e){const t=this.Rest.CancelToken,n=t.source(),r=i.defaults(e,{url:"/",method:"get",baseURL:this._host,headers:this._headers,cancelToken:n.token});s(`Requesting: ${JSON.stringify(r)}`);const a=new Date;return this.Rest.request(r).then((e)=>{const t=l(a);return s(`Request finished in ${t.milliseconds}ms`),e}).catch((t)=>{if(t.response){const n=i.get(t,"response.data",{message:t.message});if(s(`Request fails with status ${t.response.status}, ${JSON.stringify(n)}`),503===t.response.status){const t=i.get(n,"retryAfter",2);if(e.retryCount=i.get(e,"retryCount",1)-1,0this.request(e))}throw new Error(n.message)}else this.Rest.isCancel(t)?s(`Request canceled: ${t.message}`):t.request?s(t.request):s("Error",t.message);throw t})}get(e,t=void 0){return this.request({url:e,data:t})}post(e,t,n=void 0){return this.request({url:e,method:"post",data:t,headers:n})}put(e,t){return this.request({url:e,method:"put",data:t})}delete(e){return this.request({url:e,method:"delete"})}get sio(){return a(this._socket,"You should call Connect first"),this._socket}}t.exports=p},{"../utils":91,axios:3,bluebird:31,invariant:56,lodash:59,"socket.io-client":67}],90:[function(e,t){const n=e("debug")("opentmi-client");t.exports=n},{debug:36}],91:[function(e,t){const n=e("./debug"),r=e("./rest/queryBase"),o=e("./rest/collection"),a=e("./rest/document"),i=e("./retry"),{notImplemented:s,timeSince:l}=e("./utils"),p=e("./object-merge");t.exports={debug:n,QueryBase:r,Collection:o,Document:a,retryUpdate:i,timeSince:l,notImplemented:s,objectMerge:p}},{"./debug":90,"./object-merge":92,"./rest/collection":94,"./rest/document":95,"./rest/queryBase":97,"./retry":98,"./utils":99}],92:[function(e,t){objectMerge=function(e,t,n,o){let a=Array.isArray(t),i={},s={},l={},p={},c={},d=!0,u,_,h,g,f,y,m;for(_ in"object"==typeof o?u=o:(u=a?[]:{},d=!o),n)a&&isNaN(_=parseInt(_))||(h=n[_],u[_]=h,_ in e?h!==e[_]&&(c[_]=h):l[_]=h);for(_ in t)a&&isNaN(_=parseInt(_))||(h=t[_],g=e[_],y=_ in u,y?u[_]!==h&&(f=n[_],d&&"object"==typeof h&&"object"==typeof f?(f=Object.merge(_ in e&&"object"==typeof g?g:{},h,f),u[_]=f.merged,f.conflicts&&(i[_]={conflicts:f.conflicts},m=!0)):f===g?u[_]=h:h!==g&&(i[_]=_ in e?{a:h,o:g,b:f}:{a:h,b:f},m=!0)):u[_]=h,_ in e?h!==g&&(p[_]=h):s[_]=h);return u={merged:u,added:{a:s,b:l},updated:{a:p,b:c}},m&&(u.conflicts=i),u},t.exports=objectMerge},{}],93:[function(e,t){const n=e("invariant"),{notImplemented:r}=e("../utils");t.exports=class{constructor(e,t){n(e,"transport is mandatory"),this._transport=e,this._path=t,this._notImplemented=r}}},{"../utils":99,invariant:56}],94:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("./base");t.exports=class extends o{_find(e){return n(r.isString(e),"query hould be a string"),n(this._transport.isLoggedIn,"Transport should be logged in"),this._transport.get(`${this._path}?${e}`).then((e)=>e.data)}_update(e,t=void 0){return this._transport.put({path:this._path,query:t?t.toString():void 0,data:e})}_get(){return this._notImplemented()}_delete(){return this._notImplemented()}_patch(){return this._notImplemented()}}},{"./base":93,invariant:56,lodash:59}],95:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("./base"),a=e("./../retry");class i extends o{constructor(e,t,o){super(e,t),this._idProperty=o.id?"id":"_id",n(r.isPlainObject(o),"originalJson should be plain object"),n(r.isString(o[this._idProperty]),"originalJson should have id"),this._original=r.cloneDeep(o),this._resource=r.cloneDeep(o),this._changes={}}toJson(){return r.cloneDeep(this._resource)}getChanges(){return r.cloneDeep(this._changes)}isDirty(){return!r.isEqual(this._original,this._resource)}save(e=2){if(this.isDirty()){const t=this.getChanges();return n(t[this._idProperty]!==this._original[this._idProperty],`${this._idProperty} is not the same!!`),t.version=this.version,a(this._original,t,this._update.bind(this),e).then(()=>this)}return Promise.reject(new Error("no changes"))}get(e){return r.get(this._resource,e)}set(e,t){return this._dirty=!0,r.isNull(t)?(r.unset(this._resource,e),this._changes[e]=null):(r.set(this._resource,e,t),r.set(this._changes,e,t)),this}getOrSet(e,t=void 0){return r.isUndefined(t)?this.get(e):this.set(e,t)}get version(){return this.get("__v")}get id(){return this.get(this._idProperty)}refresh(){return this._transport.get({path:this._path}).then((e)=>{this._original=e})}delete(){return this._transport.delete({path:this._path})}_update(e){return this._transport.put(this._path,e)}}t.exports=i},{"./../retry":98,"./base":93,invariant:56,lodash:59}],96:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("querystring");class a{constructor(){this._query={q:{}}}fromString(e){n(r.isString(e),"str should be string"),this._query=o.parse(e),r.has(this._query,"q")&&(this._query.q=JSON.parse(r.get(this._query,"q")))}toString(){const e=r.cloneDeep(this._query);return r.isEmpty(e.q)?delete e.q:e.q=JSON.stringify(e.q),o.stringify(e)}get query(){return this._query.q}get type(){return this._query.t}find(){return this._query.t="find",this}get queryType(){return r.get(this._query,"t","find")}distinct(){return this._query.t="distinct",this}findOne(){return this._query.t="findOne",this}count(){return this._query.t="count",this}aggregate(){return this._query.t="aggregate",this}mapReduce(e){return r.isFunction(e)?this._query.reduce=e.toString():r.isString(e)?this._query.reduce=e:n(!1,"mapFunction should be string or function"),this._query.t="mapReduce",this}populate(e){return n(r.isArray(e),"fields should be array"),this._query.p=r.uniq(e).join(" "),this}select(e){return n(r.isArray(e),"fields should be array"),this._query.f=r.uniq(e).join(" "),this}asFlat(){return this._query.fl=!0,this}asJson(){return this._query.fl=!1,this}limit(e){return n(r.isNumber(e),"limit should be number"),this._query.l=e,this}skip(e){return n(r.isNumber(e),"skip should be number"),this._query.sk=e,this}has(e){return r.isPlainObject(e,"something should be plain object"),r.merge(this._query.q,e),this}}t.exports=a},{invariant:56,lodash:59,querystring:66}],97:[function(e,t){const n=e("bluebird"),r=e("lodash"),o=e("invariant"),a=e("./mongooseQueryClient");t.exports=class extends a{constructor(e,t){super(),this._collection=e,this._baseClass=t}exec(e=!1){return o(r.isBoolean(e),"plain should be boolean"),this._exec().then((t)=>e||"find"!==this.queryType?t:n.map(t,(e)=>new this._baseClass(this._collection._transport,e)))}_exec(){return this._collection._find(this.toString())}}},{"./mongooseQueryClient":96,bluebird:31,invariant:56,lodash:59}],98:[function(e,t){const n=e("lodash"),r=e("bluebird"),o=e("./object-merge"),a=e("./debug"),i=function(e,t,s,l=2,p=2){return s(t).catch((c)=>{if(0i(e,u,s,l-1,p))}throw n.set(c,"reason","no retries left"),c})};t.exports=i},{"./debug":90,"./object-merge":92,bluebird:31,lodash:59}],99:[function(e,t){t.exports.timeSince=(e)=>{const t={};return t._milliseconds=new Date().valueOf()-e.valueOf(),t.milliseconds=t._milliseconds%1e3,t._seconds=(t._milliseconds-t.milliseconds)/1e3,t.seconds=t._seconds%60,t._minutes=(t._seconds-t.seconds)/60,t.minutes=t._minutes%60,t._hours=(t._minutes-t.minutes)/60,t.hours=t._hours%24,t._days=(t._hours-t.hours)/24,t.days=t._days%365,t.years=(t._days-t.days)/365,t},t.exports.notImplemented=()=>Promise.reject(new Error("not implemented"))},{}],opentmiClient:[function(e,t){const n=e("./authentication"),r=e("./Schemas"),o=e("./admin"),a=e("./cluster"),i=e("./resources"),s=e("./resource"),l=e("./results"),p=e("./result"),c=e("./utils"),d=e("./transports");t.exports={Authentication:n,Schemas:r,Admin:o,Cluster:a,Resources:i,Resource:s,Results:l,Result:p,utils:c,Transport:d}},{"./Schemas":81,"./admin":82,"./authentication":83,"./cluster":84,"./resource":85,"./resources":86,"./result":87,"./results":88,"./transports":89,"./utils":91}]},{},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,"opentmiClient",85,86,87,88,89,90,91,92,93,94,95,96,97,98,99])("opentmiClient")}); \ No newline at end of file +(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,t.opentmiClient=e()}})(function(){var e=Math.ceil,t=String.fromCharCode,n=Math.abs,r=Math.max,o=Math.min,a=Math.floor,s,i,l;return function p(c,e,t){function r(s,o){if(!e[s]){if(!c[s]){var i="function"==typeof require&&require;if(!o&&i)return i(s,!0);if(n)return n(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var d=e[s]={exports:{}};c[s][0].call(d.exports,function(t){var e=c[s][1][t];return r(e?e:t)},d,d.exports,p,c,e,t)}return e[s].exports}for(var n="function"==typeof require&&require,a=0;a=o.count)throw new Error("after called too many times");--o.count,e?(a=!0,t(e),t=r):0===o.count&&!a&&t(null,n)}var a=!1;return r=r||n,o.count=e,0===e?t():o}},{}],2:[function(e,t){t.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(0>t&&(t+=r),0>n&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),a=new Uint8Array(n-t),s=t,i=0;se}};i.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],function(e){i.headers[e]={}}),o.forEach(["post","put","patch"],function(e){i.headers[e]=o.merge(s)}),t.exports=i}).call(this,e("_process"))},{"./adapters/http":4,"./adapters/xhr":4,"./helpers/normalizeHeaderName":24,"./utils":27,_process:63}],17:[function(e,t){"use strict";t.exports=function(e,t){return function(){for(var n=Array(arguments.length),r=0;r>8-8*(o%1))){if(i=t.charCodeAt(o+=3/4),255=e.jitter?e.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=a(t*this.jitter*e);e=0==(1&a(10*t))?e-n:e+n}return 0|o(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},{}],29:[function(e,t,n){(function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r>2],o+=e[(3&n[a])<<4|n[a+1]>>4],o+=e[(15&n[a+1])<<2|n[a+2]>>6],o+=e[63&n[a+2]];return 2==r%3?o=o.substring(0,o.length-1)+"=":1==r%3&&(o=o.substring(0,o.length-2)+"=="),o},n.decode=function(e){var n=0.75*e.length,r=e.length,o=0,a,s,i,l,p;"="===e[e.length-1]&&(n--,"="===e[e.length-2]&&n--);var c=new ArrayBuffer(n),d=new Uint8Array(c);for(a=0;a>4,d[o++]=(15&i)<<4|l>>2,d[o++]=(3&l)<<6|63&p;return c}})()},{}],30:[function(e,t){(function(e){function n(e){for(var t=0,n;tt&&(t=r(0,t+e.length)),e[t]}var i=e("./util"),l=i.canEvaluate,p=i.isIdentifier,c;t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if(!!("number"==typeof e))t=s;else if(l){var n=c(e);t=null===n?a:n}else t=a;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t){"use strict";t.exports=function(t,n,r,o){var a=e("./util"),s=a.tryCatch,i=a.errorObj,l=t._async;t.prototype["break"]=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}else e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||0>=this._branchesRemainingToCancel},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):!(this._branchHasCancelled(),!this._enoughBranchesHaveCancelled())&&(this._invokeOnCancel(),!0)},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){0, no stack trace)"}function S(e){var t=41;return e.lengthe)){for(var t=[],n={},r=0,o=this;void 0!==o;++r)t.push(o),o=o._parent;e=this._length=r;for(var r=e-1,a;0<=r;--r)a=t[r].stack,void 0===n[a]&&(n[a]=r);for(var r=0;ro||0>a||!i||!l||i!==l||o>=a||(Z=function(e){if(B.test(e))return!0;var t=w(e);return t&&t.fileName===i&&o<=t.line&&t.line<=a})}},warn:h,deprecated:function(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),h(n)},CapturedTrace:E,fireDomEvent:Q,fireGlobalEvent:K}}},{"./errors":12,"./util":36}],10:[function(e,t){"use strict";t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype["return"]=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype["throw"]=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(1>=arguments.length)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(n){if(1>=arguments.length)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();return this.caught(n,function(){return r})}}},{}],11:[function(e,t){"use strict";t.exports=function(e,t){function n(){return o(this)}var r=e.reduce,o=e.all;e.prototype.each=function(e){return r(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,o){return r(e,o,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t){"use strict";function n(e,t){function n(r){return this instanceof n?void(p(this,"message","string"==typeof r?r:t),p(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)):new n(r)}return l(n,Error),n}function r(e){return this instanceof r?void(p(this,"name","OperationalError"),p(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(p(this,"message",e.message),p(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)):new r(e)}var o=e("./es5"),a=o.freeze,s=e("./util"),l=s.inherits,p=s.notEnumerableProp,c=n("Warning","warning"),d=n("CancellationError","cancellation error"),u=n("TimeoutError","timeout error"),_=n("AggregateError","aggregate error"),g,h;try{g=TypeError,h=RangeError}catch(t){g=n("TypeError","type error"),h=n("RangeError","range error")}for(var f="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;yn)){if(1<=l&&this._inFlight>=l)return r[n]=e,this._queue.push(n),!1;null!==i&&(i[n]=e);var p=this._promise,c=this._callback,_=p._boundValue();p._pushContext();var g=d(c).call(_,e,n,a),h=p._popContext();if(s.checkForgottenReturns(g,h,null===i?"Promise.map":"Promise.filter",p),g===u)return this._reject(g.e),!0;var f=o(g,this._promise);if(f instanceof t){f=f._target();var y=f._bitField;if(0==(50397184&y))return 1<=l&&this._inFlight++,r[n]=f,f._proxy(this,-1*(n+1)),!1;if(0!=(33554432&y))g=f._value();else return 0==(16777216&y)?(this._cancel(),!0):(this._reject(f._reason()),!0)}r[n]=g}else if(n=-1*n-1,r[n]=e,1<=l&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0;var m=++this._totalResolved;return!!(m>=a)&&(null===i?this._resolve(r):this._filter(r,i),!0)},i.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;0>>16)){if(e===this){var n=p();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,0<(65535&t)&&(0==(134217728&t)?y.settlePromises(this):this._settlePromises())}},a.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16))return this._setRejected(),this._fulfillmentHandler0=e,this._isFinal()?y.fatalError(e,_.isNode):void(0<(65535&t)?y.settlePromises(this):this._ensurePossibleRejectionHandled())},a.prototype._fulfillPromises=function(e,t){for(var n=1;n=this._length)&&(this._resolve(this._values),!0)},i.prototype._promiseCancelled=function(){return this._cancel(),!0},i.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},i.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n=this._length){var r;if(this._isMap)r=u(this._values);else{r={};for(var o=this.length(),a=0,s=this.length();a>1},t.prototype.props=function(){return s(this)},t.props=function(e){return s(e)}}},{"./es5":13,"./util":36}],26:[function(e,t){"use strict";function n(e,t,n,r,o){for(var a=0;a=this._length)&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(e,t){var n=new a;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},o.prototype._promiseRejected=function(e,t){var n=new a;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new o(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t){"use strict";t.exports=function(t,n,r){function o(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function a(e,t){if((0|t)!==t||0>t)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new o(e),a=n.promise();return n.setHowMany(t),n.init(),a}var s=e("./util"),i=e("./errors").RangeError,l=e("./errors").AggregateError,p=s.isArray,c={};s.inherits(o,n),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=p(this._values);!this._isResolved()&&e&&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(e){this._howMany=e},o.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),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(e){return this._addRejected(e),this._checkOutcome()},o.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new l,e=this.length();e=p)return c._fulfill();var a=l(e[s++]);if(a instanceof t&&a._isDisposable()){try{a=r(a._getDisposer().tryDispose(n),e.promise)}catch(t){return i(t)}if(a instanceof t)return a._then(o,i,null,null,null)}o()}var s=0,p=e.length,c=new t(a);return o(),c}function c(e,t,n){this._data=e,this._promise=t,this._context=n}function d(e,t,n){this.constructor$(e,t,n)}function u(e){return c.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function _(e){this.length=e,this.promise=null,this[e-1]=null}var g=e("./util"),h=e("./errors").TypeError,f=e("./util").inherits,y=g.errorObj,m=g.tryCatch,b={};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():b},c.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t===b?null:this.doDispose(t,e);return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},c.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},f(d,c),d.prototype.doDispose=function(e,t){var n=this.data();return n.call(e,e,t)},_.prototype._resultCancelled=function(){for(var e=this.length,n=0,r;ne)return n("you must pass at least 2 arguments to Promise.using");var o=arguments[e-1];if("function"!=typeof o)return n("expecting a function but got "+g.classString(o));var a=!0,l;2===e&&Array.isArray(arguments[0])?(l=arguments[0],e=l.length,a=!1):(l=arguments,e--);for(var d=new _(e),h=0,f;h";c=document.createElement(e)}catch(t){c=document.createElement("iframe"),c.name=o.iframeId,c.src="javascript:0"}c.id=o.iframeId,o.form.appendChild(c),o.iframe=c}var o=this;if(!this.form){var a=document.createElement("form"),s=document.createElement("textarea"),p=this.iframeId="eio_iframe_"+this.index,c;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=p,a.method="POST",a.setAttribute("accept-charset","utf-8"),s.name="d",a.appendChild(s),document.body.appendChild(a),this.form=a,this.area=s}this.form.action=this.uri(),r(),e=e.replace(l,"\\\n"),this.area.value=e.replace(i,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&n()}:this.iframe.onload=n}}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./polling":45,"component-inherit":35}],44:[function(e,t){(function(n){function r(){}function o(e){if(i.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,n.location){var t="https:"===location.protocol,r=location.port;r||(r=t?443:80),this.xd=e.hostname!==n.location.hostname||r!==e.port,this.xs=e.secure!==t}}function a(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0===e.data?null:e.data,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function s(){for(var e in a.requests)a.requests.hasOwnProperty(e)&&a.requests[e].abort()}var l=e("xmlhttprequest-ssl"),i=e("./polling"),p=e("component-emitter"),c=e("component-inherit"),d=e("debug")("engine.io-client:polling-xhr");t.exports=o,t.exports.Request=a,c(o,i),o.prototype.supportsBinary=!0,o.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new a(e)},o.prototype.doWrite=function(e,t){var n=this.request({method:"POST",data:e,isBinary:"string"!=typeof e&&e!==void 0}),r=this;n.on("success",t),n.on("error",function(e){r.onError("xhr post error",e)}),this.sendXhr=n},o.prototype.doPoll=function(){d("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},p(a.prototype),a.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized},t=this.xhr=new l(e),r=this;try{d("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var o in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&t.setRequestHeader(o,this.extraHeaders[o])}catch(t){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{t.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState){var e;try{e=t.getResponseHeader("Content-Type")}catch(t){}"application/octet-stream"===e&&(t.responseType="arraybuffer")}4!==t.readyState||(200===t.status||1223===t.status?r.onLoad():setTimeout(function(){r.onError(t.status)},0))},d("xhr data %s",this.data),t.send(this.data)}catch(t){return void setTimeout(function(){r.onError(t)},0)}n.document&&(this.index=a.requestsCount++,a.requests[this.index]=this)},a.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},a.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},a.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},a.prototype.cleanup=function(e){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r,e)try{this.xhr.abort()}catch(t){}n.document&&delete a.requests[this.index],this.xhr=null}},a.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(t){}e="application/octet-stream"===t?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(t){this.onError(t)}null!=e&&this.onData(e)},a.prototype.hasXDR=function(){return"undefined"!=typeof n.XDomainRequest&&!this.xs&&this.enablesXDR},a.prototype.abort=function(){this.cleanup()},a.requestsCount=0,a.requests={},n.document&&(n.attachEvent?n.attachEvent("onunload",s):n.addEventListener&&n.addEventListener("beforeunload",s,!1))}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./polling":45,"component-emitter":34,"component-inherit":35,debug:48,"xmlhttprequest-ssl":47}],45:[function(e,t){function n(e){var t=e&&e.forceBase64;(!p||t)&&(this.supportsBinary=!1),r.call(this,e)}var r=e("../transport"),o=e("parseqs"),a=e("engine.io-parser"),s=e("component-inherit"),i=e("yeast"),l=e("debug")("engine.io-client:polling");t.exports=n;var p=function(){var t=e("xmlhttprequest-ssl"),n=new t({xdomain:!1});return null!=n.responseType}();s(n,r),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(e){function t(){l("paused"),n.readyState="paused",e()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(l("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){l("pre-pause polling complete"),--r||t()})),this.writable||(l("we are currently writing - waiting to pause"),r++,this.once("drain",function(){l("pre-pause writing complete"),--r||t()}))}else t()},n.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(e){var t=this;l("polling got data %s",e);a.decodePayload(e,this.socket.binaryType,function(e){return"opening"===t.readyState&&t.onOpen(),"close"===e.type?(t.onClose(),!1):void t.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l("ignoring poll - transport state \"%s\"",this.readyState))},n.prototype.doClose=function(){function e(){l("writing close packet"),t.write([{type:"close"}])}var t=this;"open"===this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},n.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};a.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},n.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";!1!==this.timestampRequests&&(e[this.timestampParam]=i()),this.supportsBinary||e.sid||(e.b64=1),e=o.encode(e),this.port&&("https"==t&&443!==+this.port||"http"==t&&80!==+this.port)&&(n=":"+this.port),e.length&&(e="?"+e);var r=-1!==this.hostname.indexOf(":");return t+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+e}},{"../transport":41,"component-inherit":35,debug:48,"engine.io-parser":50,parseqs:61,"xmlhttprequest-ssl":47,yeast:80}],46:[function(e,t){(function(n){function r(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=c&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(u=d),o.call(this,e)}var o=e("../transport"),a=e("engine.io-parser"),s=e("parseqs"),i=e("component-inherit"),l=e("yeast"),p=e("debug")("engine.io-client:websocket"),c=n.WebSocket||n.MozWebSocket,d;if("undefined"==typeof window)try{d=e("ws")}catch(t){}var u=c;u||"undefined"!=typeof window||(u=d),t.exports=r,i(r,o),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new u(e,t):new u(e):new u(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(n){t.onError("websocket error",n)}},r.prototype.write=function(e){function t(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var o=e.length,s=0,i=o;s=o&&n>>10),o=56320|1023&o),r+=f(o);return r}function l(e,t){if(55296<=e&&57343>=e){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function p(e,t){return f(128|63&e>>t)}function c(e,t){if(0==(4294967168&e))return f(e);var n="";return 0==(4294965248&e)?n=f(192|31&e>>6):0==(4294901760&e)?(!l(e,t)&&(e=65533),n=f(224|15&e>>12),n+=p(e,6)):0==(4292870144&e)&&(n=f(240|7&e>>18),n+=p(e,12),n+=p(e,6)),n+=f(128|63&e),n}function d(){if(x>=b)throw Error("Invalid byte index");var e=255&m[x];if(x++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function u(e){var t,n,r,o,a;if(x>b)throw Error("Invalid byte index");if(x==b)return!1;if(t=255&m[x],x++,0==(128&t))return t;if(192==(224&t)){if(n=d(),a=(31&t)<<6|n,128<=a)return a;throw Error("Invalid continuation byte")}if(224==(240&t)){if(n=d(),r=d(),a=(15&t)<<12|n<<6|r,2048<=a)return l(a,e)?a:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=d(),r=d(),o=d(),a=(7&t)<<18|n<<12|r<<6|o,65536<=a&&1114111>=a))return a;throw Error("Invalid UTF-8 detected")}var _="object"==typeof r&&r,g="object"==typeof n&&n&&n.exports==_&&n,h="object"==typeof e&&e;(h.global===h||h.window===h)&&(o=h);var f=t,y={version:"2.1.2",encode:function(e,t){t=t||{};for(var n=!1!==t.strict,r=a(e),o=r.length,s=-1,i="",l;++s"']/g,dt=RegExp(pt.source),ut=RegExp(ct.source),_t=/<%-([\s\S]+?)%>/g,ht=/<%([\s\S]+?)%>/g,ft=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yt=/^\w*$/,mt=/^\./,bt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xt=/[\\^$.*+?()[\]{}|]/g,kt=RegExp(xt.source),Ct=/^\s+|\s+$/g,vt=/^\s+/,jt=/\s+$/,St=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tt=/\{\n\/\* \[wrapped with (.+)\] \*/,wt=/,? & /,Et=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,At=/\\(\\)?/g,Ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Rt=/\w*$/,Ot=/^[-+]0x[0-9a-f]+$/i,Pt=/^0b[01]+$/i,Bt=/^\[object .+?Constructor\]$/,It=/^0o[0-7]+$/i,qt=/^(?:0|[1-9]\d*)$/,Dt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nt=/($^)/,Lt=/['\n\r\u2028\u2029\\]/g,Ut="\\ud800-\\udfff",Ht="\\u2700-\\u27bf",Mt="a-z\\xdf-\\xf6\\xf8-\\xff",zt="A-Z\\xc0-\\xd6\\xd8-\\xde",Vt="\\xac\\xb1\\xd7\\xf7"+"\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"+"\\u2000-\\u206f"+" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wt="['\u2019]",Xt="["+Vt+"]",$t="["+("\\u0300-\\u036f"+"\\ufe20-\\ufe2f"+"\\u20d0-\\u20ff")+"]",Qt="\\d+",Kt="["+Mt+"]",Gt="[^"+Ut+Vt+Qt+Ht+Mt+zt+"]",Yt="\\ud83c[\\udffb-\\udfff]",Jt="[^"+Ut+"]",Zt="(?:\\ud83c[\\udde6-\\uddff]){2}",en="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+zt+"]",nn="(?:"+Kt+"|"+Gt+")",rn="(?:"+Wt+"(?:d|ll|m|re|s|t|ve))?",on="(?:"+Wt+"(?:D|LL|M|RE|S|T|VE))?",an="(?:"+$t+"|"+Yt+")"+"?",sn="["+"\\ufe0e\\ufe0f"+"]?",ln="(?:"+"\\u200d"+"(?:"+[Jt,Zt,en].join("|")+")"+sn+an+")*",pn=sn+an+ln,cn="(?:"+["["+Ht+"]",Zt,en].join("|")+")"+pn,dn="(?:"+[Jt+$t+"?",$t,Zt,en,"["+Ut+"]"].join("|")+")",un=/['’]/g,_n=/[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]/g,gn=RegExp(Yt+"(?="+Yt+")|"+dn+pn,"g"),hn=RegExp([tn+"?"+Kt+"+"+rn+"(?="+[Xt,tn,"$"].join("|")+")","(?:"+tn+"|"+Gt+")"+"+"+on+"(?="+[Xt,tn+nn,"$"].join("|")+")",tn+"?"+nn+"+"+rn,tn+"+"+on,"\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",Qt,cn].join("|"),"g"),fn=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/,yn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bn=-1,xn={};xn[Ye]=xn[Je]=xn[Ze]=xn[et]=xn[tt]=xn[nt]=xn[rt]=xn[ot]=xn[at]=!0,xn[Pe]=xn[Be]=xn[Ke]=xn[Ie]=xn[Ge]=xn[qe]=xn[De]=xn[Ne]=xn[Ue]=xn[He]=xn[Me]=xn[Ve]=xn[We]=xn[Xe]=xn[Qe]=!1;var kn={};kn[Pe]=kn[Be]=kn[Ke]=kn[Ge]=kn[Ie]=kn[qe]=kn[Ye]=kn[Je]=kn[Ze]=kn[et]=kn[tt]=kn[Ue]=kn[He]=kn[Me]=kn[Ve]=kn[We]=kn[Xe]=kn[$e]=kn[nt]=kn[rt]=kn[ot]=kn[at]=!0,kn[De]=kn[Ne]=kn[Qe]=!1;var Cn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vn=parseFloat,jn=parseInt,Sn="object"==typeof t&&t&&t.Object===Object&&t,Tn="object"==typeof self&&self&&self.Object===Object&&self,wn=Sn||Tn||Function("return this")(),En="object"==typeof i&&i&&!i.nodeType&&i,An=En&&"object"==typeof n&&n&&!n.nodeType&&n,Fn=An&&An.exports===En,Rn=Fn&&Sn.process,On=function(){try{return Rn&&Rn.binding&&Rn.binding("util")}catch(t){}}(),Pn=On&&On.isArrayBuffer,Bn=On&&On.isDate,In=On&&On.isMap,qn=On&&On.isRegExp,Dn=On&&On.isSet,Nn=On&&On.isTypedArray,Ln=O("length"),Un=P({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Hn=P({"&":"&","<":"<",">":">",'"':""","'":"'"}),Mn=P({"&":"&","<":"<",">":">",""":"\"","'":"'"}),zn=function t(n){function s(e){if(za(e)&&!Ol(e)&&!(e instanceof j)){if(e instanceof _)return e;if(Ps.call(e,"__wrapped__"))return _a(e)}return new _(e)}function i(){}function _(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function j(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Re,this.__views__=[]}function P(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Zt(e,t,n,r,o,a){var s=t&ue,i=t&_e,l;if(n&&(l=o?n(e,r,o,a):n(e)),void 0!==l)return l;if(!Ma(e))return e;var p=Ol(e);if(!p){var c=Mi(e),d=c==Ne||c==Le;if(Bl(e))return qr(e,s);if(c!=Me&&c!=Pe&&(!d||o)){if(!kn[c])return o?e:{};l=zo(e,c,Zt,s)}else if(l=i||d?{}:Mo(e),!s)return i?Yr(e,Kt(l,e)):Gr(e,Qt(l,e))}else if(l=Ho(e),!s)return Qr(e,l);a||(a=new Et);var _=a.get(e);if(_)return _;a.set(e,l);var g=t&ge?i?Fo:Ao:i?os:rs,h=p?void 0:g(e);return u(h||e,function(r,o){h&&(o=r,r=e[o]),Wt(l,o,Zt(r,t,n,o,e,a))}),l}function en(e){var t=rs(e);return function(n){return tn(n,e,t)}}function tn(e,t,n){var r=n.length;if(null==e)return!r;for(e=js(e);r--;){var o=n[r],a=t[o],s=e[o];if(void 0===s&&!(o in e)||!a(s))return!1}return!0}function nn(e,t,n){if("function"!=typeof e)throw new ws(pe);return Wi(function(){e.apply(void 0,n)},t)}function rn(e,t,n,r){var o=-1,a=y,s=!0,i=e.length,l=[],p=t.length;if(!i)return l;n&&(t=b(t,L(n))),r?(a=m,s=!1):t.length>=le&&(a=H,s=!1,t=new se(t));outer:for(;++on&&(n=-n>o?0:o+n),r=void 0===r||r>o?o:Ga(r),0>r&&(r+=o),r=n>r?0:Ya(r);nt}function Sn(e,t){return null!=e&&Ps.call(e,t)}function Tn(e,t){return null!=e&&t in js(e)}function En(e,t,n){return e>=pi(t,n)&&et?n:0,Xo(t,n)?e[t]:void 0}function or(e,t,n){var r=-1;t=b(t.length?t:[us],L(Po()));var o=Jn(e,function(e){var n=b(t,function(t){return t(e)});return{criteria:n,index:++r,value:e}});return I(o,function(e,t){return Wr(e,t,n)})}function ar(e,t){return sr(e,t,function(t,n){return ns(e,n)})}function sr(e,t,n){for(var r=-1,o=t.length,a={};++rt||t>Ae)return n;do t%2&&(n+=e),t=ni(t/2),t&&(e+=e);while(t);return n}function _r(e,t){return Xi(oa(e,t,us),e+"")}function gr(e){return Ht(is(e))}function hr(e,t){var n=is(e);return pa(n,Jt(t,0,n.length))}function fr(e,t,n,r){if(!Ma(e))return e;t=Br(t,e);for(var o=-1,a=t.length,s=e;null!=s&&++ot&&(t=-t>o?0:o+t),n=n>o?o:n,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=bs(o);++r>>1){for(;r>>1,s=e[a];null!==s&&!$a(s)&&(n?s<=t:s=le){var p=t?null:Ni(e);if(p)return Z(p);s=!1,o=H,l=new se}else l=t?[]:i;outer:for(;++rr)return r?Sr(e[0]):[];for(var o=-1,a=bs(r);++o=r?e:mr(e,t,n)}function qr(e,t){if(t)return e.slice();var n=e.length,r=zs?zs(n):new e.constructor(n);return e.copy(r),r}function Dr(e){var t=new e.constructor(e.byteLength);return new Ms(t).set(new Ms(e)),t}function Nr(e,t){var n=t?Dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Lr(e,t,n){var r=t?n(G(e),ue):G(e);return k(r,l,new e.constructor)}function Ur(e){var t=new e.constructor(e.source,Rt.exec(e));return t.lastIndex=e.lastIndex,t}function Hr(e,t,n){var r=t?n(Z(e),ue):Z(e);return k(r,p,new e.constructor)}function Mr(e){return Ei?js(Ei.call(e)):{}}function zr(e,t){var n=t?Dr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Vr(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e===e,a=$a(e),s=void 0!==t,i=null===t,l=t===t,p=$a(t);if(!i&&!p&&!a&&e>t||a&&s&&l&&!i&&!p||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!p&&e=i)return l;var p=n[r];return l*("desc"==p?-1:1)}return e.index-t.index}function Xr(e,t,n,r){for(var o=-1,a=e.length,s=n.length,i=-1,l=t.length,p=li(a-s,0),c=bs(l+p),d=!r;++io?void 0:a,o=1),t=js(t);++ra&&s[0]!==l&&s[a-1]!==l?[]:J(s,l);if(a-=p.length,an)return n?ur(t,e):t;var r=ur(t,ti(e/re(t)));return $(t)?Ir(oe(r),0,e).join(""):r.slice(0,e)}function ho(e,t,n,r){function o(){for(var t=-1,i=arguments.length,l=-1,p=r.length,d=bs(p+i),u=this&&this!==wn&&this instanceof o?s:e;++li))return!1;var p=a.get(e);if(p&&a.get(t))return p==t;var c=-1,d=!0,u=n&fe?new se:void 0;for(a.set(e,t),a.set(t,e);++ct.length?e:hn(e,mr(t,0,-1))}function sa(e,t){for(var n=e.length,r=pi(t.length,n),o=Qr(e),a;r--;)a=t[r],e[r]=Xo(a,n)?o[a]:void 0;return e}function ia(e,t,n){var r=t+"";return Xi(e,Vo(r,ua(Lo(r),n)))}function la(e){var t=0,n=0;return function(){var r=ci(),o=16-(r-n);if(n=r,!(0=800)return arguments[0];return e.apply(void 0,arguments)}}function pa(e,t){var n=-1,r=e.length;for(t=void 0===t?r:t;++no&&(o=li(r+o,0)),w(e,Po(t,3),o)}function ha(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=Ga(n),o=0>n?li(r+o,0):pi(o,r-1)),w(e,Po(t,3),o,!0)}function fa(e){var t=null==e?0:e.length;return t?pn(e,1):[]}function ya(e){return e&&e.length?e[0]:void 0}function ma(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function ba(e,t){return e&&e.length&&t&&t.length?lr(e,t):e}function xa(e){return null==e?e:_i.call(e)}function ka(e){if(!(e&&e.length))return[];var t=0;return e=f(e,function(e){if(Da(e))return t=li(e.length,t),!0}),D(t,function(t){return b(e,O(t))})}function Ca(e,t){if(!(e&&e.length))return[];var n=ka(e);return null==t?n:b(n,function(e){return c(t,void 0,e)})}function va(e){var t=s(e);return t.__chain__=!0,t}function ja(e,t){return t(e)}function Sa(e,t){var n=Ol(e)?u:Ri;return n(e,Po(t,3))}function Ta(e,t){var n=Ol(e)?g:Oi;return n(e,Po(t,3))}function wa(e,t){var n=Ol(e)?b:Jn;return n(e,Po(t,3))}function Ea(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,ko(e,je,void 0,void 0,void 0,void 0,t)}function Aa(e,t){var n;if("function"!=typeof t)throw new ws(pe);return e=Ga(e),function(){return 0<--e&&(n=t.apply(this,arguments)),1>=e&&(t=void 0),n}}function Fa(e,t,n){t=n?void 0:t;var r=ko(e,xe,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=Fa.placeholder,r}function Ra(e,t,n){t=n?void 0:t;var r=ko(e,ke,void 0,void 0,void 0,void 0,void 0,t);return r.placeholder=Ra.placeholder,r}function Oa(e,t,n){function r(t){var n=g,r=h;return g=h=void 0,c=t,y=e.apply(r,n),y}function o(e){return c=e,m=Wi(i,t),d?r(e):y}function a(e){var n=e-b,r=e-c,o=t-n;return u?pi(o,f-r):o}function s(e){var n=e-b,r=e-c;return void 0==b||n>=t||0>n||u&&r>=f}function i(){var e=xl();return s(e)?l(e):void(m=Wi(i,a(e)))}function l(e){return(m=void 0,_&&g)?r(e):(g=h=void 0,y)}function p(){var e=xl(),n=s(e);if(g=arguments,h=this,b=e,n){if(void 0===m)return o(b);if(u)return m=Wi(i,t),r(b)}return void 0===m&&(m=Wi(i,t)),y}var c=0,d=!1,u=!1,_=!0,g,h,f,y,m,b;if("function"!=typeof e)throw new ws(pe);return t=Ja(t)||0,Ma(n)&&(d=!!n.leading,u="maxWait"in n,f=u?li(Ja(n.maxWait)||0,t):f,_="trailing"in n?!!n.trailing:_),p.cancel=function(){void 0!==m&&Di(m),c=0,g=b=h=m=void 0},p.flush=function(){return void 0===m?y:l(xl())},p}function Pa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ws(pe);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=e.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(Pa.Cache||ae),n}function Ba(e){if("function"!=typeof e)throw new ws(pe);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2]);}return!e.apply(this,t)}}function Ia(e,t){return e===t||e!==e&&t!==t}function qa(e){return null!=e&&Ha(e.length)&&!La(e)}function Da(e){return za(e)&&qa(e)}function Na(e){if(!za(e))return!1;var t=yn(e);return t==De||t=="[object DOMException]"||"string"==typeof e.message&&"string"==typeof e.name&&!Wa(e)}function La(e){if(!Ma(e))return!1;var t=yn(e);return t==Ne||t==Le||t=="[object AsyncFunction]"||t=="[object Proxy]"}function Ua(e){return"number"==typeof e&&e==Ga(e)}function Ha(e){return"number"==typeof e&&-1e?-1:1;return t*1.7976931348623157e308}return e===e?e:0}function Ga(e){var t=Ka(e),n=t%1;return t===t?n?t-n:t:0}function Ya(e){return e?Jt(Ga(e),0,Re):0}function Ja(e){if("number"==typeof e)return e;if($a(e))return Fe;if(Ma(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ma(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ct,"");var n=Pt.test(e);return n||It.test(e)?jn(e.slice(2),n?2:8):Ot.test(e)?Fe:+e}function Za(e){return Kr(e,os(e))}function es(e){return null==e?"":jr(e)}function ts(e,t,n){var r=null==e?void 0:hn(e,t);return void 0===r?n:r}function ns(e,t){return null!=e&&Uo(e,t,Tn)}function rs(e){return qa(e)?Ut(e):Kn(e)}function os(e){return qa(e)?Ut(e,!0):Gn(e)}function as(e,t){if(null==e)return{};var n=b(Fo(e),function(e){return[e]});return t=Po(t),sr(e,n,function(e,n){return t(e,n[0])})}function ss(e,t,n){t=Br(t,e);var r=-1,o=t.length;for(o||(o=1,e=void 0);++rn)return!1;var r=t.length-1;return n==r?t.pop():$s.call(t,n,1),--this.size,!0},te.prototype.get=function(e){var t=this.__data__,n=Xt(t,e);return 0>n?void 0:t[n][1]},te.prototype.has=function(e){return-1r?(++this.size,n.push([e,t])):n[r][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new P,map:new(hi||te),string:new P}},ae.prototype["delete"]=function(e){var t=Bo(this,e)["delete"](e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Bo(this,e).get(e)},ae.prototype.has=function(e){return Bo(this,e).has(e)},ae.prototype.set=function(e,t){var n=Bo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},se.prototype.add=se.prototype.push=function(e){return this.__data__.set(e,ce),this},se.prototype.has=function(e){return this.__data__.has(e)},Et.prototype.clear=function(){this.__data__=new te,this.size=0},Et.prototype["delete"]=function(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n},Et.prototype.get=function(e){return this.__data__.get(e)},Et.prototype.has=function(e){return this.__data__.has(e)},Et.prototype.set=function(e,t){var n=this.__data__;if(n instanceof te){var r=n.__data__;if(!hi||r.length=t}),Rl=Ln(function(){return arguments}())?Ln:function(e){return za(e)&&Ps.call(e,"callee")&&!Xs.call(e,"callee")},Ol=bs.isArray,Pl=Pn?L(Pn):function(e){return za(e)&&yn(e)==Ke},Bl=oi||ms,Il=Bn?L(Bn):function(e){return za(e)&&yn(e)==qe},ql=In?L(In):function(e){return za(e)&&Mi(e)==Ue},Dl=qn?L(qn):function(e){return za(e)&&yn(e)==Ve},Nl=Dn?L(Dn):function(e){return za(e)&&Mi(e)==We},Ll=Nn?L(Nn):function(e){return za(e)&&Ha(e.length)&&!!xn[yn(e)]},Ul=yo(Yn),Hl=yo(function(e,t){return e<=t}),Ml=Zr(function(e,t){if(Jo(t)||qa(t))return void Kr(t,rs(t),e);for(var n in t)Ps.call(t,n)&&Wt(e,n,t[n])}),zl=Zr(function(e,t){Kr(t,os(t),e)}),Vl=Zr(function(e,t,n,r){Kr(t,os(t),e,r)}),Wl=Zr(function(e,t,n,r){Kr(t,rs(t),e,r)}),Xl=Eo(Yt),$l=_r(function(e){return e.push(void 0,Co),c(Vl,void 0,e)}),Ql=_r(function(e){return e.push(void 0,vo),c(Zl,void 0,e)}),Kl=co(function(e,t,n){e[t]=n},ds(us)),Gl=co(function(e,t,n){Ps.call(e,t)?e[t].push(n):e[t]=[n]},Po),Yl=_r(On),Jl=Zr(function(e,t,n){tr(e,t,n)}),Zl=Zr(function(e,t,n,r){tr(e,t,n,r)}),ep=Eo(function(e,t){var n={};if(null==e)return n;var r=!1;t=b(t,function(t){return t=Br(t,e),r||(r=1--e)return t.apply(this,arguments)}},s.ary=Ea,s.assign=Ml,s.assignIn=zl,s.assignInWith=Vl,s.assignWith=Wl,s.at=Xl,s.before=Aa,s.bind=kl,s.bindAll=_p,s.bindKey=Cl,s.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ol(e)?e:[e]},s.chain=va,s.chunk=function(e,t,n){t=(n?$o(e,t,n):void 0===t)?1:li(Ga(t),0);var r=null==e?0:e.length;if(!r||1>t)return[];for(var o=0,a=0,s=bs(ti(r/t));ot?0:t,r)):[]},s.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?(t=n||void 0===t?1:Ga(t),t=r-t,mr(e,0,0>t?0:t)):[]},s.dropRightWhile=function(e,t){return e&&e.length?Er(e,Po(t,3),!0,!0):[]},s.dropWhile=function(e,t){return e&&e.length?Er(e,Po(t,3),!0):[]},s.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&$o(e,t,n)&&(n=0,r=o),sn(e,t,n,r)):[]},s.filter=function(e,t){var n=Ol(e)?f:ln;return n(e,Po(t,3))},s.flatMap=function(e,t){return pn(wa(e,t),1)},s.flatMapDeep=function(e,t){return pn(wa(e,t),Ee)},s.flatMapDepth=function(e,t,n){return n=void 0===n?1:Ga(n),pn(wa(e,t),n)},s.flatten=fa,s.flattenDeep=function(e){var t=null==e?0:e.length;return t?pn(e,Ee):[]},s.flattenDepth=function(e,t){var n=null==e?0:e.length;return n?(t=void 0===t?1:Ga(t),pn(e,t)):[]},s.flip=function(e){return ko(e,Te)},s.flow=gp,s.flowRight=hp,s.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={},o;++t>>0,!n)?[]:(e=es(e),e&&("string"==typeof t||null!=t&&!Dl(t))&&(t=jr(t),!t&&$(e))?Ir(oe(e),0,n):e.split(t,n))},s.spread=function(e,t){if("function"!=typeof e)throw new ws(pe);return t=null==t?0:li(Ga(t),0),_r(function(n){var r=n[t],o=Ir(n,0,t);return r&&x(o,r),c(e,this,o)})},s.tail=function(e){var t=null==e?0:e.length;return t?mr(e,1,t):[]},s.take=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:Ga(t),mr(e,0,0>t?0:t)):[]},s.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?(t=n||void 0===t?1:Ga(t),t=r-t,mr(e,0>t?0:t,r)):[]},s.takeRightWhile=function(e,t){return e&&e.length?Er(e,Po(t,3),!1,!0):[]},s.takeWhile=function(e,t){return e&&e.length?Er(e,Po(t,3)):[]},s.tap=function(e,t){return t(e),e},s.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new ws(pe);return Ma(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Oa(e,t,{leading:r,maxWait:t,trailing:o})},s.thru=ja,s.toArray=Qa,s.toPairs=np,s.toPairsIn=rp,s.toPath=function(e){return Ol(e)?b(e,ca):$a(e)?[e]:Qr($i(es(e)))},s.toPlainObject=Za,s.transform=function(e,t,n){var r=Ol(e),o=r||Bl(e)||Ll(e);if(t=Po(t,4),null==n){var a=e&&e.constructor;n=o?r?new a:[]:Ma(e)?La(a)?Fi(Vs(e)):{}:{}}return(o?u:cn)(e,function(e,r,o){return t(n,e,r,o)}),n},s.unary=function(e){return Ea(e,1)},s.union=nl,s.unionBy=rl,s.unionWith=ol,s.uniq=function(e){return e&&e.length?Sr(e):[]},s.uniqBy=function(e,t){return e&&e.length?Sr(e,Po(t,2)):[]},s.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Sr(e,void 0,t):[]},s.unset=function(e,t){return null==e||Tr(e,t)},s.unzip=ka,s.unzipWith=Ca,s.update=function(e,t,n){return null==e?e:wr(e,t,Pr(n))},s.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:wr(e,t,Pr(n),r)},s.values=is,s.valuesIn=function(e){return null==e?[]:U(e,os(e))},s.without=al,s.words=cs,s.wrap=function(e,t){return Tl(Pr(t),e)},s.xor=sl,s.xorBy=il,s.xorWith=ll,s.zip=pl,s.zipObject=function(e,t){return Rr(e||[],t||[],Wt)},s.zipObjectDeep=function(e,t){return Rr(e||[],t||[],fr)},s.zipWith=cl,s.entries=np,s.entriesIn=rp,s.extend=zl,s.extendWith=Vl,gs(s,s),s.add=vp,s.attempt=up,s.camelCase=op,s.capitalize=ls,s.ceil=jp,s.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=Ja(n),n=n===n?n:0),void 0!==t&&(t=Ja(t),t=t===t?t:0),Jt(Ja(e),t,n)},s.clone=function(e){return Zt(e,ge)},s.cloneDeep=function(e){return Zt(e,ue|ge)},s.cloneDeepWith=function(e,t){return t="function"==typeof t?t:void 0,Zt(e,ue|ge,t)},s.cloneWith=function(e,t){return t="function"==typeof t?t:void 0,Zt(e,ge,t)},s.conformsTo=function(e,t){return null==t||tn(e,t,rs(t))},s.deburr=ps,s.defaultTo=function(e,t){return null==e||e!==e?t:e},s.divide=Sp,s.endsWith=function(e,t,n){e=es(e),t=jr(t);var r=e.length;n=void 0===n?r:Jt(Ga(n),0,r);var o=n;return n-=t.length,0<=n&&e.slice(n,o)==t},s.eq=Ia,s.escape=function(e){return e=es(e),e&&ut.test(e)?e.replace(ct,Hn):e},s.escapeRegExp=function(e){return e=es(e),e&&kt.test(e)?e.replace(xt,"\\$&"):e},s.every=function(e,t,n){var r=Ol(e)?h:on;return n&&$o(e,t,n)&&(t=void 0),r(e,Po(t,3))},s.find=_l,s.findIndex=ga,s.findKey=function(e,t){return T(e,Po(t,3),cn)},s.findLast=gl,s.findLastIndex=ha,s.findLastKey=function(e,t){return T(e,Po(t,3),dn)},s.floor=Tp,s.forEach=Sa,s.forEachRight=Ta,s.forIn=function(e,t){return null==e?e:Pi(e,Po(t,3),os)},s.forInRight=function(e,t){return null==e?e:Bi(e,Po(t,3),os)},s.forOwn=function(e,t){return e&&cn(e,Po(t,3))},s.forOwnRight=function(e,t){return e&&dn(e,Po(t,3))},s.get=ts,s.gt=Al,s.gte=Fl,s.has=function(e,t){return null!=e&&Uo(e,t,Sn)},s.hasIn=ns,s.head=ya,s.identity=us,s.includes=function(e,t,n,r){e=qa(e)?e:is(e),n=n&&!r?Ga(n):0;var o=e.length;return 0>n&&(n=li(o+n,0)),Xa(e)?n<=o&&-1o&&(o=li(r+o,0)),E(e,t,o)},s.inRange=function(e,t,n){return t=Ka(t),void 0===n?(n=t,t=0):n=Ka(n),e=Ja(e),En(e,t,n)},s.invoke=Yl,s.isArguments=Rl,s.isArray=Ol,s.isArrayBuffer=Pl,s.isArrayLike=qa,s.isArrayLikeObject=Da,s.isBoolean=function(e){return!0===e||!1===e||za(e)&&yn(e)==Ie},s.isBuffer=Bl,s.isDate=Il,s.isElement=function(e){return za(e)&&1===e.nodeType&&!Wa(e)},s.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Ol(e)||"string"==typeof e||"function"==typeof e.splice||Bl(e)||Ll(e)||Rl(e)))return!e.length;var t=Mi(e);if(t==Ue||t==We)return!e.size;if(Jo(e))return!Kn(e).length;for(var n in e)if(Ps.call(e,n))return!1;return!0},s.isEqual=function(e,t){return Vn(e,t)},s.isEqualWith=function(e,t,n){n="function"==typeof n?n:void 0;var r=n?n(e,t):void 0;return void 0===r?Vn(e,t,void 0,n):!!r},s.isError=Na,s.isFinite=function(e){return"number"==typeof e&&ai(e)},s.isFunction=La,s.isInteger=Ua,s.isLength=Ha,s.isMap=ql,s.isMatch=function(e,t){return e===t||Xn(e,t,Io(t))},s.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Xn(e,t,Io(t),n)},s.isNaN=function(e){return Va(e)&&e!=+e},s.isNative=function(e){if(zi(e))throw new ks("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return $n(e)},s.isNil=function(e){return null==e},s.isNull=function(e){return null===e},s.isNumber=Va,s.isObject=Ma,s.isObjectLike=za,s.isPlainObject=Wa,s.isRegExp=Dl,s.isSafeInteger=function(e){return Ua(e)&&e>=-Ae&&e<=Ae},s.isSet=Nl,s.isString=Xa,s.isSymbol=$a,s.isTypedArray=Ll,s.isUndefined=function(e){return void 0===e},s.isWeakMap=function(e){return za(e)&&Mi(e)==Qe},s.isWeakSet=function(e){return za(e)&&yn(e)=="[object WeakSet]"},s.join=function(e,t){return null==e?"":si.call(e,t)},s.kebabCase=ap,s.last=ma,s.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=Ga(n),o=0>o?li(r+o,0):pi(o,r-1)),t===t?ne(e,t,o):w(e,F,o,!0)},s.lowerCase=sp,s.lowerFirst=ip,s.lt=Ul,s.lte=Hl,s.max=function(e){return e&&e.length?an(e,us,Cn):void 0},s.maxBy=function(e,t){return e&&e.length?an(e,Po(t,2),Cn):void 0},s.mean=function(e){return R(e,us)},s.meanBy=function(e,t){return R(e,Po(t,2))},s.min=function(e){return e&&e.length?an(e,us,Yn):void 0},s.minBy=function(e,t){return e&&e.length?an(e,Po(t,2),Yn):void 0},s.stubArray=ys,s.stubFalse=ms,s.stubObject=function(){return{}},s.stubString=function(){return""},s.stubTrue=function(){return!0},s.multiply=wp,s.nth=function(e,t){return e&&e.length?rr(e,Ga(t)):void 0},s.noConflict=function(){return wn._===this&&(wn._=Ns),this},s.noop=hs,s.now=xl,s.pad=function(e,t,n){e=es(e),t=Ga(t);var r=t?re(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return go(ni(o),n)+e+go(ti(o),n)},s.padEnd=function(e,t,n){e=es(e),t=Ga(t);var r=t?re(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=ui();return pi(e+o*(t-e+vn("1e-"+((o+"").length-1))),t)}return cr(e,t)},s.reduce=function(e,t,n){var r=Ol(e)?k:B,o=3>arguments.length;return r(e,Po(t,4),n,o,Ri)},s.reduceRight=function(e,t,n){var r=Ol(e)?C:B,o=3>arguments.length;return r(e,Po(t,4),n,o,Oi)},s.repeat=function(e,t,n){return t=(n?$o(e,t,n):void 0===t)?1:Ga(t),ur(es(e),t)},s.replace=function(){var e=arguments,t=es(e[0]);return 3>e.length?t:t.replace(e[1],e[2])},s.result=ss,s.round=Ep,s.runInContext=t,s.sample=function(e){var t=Ol(e)?Ht:gr;return t(e)},s.size=function(e){if(null==e)return 0;if(qa(e))return Xa(e)?re(e):e.length;var t=Mi(e);return t==Ue||t==We?e.size:Kn(e).length},s.snakeCase=lp,s.some=function(e,t,n){var r=Ol(e)?v:br;return n&&$o(e,t,n)&&(t=void 0),r(e,Po(t,3))},s.sortedIndex=function(e,t){return xr(e,t)},s.sortedIndexBy=function(e,t,n){return kr(e,t,Po(n,2))},s.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=xr(e,t);if(re||e>Ae)return[];var n=Re,r=pi(e,Re);t=Po(t),e-=Re;for(var o=D(r,t);++n=a)return e;var i=n-re(r);if(1>i)return r;var l=s?Ir(s,0,i).join(""):e.slice(0,i);if(void 0===o)return l+r;if(s&&(i+=l.length-i),Dl(o)){if(e.slice(i).search(o)){var p=l,c;for(o.global||(o=Ss(o.source,es(Rt.exec(o))+"g")),o.lastIndex=0;c=o.exec(p);)var d=c.index;l=l.slice(0,void 0===d?i:d)}}else if(e.indexOf(jr(o),i)!=i){var u=l.lastIndexOf(o);-1n.__dir__?"Right":"")}),n},j.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),u(["filter","map","takeWhile"],function(e,t){var n=t+1;j.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Po(e,3),type:n}),t.__filtered__=t.__filtered__||n==we||n==3,t}}),u(["head","last"],function(e,t){var n="take"+(t?"Right":"");j.prototype[e]=function(){return this[n](1).value()[0]}}),u(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");j.prototype[e]=function(){return this.__filtered__?new j(this):this[n](1)}}),j.prototype.compact=function(){return this.filter(us)},j.prototype.find=function(e){return this.filter(e).head()},j.prototype.findLast=function(e){return this.reverse().find(e)},j.prototype.invokeMap=_r(function(e,t){return"function"==typeof e?new j(this):this.map(function(n){return On(n,e,t)})}),j.prototype.reject=function(e){return this.filter(Ba(Po(e)))},j.prototype.slice=function(e,t){e=Ga(e);var n=this;return n.__filtered__&&(0t)?new j(n):(0>e?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(t=Ga(t),n=0>t?n.dropRight(-t):n.take(t-e)),n)},j.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},j.prototype.toArray=function(){return this.take(Re)},cn(j.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=s[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(s.prototype[t]=function(){var t=this.__wrapped__,i=r?[1]:arguments,l=t instanceof j,p=i[0],c=l||Ol(t),d=function(e){var t=o.apply(s,x([e],i));return r&&u?t[0]:t};c&&n&&"function"==typeof p&&1!=p.length&&(l=c=!1);var u=this.__chain__,g=!!this.__actions__.length,h=a&&!u,f=l&&!g;if(!a&&c){t=f?t:new j(this);var y=e.apply(t,i);return y.__actions__.push({func:ja,args:[d],thisArg:void 0}),new _(y,u)}return h&&f?e.apply(this,i):(y=this.thru(d),h?r?y.value()[0]:y.value():y)})}),u(["pop","push","shift","sort","splice","unshift"],function(e){var t=Es[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);s.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ol(o)?o:[],e)}return this[n](function(n){return t.apply(Ol(n)?n:[],e)})}}),cn(j.prototype,function(e,t){var n=s[t];if(n){var r=n.name+"",o=ki[r]||(ki[r]=[]);o.push({name:t,func:n})}}),ki[po(void 0,me).name]=[{name:"wrapper",func:void 0}],j.prototype.clone=function(){var e=new j(this.__wrapped__);return e.__actions__=Qr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Qr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Qr(this.__views__),e},j.prototype.reverse=function(){if(this.__filtered__){var e=new j(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},j.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ol(e),r=0>t,o=n?e.length:0,a=No(0,o,this.__views__),s=a.start,i=a.end,l=i-s,p=r?i:s-1,c=this.__iteratees__,d=c.length,u=0,_=pi(l,this.__takeCount__);if(!n||!r&&o==l&&_==l)return Ar(e,this.__actions__);var g=[];outer:for(;l--&&u<_;){p+=t;for(var h=-1,f=e[p];++h=this.__values__.length,t=e?void 0:this.__values__[this.__index__++];return{done:e,value:t}},s.prototype.plant=function(e){for(var t=this,n,r;t instanceof i;){r=_a(t),r.__index__=0,r.__values__=void 0,n?o.__wrapped__=r:n=r;var o=r;t=t.__wrapped__}return o.__wrapped__=e,n},s.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof j){var t=e;return this.__actions__.length&&(t=new j(this)),t=t.reverse(),t.__actions__.push({func:ja,args:[xa],thisArg:void 0}),new _(t,this.__chain__)}return this.thru(xa)},s.prototype.toJSON=s.prototype.valueOf=s.prototype.value=function(){return Ar(this.__wrapped__,this.__actions__)},s.prototype.first=s.prototype.head,Ks&&(s.prototype[Ks]=function(){return this}),s}();"function"==typeof s&&"object"==typeof s.amd&&s.amd?(wn._=zn,s(function(){return zn})):An?((An.exports=zn)._=zn,En._=zn):wn._=zn}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],60:[function(t,n){function r(e){if(e+="",!(100=u?t(e/u)+"d":e>=c?t(e/c)+"h":e>=s?t(e/s)+"m":e>=p?t(e/p)+"s":e+"ms"}function i(e){return l(e,u,"day")||l(e,c,"hour")||l(e,s,"minute")||l(e,p,"second")||e+" ms"}function l(t,r,n){return tp&&(c=p);for(var d=0;d=this._reconnectionAttempts)p("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();p("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(p("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(p("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(p("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},n.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)}},{"./on":69,"./socket":70,backo2:28,"component-bind":33,"component-emitter":34,debug:72,"engine.io-client":38,indexof:55,"socket.io-parser":75}],69:[function(e,t){t.exports=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}},{}],70:[function(e,t,n){function r(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}var o=e("socket.io-parser"),a=e("component-emitter"),s=e("to-array"),i=e("./on"),l=e("component-bind"),p=e("debug")("socket.io-client:socket"),c=e("parseqs");t.exports=n=r;var d={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},u=a.prototype.emit;a(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[i(e,"open",l(this,"onopen")),i(e,"packet",l(this,"onpacket")),i(e,"close",l(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},r.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},r.prototype.emit=function(e){if(d.hasOwnProperty(e))return u.apply(this,arguments),this;var t=s(arguments),n={type:o.EVENT,data:t};return n.options={},n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(p("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),delete this.flags,this},r.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},r.prototype.onopen=function(){if(p("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;p("sending connect packet with query %s",e),this.packet({type:o.CONNECT,query:e})}else this.packet({type:o.CONNECT})},r.prototype.onclose=function(e){p("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},r.prototype.onpacket=function(e){if(e.nsp===this.nsp)switch(e.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(e);break;case o.BINARY_EVENT:this.onevent(e);break;case o.ACK:this.onack(e);break;case o.BINARY_ACK:this.onack(e);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",e.data);}},r.prototype.onevent=function(e){var t=e.data||[];p("emitting event %j",t),null!=e.id&&(p("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?u.apply(this,t):this.receiveBuffer.push(t)},r.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);p("sending ack %j",r),t.packet({type:o.ACK,id:e,data:r})}}},r.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(p("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):p("bad ack %s",e.id)},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var e;for(e=0;ee.data)}upgrade(e){return n(this._transport.isLoggedIn,"Transport should be connected"),r("request opentmi version"),this._transport.post("/api/v0/version",{revision:e}).then((e)=>e.data)}}},{"./utils":100,invariant:56}],82:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("bluebird"),{debug:a}=e("./utils");t.exports=class{constructor(e){n(e,"transport is mandatory"),this._transport=e}login(e,t,o=void 0){return n(!r.isString(this._transport.token),"is logged out alread!"),r.isString(o)&&(this._transport.token=o),n(r.isString(e),"email should be string"),n(r.isString(t),"password should be string"),this._transport.post("/auth/login",{email:e,password:t},{}).then((e)=>(n(e.data.token,"there should be token"),a(`Login response: ${JSON.stringify(e.data)}`),this._transport.token=e.data.token,this._transport.token)).catch((e)=>{throw a(`Login error: ${e.message}`),this._transport.token=void 0,e})}whoami(){return this._transport.emit("whoami")}logout(){return n(r.isString(this._transport.token),"you are not logged in, jwt token missing"),this._transport._token=void 0,this._transport.isConnected?this._transport.disconnect():o.resolve()}}},{"./utils":100,bluebird:31,invariant:56,lodash:59}],83:[function(e,t){const n=e("invariant"),r=e("lodash"),{debug:o}=e("./utils");class a{constructor(e){this._clusters=void 0,this._transport=e}get data(){return n(this._clusters,"you should call refresh() before data"),this._clusters}get workers(){return n(this._clusters,"you should call refresh() before workers"),r.get(this._clusters,"workers",void 0)}get status(){return n(this._clusters,"you should call refresh() before status"),r.omit(this._clusters,["workers"])}restartWorkers(){return n(this._transport.isLoggedIn,"Transport should be logged in as admin"),o("attempt to restart all workers"),this._transport.post("/api/v0/restart").then((e)=>(o("workers restarting...",e.data),e.data)).catch((e)=>{throw o(e),e})}refresh(){return this._transport.get("/api/v0/clusters").then((e)=>{o(e.data),this._clusters=e.data}).catch((e)=>{throw o(e),this._clusters=void 0,e})}}t.exports=a},{"./utils":100,invariant:56,lodash:59}],84:[function(e,t){const{Document:n}=e("./utils");class r extends n{constructor(e,t){super(e,"/api/v0/groups",t)}static fromId(e,t){const n=new r(e,{_id:t});return n.refresh()}toString(){return`${this.name}`}get name(){return this.get("name")}isAdmin(){return"admin"===this.name()}}t.exports=r},{"./utils":100}],85:[function(e,t){const{Document:n}=e("./utils");t.exports=class extends n{constructor(e,t){super(e,"/api/v0/items",t)}toString(){return`${this.category()}: ${this.manufacturer()?this.manufacturer():""} - ${this.name()}`}name(e){return this.getOrSet("name",e)}category(e){return this.getOrSet("category",e)}manufacturer(e){return this.getOrSet({"manufacturer.name":e})}getImage(){return this._transport.get(`${this.path}/image`).then((e)=>e.data)}barcode(e){return this.getOrSet("barcode",e)}imageSrc(e){return this.getOrSet("image_src",e)}description(e){return this.getOrSet("text_description",e)}reference(e){return this.getOrSet("external_reference",e)}}},{"./utils":100}],86:[function(e,t){const n=e("lodash"),r=e("invariant"),o=e("./item"),{QueryBase:a,Collection:s,notImplemented:i}=e("./utils");class l extends a{barcode(e){return this.has({barcode:e})}name(e){return this.has({name:e})}available(e=void 0){return r(n.isNumber(e),"available should be a number"),n.isUndefined(e)?this.has({available:{$gt:0}}):this.has({available:e})}category(e){r(n.isString(e),"category should be a string");return r(-1!==n.indexOf(["accessory","board","component","other"],e),"should be allowed category"),this.has({category:e})}categoryAccessories(){return this.category("accessory")}categoryBoards(){return this.category("board")}categoryComponents(){return this.category("components")}categoryOthers(){return this.category("other")}manufacturer(e){return this.has({"manufacturer.name":e})}}t.exports=class extends s{constructor(e){super(e,"/api/v0/items"),this._notImplemented=i}find(){return new l(this,o)}update(){return this._notImplemented("Item update is not implemented")}}},{"./item":85,"./utils":100,invariant:56,lodash:59}],87:[function(e,t){const{Document:n}=e("./utils"),r=e("lodash"),o=e("./item"),a=e("./resource");class s{constructor(e){this._item=e}toJson(){return r.cloneDeep(this._item)}toString(){return this._item._id}returnDate(){return this.get("return_date")}get item(){return new o(this._item)}get resource(){return new a(this._item.resource)}}t.exports=class extends n{constructor(e,t){super(e,"/api/v0/loans",t)}toString(){return`${this.loaner()}`}loanDate(e){return this.getOrSet("loan_date",e)}loaner(e){return this.getOrSet("loaner",e)}notes(e){return this.getOrSet("notes",e)}loanItems(){return r.map(this.get("loan_items",[]),(e)=>new s(e))}}},{"./item":85,"./resource":89,"./utils":100,lodash:59}],88:[function(e,t){const n=e("lodash"),r=e("invariant"),o=e("./loan"),{QueryBase:a,Collection:s,notImplemented:i,beginningOfDay:l,endOfDay:p}=e("./utils");class c extends a{loadItems(){return this.populate("items.item")}loadResources(){return this.populate("items.resource")}loadLoaner(){return this.populate("loaner")}loanDate(e){return this.has({loan_date:{$gte:l(e),$lte:p(e)}})}loaner(e){return this.has({loaner:e})}hasNotes(e){return this.has({notes:`/${e}/`})}}class d extends s{constructor(e){super(e,"/api/v0/loans"),this._notImplemented=i}static forUser(e,t){r(n.isObject(e),"user should be an User object");const o=new d(t);return o.find().loaner(e.id).exec()}find(){return new c(this,o)}update(){return this._notImplemented("Loan update is not implemented")}}t.exports=d},{"./loan":87,"./utils":100,invariant:56,lodash:59}],89:[function(e,t){const{Document:n}=e("./utils");class r extends n{constructor(e,t){super(e,"/api/v0/resources",t)}toString(){return`${this.id}: ${this.name()}`}name(e){return this.getOrSet("name",e)}type(e){return this.getOrSet("type",e)}get hw(){const e=this,t={get firmware(){return{name:function(e){return this.getOrSet("hw.firmware.name",e)}.bind(e),version:function(e){return this.getOrSet("hw.firmware.version",e)}.bind(e)}},sn:function(e){return this.getOrSet("hw.sn",e)}.bind(this),imei:function(e){return this.getOrSet("hw.imei",e)}.bind(this),id:function(e){return this.getOrSet("hw.id",e)}.bind(this)};return t}get location(){const e={site:function(e){return this.getOrSet("location.site",e)}.bind(this),country:function(e){return this.getOrSet("location.country",e)}.bind(this),city:function(e){return this.getOrSet("location.city",e)}.bind(this),address:function(e){return this.getOrSet("location.address",e)}.bind(this),postcode:function(e){return this.getOrSet("location.postcode",e)}.bind(this),room:function(e){return this.getOrSet("location.room",e)}.bind(this),subRoom:function(e){return this.get("location.subRoom",e)}.bind(this),geo:function(e){return this.getOrSet("location.geo",e)}.bind(this)};return e}}t.exports=r},{"./utils":100}],90:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("./resource"),{QueryBase:a,Collection:s,notImplemented:i}=e("./utils");class l extends a{id(e){return n(r.isString(e),"id should be a string"),this.has({_id:e})}hwid(e){return n(r.isString(e),"id should be a string"),this.has({"hw.id":e})}hwsn(e){return n(r.isString(e),"sn should be a string"),this.has({"hw.sn":e})}hasParent(e=void 0){return r.isUndefined(e)?this.has({parent:{$exists:!0}}):this.has({parent:e})}hasNoParent(){return this.has({parent:{$exists:!1}})}name(e){return n(r.isString(e),"type should be a string"),this.has({name:e})}type(e){return n(r.isString(e),"type should be a string"),this.has({type:e})}status(e){const t=["active","maintenance","broken"];return n(r.contains(t,e),`Status is not one of ${t.join(", ")}`),this.has({status:{value:e}})}usageType(e){return n(r.isString(e),"usageType should be a string"),this.has({usage:{type:e}})}haveTag(e,t=!0){n(r.isBoolean(t),"isTrue should be a boolean");const o={tags:{}};return o.tags[e]=t,this.has(o)}haveTags(e){return n(r.isArray(e),"tags should be an array"),r.reduce(e,this.haveTag.bind(this),this)}}t.exports=class extends s{constructor(e){super(e,"/api/v0/resources"),this._notImplemented=i}find(){return new l(this,o)}update(){return this._notImplemented()}}},{"./resource":89,"./utils":100,invariant:56,lodash:59}],91:[function(e,t){const{Document:n}=e("./utils");class r extends n{constructor(e,t){super(e,"/api/v0/results",t)}toString(){return`${this.time()}: ${this.name} - ${this.verdict()}`}tcid(e){return this.getOrSet("tcid",e)}get name(){return this.tcid()}get testcaseId(){return this.tcid()}verdict(e){return this.getOrSet("exec.verdict",e)}time(){return this.get("cre.time")}duration(){return this.get("exec.duration")}}t.exports=r},{"./utils":100}],92:[function(e,t){const n=e("lodash"),r=e("invariant"),o=e("./result"),{QueryBase:a,Collection:s,Document:i,notImplemented:l}=e("./utils");class p extends a{isHW(){return this.has({"exec.dut.type":"hw"})}verdict(e){return r(n.isString(e),"verdictr should be a string"),this.has({"exec.verdict":e})}isFailed(){return this.verdict("fail")}isPass(){return this.verdict("pass")}isInconclusive(){return this.verdict("inconclusive")}belongToCampaign(e){return r(n.isString(e),"campaign should be a string"),this.has({"campaign.id":e})}belongToJob(e){return r(n.isString(e),"job should be a string"),this.has({"job.id":e})}containsNote(e){return r(n.isString(e),"str should be a string"),this.has({"exec.note":`/${e}/`})}}t.exports=class extends s{constructor(e){super(e,"/api/v0/results"),this._notImplemented=l,this._namespace="/results"}connect(){return this._transport.connect(this._namespace)}disconnect(){return this._transport.disconnectNamespace(this._namespace)}on(e,t){return"new"===e?this._transport.sio("/results").then((e)=>{e.on("new",(e)=>{const n=new o(this._transport,e);t(n)})}):Promise.reject(new Error("Event is not supported"))}find(){return new p(this,o)}update(){return this._notImplemented("results update is not implemented")}create(){const e=i.IsNewDocument(o),t=new e(this._transport);return t}}},{"./result":91,"./utils":100,invariant:56,lodash:59}],93:[function(e,t){const n=e("invariant"),r=e("bluebird");t.exports=class{constructor(e){n(e,"transport is mandatory"),this._transport=e}collections(){return this._transport.get("/api/v0/schemas").then((e)=>e.data)}schema(e){return this._transport.get(`/api/v0/schemas/${e}`).then((e)=>e.data)}getAllSchemas(){return this.collections().then((e)=>r.each(e,this.schema.bind(this)))}}},{bluebird:31,invariant:56}],94:[function(e,t){const{Document:n}=e("./utils");class r extends n{constructor(e,t){super(e,"/api/v0/testcases",t)}toString(){return`${this.name}: ${this.purpose()} (avg: ${this.duration()}s)`}tcid(e){return this.getOrSet("tcid",e)}get name(){return this.tcid()}get testcaseId(){return this.tcid()}duration(){return this.get("history.durationAvg")}purpose(e){return this.getOrSet("other_info.purpose",e)}}t.exports=r},{"./utils":100}],95:[function(e,t){const n=e("invariant"),r=e("./testcase"),{QueryBase:o,Collection:a,Document:s,notImplemented:i}=e("./utils");class l extends o{tcid(e){return this.has({tcid:`/${e}/`})}isSkip(){return this.has({"execution.skip":!0})}isArchived(){return this.has({"archive.value":!0})}type(e){return n(0!==["installation","compatibility","smoke","regression","acceptance","alpha","beta","stability","functional","destructive","performance","reliability"].indexOf(e),"not allowed type"),this.has({"other_info.type":e})}}t.exports=class extends a{constructor(e){super(e,"/api/v0/testcases"),this._notImplemented=i}find(){return new l(this,r)}update(){return this._notImplemented("Item update is not implemented")}create(){const e=s.IsNewDocument(r);return new e(this._transport)}}},{"./testcase":94,"./utils":100,invariant:56}],96:[function(e,t){const n=e("socket.io-client"),r=e("axios"),o=e("bluebird"),a=e("invariant"),s=e("lodash"),{debug:i,timeSince:l}=e("../utils");class p{constructor(e="",t=r,o=n){this.Rest=t,this.IO=o,this._token=void 0,this._host=e,this._latency=void 0,this._ioRequests={},this._sockets={}}get _socket(){return s.get(this._sockets,"")}get token(){return this._token}set token(e){a(s.isUndefined(e)||s.isString(e),"You should call login() first"),this._token=e}get latency(){return this._latency}get isLoggedIn(){return s.isString(this.token)}get isConnected(){return!s.isUndefined(this._socket)}get _headers(){return this.isLoggedIn?{Authorization:`Bearer ${this.token}`}:{}}_url(e=""){return`${this._host}${e}`}connect(e=""){return new o((t,n)=>{a(this.isLoggedIn,"token is not configured"),i("Create socketIO connection");const r={query:`token=${this.token}`},o=`${this._url()}${e}`;i(`socketIO url: ${o}, options: ${JSON.stringify(r)}`);const s=this.IO(o,r);s.once("connect",()=>t(s)),s.once("reconnect",()=>{i("reconnecting")}),s.once("connect_error",n),this._sockets[e]=s}).then((e)=>(i("SocketIO connected"),e.on("error",(e)=>{i(e)}),e.on("reconnect",()=>{i("socketIO reconnect")}),e.on("reconnect_attempt",()=>{i("socketIO reconnect_attempt")}),e.on("reconnecting",(e)=>{i(`socketIO reconnecting, attempt: ${e}`)}),e.on("reconnect_error",(e)=>{i(e)}),e.on("reconnect_failed",(e)=>{i(e)}),e.on("exit",()=>{i("Server is attemt to exit...")}),e.on("pong",(e)=>{this._latency=e,i(`pong latency: ${e}ms`)}),e)).catch((e)=>{throw i(`socketIO connection fails: ${e.message}`),e})}disconnect(){const e=Object.keys(this._sockets),t=s.map(e,(e)=>this.disconnectNamespace(e));return o.all(t)}disconnectNamespace(e=""){i(`Disconnecting ns: ${e}`);const t=s.get(this._sockets,e);return new o((e)=>{a(t,"socket is not open"),t.once("disconnect",e),t.disconnect()}).then(()=>{i("SocketIO disconnected"),s.unset(this._sockets,e)})}requestIO(e){a(s.isObject(this._socket),"Should be Connected"),a(s.isString(this._token),"you are not logged in, jwt token missing"),a(s.isPlainObject(e),"request should be object"),s.defaults(e,{timeout:6e5,data:{},time:new Date}),a(s.isString(e.event),"event should be string"),a(s.isPlainObject(e.data),"data should be object"),a(s.isNumber(e.timeout),"timeout should be number"),i(`requestIO: ${JSON.stringify(e)}`),this._ioRequests[e.time]=e;const t=new o((n,r)=>{this._socket.emit(e.event,e.data,(o,a)=>{t.isPending()?(i(`Response in ${new Date-e.time}ms`),o?r(o):n(a)):i("Response received too late - Promise was rejected already")})}).timeout(e.timeout).catch(o.TimeoutError,(e)=>{throw e}).finally(()=>{delete this._ioRequests[e.time]});return t}emit(e,t={},n=void 0){return a(s.isString(e),"event should be a string"),this.requestIO({event:e,data:t,timeout:n})}request(e){const{CancelToken:t}=this.Rest,n=t.source(),r=s.defaults(e,{url:"/",method:"get",baseURL:this._host,headers:this._headers,cancelToken:n.token});i(`Requesting: ${JSON.stringify(r)}`);const a=new Date;return this.Rest.request(r).then((e)=>{const t=l(a);return i(`Request finished in ${t.milliseconds}ms`),e}).catch((t)=>{if(t.response){const n=s.get(t,"response.data",{message:t.message});if(i(`Request fails with status ${t.response.status}, ${JSON.stringify(n)}`),503===t.response.status){const t=s.get(n,"retryAfter",2);if(e.retryCount=s.get(e,"retryCount",1)-1,0this.request(e))}s.set(t,"message",s.get(t,"response.data.message",s.get(t,"response.data.error",t.message)))}else this.Rest.isCancel(t)?i(`Request canceled: ${t.message}`):t.request?i(t.request):i("Error",t.message);throw t})}get(e,t=void 0){return this.request({url:e,data:t})}post(e,t,n=void 0){return this.request({url:e,method:"post",data:t,headers:n})}put(e,t){return this.request({url:e,method:"put",data:t})}delete(e){return this.request({url:e,method:"delete"})}sio(e=""){const t=s.get(this._sockets,e);return t?o.resolve(t):o.reject(new Error("No socket open for this namespace"))}}t.exports=p},{"../utils":100,axios:3,bluebird:31,invariant:56,lodash:59,"socket.io-client":67}],97:[function(e,t){const n=e("lodash"),r=e("bluebird"),{Document:o}=e("./utils"),a=e("./group"),s=e("./loans");class i extends o{constructor(e,t){super(e,`/api/v0/users/${t._id}`,t)}toString(){return`${this.name}`}get name(){return this.get("name")}email(e){return this.getOrSet("email",e)}apikeys(){return this.get("apikeys")}lastVisited(){return new Date(this.get("lastVisited"))}registered(){return new Date(this.get("registered"))}groups(){const e=n.map(this.get("groups"),(e)=>a.fromId(this._transport,e));return r.all(e)}isAdmin(){return this._isNotImplemented("is admin is not implemented")}myLoans(){return s.forUser(this,this._transport)}}t.exports=i},{"./group":84,"./loans":88,"./utils":100,bluebird:31,lodash:59}],98:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("./user"),{QueryBase:a,Collection:s,notImplemented:i}=e("./utils");class l extends a{id(e){return n(r.isString(e),"id should be a string"),this.has({_id:e})}}class p extends s{constructor(e){super(e,"/api/v0/users"),this._notImplemented=i}find(){return new l(this,o)}whoami(){return this._transport.get("/auth/me").then((e)=>new o(this._transport,e.data))}static WHOAMI(e){const t=new p(e);return t.whoami()}update(){return this._notImplemented("Users update is not implemented")}}t.exports=p},{"./user":97,"./utils":100,invariant:56,lodash:59}],99:[function(e,t){const n=e("debug")("opentmi-client");t.exports=n},{debug:36}],100:[function(e,t){const n=e("./debug"),r=e("./rest/queryBase"),o=e("./rest/collection"),a=e("./rest/document"),s=e("./retry"),{notImplemented:i,timeSince:l}=e("./utils"),p=e("./object-merge");t.exports={debug:n,QueryBase:r,Collection:o,Document:a,retryUpdate:s,timeSince:l,notImplemented:i,objectMerge:p}},{"./debug":99,"./object-merge":101,"./rest/collection":103,"./rest/document":104,"./rest/queryBase":106,"./retry":107,"./utils":108}],101:[function(e,t){objectMerge=function(e,t,n,o){let a=Array.isArray(t),s={},i={},l={},p={},c={},d=!0,u,_,g,h,f,y,m;for(_ in"object"==typeof o?u=o:(u=a?[]:{},d=!o),n)a&&isNaN(_=parseInt(_))||(g=n[_],u[_]=g,_ in e?g!==e[_]&&(c[_]=g):l[_]=g);for(_ in t)a&&isNaN(_=parseInt(_))||(g=t[_],h=e[_],y=_ in u,y?u[_]!==g&&(f=n[_],d&&"object"==typeof g&&"object"==typeof f?(f=Object.merge(_ in e&&"object"==typeof h?h:{},g,f),u[_]=f.merged,f.conflicts&&(s[_]={conflicts:f.conflicts},m=!0)):f===h?u[_]=g:g!==h&&(s[_]=_ in e?{a:g,o:h,b:f}:{a:g,b:f},m=!0)):u[_]=g,_ in e?g!==h&&(p[_]=g):i[_]=g);return u={merged:u,added:{a:i,b:l},updated:{a:p,b:c}},m&&(u.conflicts=s),u},t.exports=objectMerge},{}],102:[function(e,t){const n=e("invariant"),{notImplemented:r}=e("../utils");t.exports=class{constructor(e,t){n(e,"transport is mandatory"),this._transport=e,this._path=t,this._notImplemented=r}docPath(e){return`${this._path}/${e}`}colPath(){return this._path}setPath(e){return this._path=e,this}}},{"../utils":108,invariant:56}],103:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("./base");t.exports=class extends o{_find(e){return n(r.isString(e),"query hould be a string"),n(this._transport.isLoggedIn,"Transport should be logged in"),this._transport.get(`${this.colPath()}?${e}`).then((e)=>e.data)}_update(e,t=void 0){return this._transport.put({path:this._path,query:t?t.toString():void 0,data:e})}_get(e){return n(r.isString(e),"id hould be a string"),n(this._transport.isLoggedIn,"Transport should be logged in"),this._transport.get(this.docPath(e)).then((e)=>e.data)}_delete(){return this._notImplemented()}_patch(){return this._notImplemented()}}},{"./base":102,invariant:56,lodash:59}],104:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("../debug"),a=e("./base"),s=e("./../retry");class i extends a{constructor(e,t,a){super(e,t),this._idProperty="_id",r.isUndefined(a)?(o("Construct new document"),this._original=void 0,this._resource={}):(o("Construct existing document"),n(r.isPlainObject(a),"originalJson should be plain object"),n(r.isString(a[this._idProperty]),"originalJson should have id"),this._original=r.cloneDeep(a),this._resource=r.cloneDeep(a)),this._changes={},this._update=this._update.bind(this)}get isNew(){return r.isUndefined(this._original)}toJson(){return r.cloneDeep(this._resource)}getChanges(){return r.cloneDeep(this._changes)}isDirty(){return!r.isEqual(this._original,this._resource)}save(e=2){if(n(r.isNumber(e),"retryCount should be a number"),this.isDirty()){o("Saving existing document");const t=this.getChanges();return n(t[this._idProperty]!==this._original[this._idProperty],`${this._idProperty} is not the same!!`),t.version=this.version,s(this._original,t,this._update,e).then(()=>this)}return Promise.reject(new Error("no changes"))}get(e,t=void 0){return r.get(this._resource,e,t)}set(e,t){return this._dirty=!0,r.isNull(t)?(r.unset(this._resource,e),this._changes[e]=null):(r.set(this._resource,e,t),r.set(this._changes,e,t)),this}getOrSet(e,t=void 0){return r.isUndefined(t)?this.get(e):this.set(e,t)}get version(){return this.get("__v")}get id(){return this.get(this._idProperty)}get path(){return this.docPath(this.id)}refresh(){return this._transport.get(this.path).then((e)=>{this._original=r.cloneDeep(e.data),this._resource=r.cloneDeep(e.data)}).then(()=>this)}delete(){return this._transport.delete({path:this.path})}_update(e){return this._transport.put(this.path,e)}}i.IsNewDocument=function(e){return class extends e{save(){return o("Saving new document"),this._create(this._resource).then((e)=>{this._original=r.cloneDeep(e.data),this._resource=r.cloneDeep(e.data)}).then(()=>(this.save=super.save,this._create=void 0,this))}_create(e){return this._transport.post(this.colPath(),e)}}},t.exports=i},{"../debug":99,"./../retry":107,"./base":102,invariant:56,lodash:59}],105:[function(e,t){const n=e("invariant"),r=e("lodash"),o=e("querystring");class a{constructor(){this._query={q:{}}}fromString(e){return n(r.isString(e),"str should be string"),this._query=o.parse(e),r.has(this._query,"q")&&(this._query.q=JSON.parse(r.get(this._query,"q"))),this}toString(){const e=r.cloneDeep(this._query);return r.isEmpty(e.q)?delete e.q:e.q=JSON.stringify(e.q),o.stringify(e)}get query(){return this._query.q}get type(){return this._query.t}find(){return this._query.t="find",this}get queryType(){return r.get(this._query,"t","find")}distinct(){return this._query.t="distinct",this}findOne(){return this._query.t="findOne",this}count(){return this._query.t="count",this}aggregate(){return this._query.t="aggregate",this}mapReduce(e){return r.isFunction(e)?this._query.reduce=e.toString():r.isString(e)?this._query.reduce=e:n(!1,"mapFunction should be string or function"),this._query.t="mapReduce",this}populate(e){if(n(r.isArray(e)||r.isString(e)||r.isPlainObject(e),"fields should be string, array or plain object"),r.isString(e)&&(e=[e]),r.isArray(e)){let t=r.get(this._query,"p","").split(" ");t=r.filter(t,(e)=>e.length),t.push(...e),this._query.p=r.uniq(t).join(" ")}else this._query.p=r.cloneDeep(e);return this}select(e){return n(r.isArray(e),"fields should be array"),this._query.f=r.uniq(e).join(" "),this}asFlat(){return this._query.fl=!0,this}asJson(){return this._query.fl=!1,this}limit(e){return n(r.isNumber(e),"limit should be number"),this._query.l=e,this}skip(e){return n(r.isNumber(e),"skip should be number"),this._query.sk=e,this}has(e){return r.isPlainObject(e,"something should be plain object"),r.merge(this._query.q,e),this}}t.exports=a},{invariant:56,lodash:59,querystring:66}],106:[function(e,t){const n=e("bluebird"),r=e("lodash"),o=e("invariant"),a=e("./mongooseQueryClient");t.exports=class extends a{constructor(e,t){super(),this._collection=e,this._baseClass=t}exec(e=!1){return o(r.isBoolean(e),"plain should be boolean"),this._exec().then((t)=>e||"find"!==this.queryType?t:n.map(t,(e)=>new this._baseClass(this._collection._transport,e)))}_exec(){return this._collection._find(this.toString())}}},{"./mongooseQueryClient":105,bluebird:31,invariant:56,lodash:59}],107:[function(e,t){const n=e("lodash"),r=e("bluebird"),o=e("./object-merge"),a=e("./debug"),s=function(e,t,i,l=2,p=2){return i(t).catch((c)=>{if(0s(e,u,i,l-1,p))}throw n.set(c,"reason","no retries left"),c})};t.exports=s},{"./debug":99,"./object-merge":101,bluebird:31,lodash:59}],108:[function(e,t){t.exports.timeSince=(e)=>{const t={};return t._milliseconds=new Date().valueOf()-e.valueOf(),t.milliseconds=t._milliseconds%1e3,t._seconds=(t._milliseconds-t.milliseconds)/1e3,t.seconds=t._seconds%60,t._minutes=(t._seconds-t.seconds)/60,t.minutes=t._minutes%60,t._hours=(t._minutes-t.minutes)/60,t.hours=t._hours%24,t._days=(t._hours-t.hours)/24,t.days=t._days%365,t.years=(t._days-t.days)/365,t},t.exports.notImplemented=(e="not implemented")=>Promise.reject(new Error(e)),t.exports.beginningOfDay=(e)=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},t.exports.endOfDay=(e)=>{const t=new Date(e);return t.setHours(23),t.setMinutes(59),t.setSeconds(59),t.setMilliseconds(999),t}},{}],opentmiClient:[function(e,t){const n=e("./authentication"),r=e("./schemas"),o=e("./admin"),a=e("./users"),s=e("./cluster"),i=e("./resources"),l=e("./resource"),p=e("./results"),c=e("./result"),d=e("./testcases"),u=e("./testcase"),_=e("./items"),g=e("./item"),h=e("./loans"),f=e("./loan"),y=e("./utils"),m=e("./transports");t.exports={Authentication:n,Schemas:r,Admin:o,Users:a,Cluster:s,Resources:i,Resource:l,Results:p,Result:c,Testcases:d,Testcase:u,Items:_,Item:g,Loans:h,Loan:f,utils:y,Transport:m}},{"./admin":81,"./authentication":82,"./cluster":83,"./item":85,"./items":86,"./loan":87,"./loans":88,"./resource":89,"./resources":90,"./result":91,"./results":92,"./schemas":93,"./testcase":94,"./testcases":95,"./transports":96,"./users":98,"./utils":100}]},{},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,"opentmiClient",85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108])("opentmiClient")}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e2ec596..0a72812 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,26 @@ { "name": "opentmi-jsclient", - "version": "0.1.0", + "version": "0.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@browserify/acorn5-object-spread": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@browserify/acorn5-object-spread/-/acorn5-object-spread-5.0.1.tgz", + "integrity": "sha512-sFCUPzgeEjdq3rinwy4TFXtak2YZdhqpj6MdNusxkdTFr9TXAUEYK4YQSamR8Joqt/yii1drgl5hk8q/AtJDKA==", + "dev": true, + "requires": { + "acorn": "5.4.1" + }, + "dependencies": { + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + } + } + }, "JSONStream": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", @@ -30,12 +47,6 @@ "negotiator": "0.6.1" } }, - "acorn": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", - "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", - "dev": true - }, "acorn-jsx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", @@ -53,17 +64,20 @@ } } }, - "adm-zip": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.2.1.tgz", - "integrity": "sha1-6AHO3rW9mk6Y1pnFwPQjnicx3L8=", - "dev": true - }, "after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" }, + "agent-base": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", + "integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", + "dev": true, + "requires": { + "es6-promisify": "5.0.0" + } + }, "ajv": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz", @@ -126,6 +140,62 @@ "sprintf-js": "1.0.3" } }, + "args": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/args/-/args-3.0.8.tgz", + "integrity": "sha512-yZ9pTP1UzoR04R2iusf2H3UG70O7mo55O5DjOS/MPKMTvxAFZenVCgi+JP8Q/dI+18qiM/m4r8En9j5/WlsBjQ==", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "chalk": "2.1.0", + "mri": "1.1.0", + "pkginfo": "0.4.1", + "string-similarity": "1.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, "array-filter": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", @@ -170,13 +240,6 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, - "asn1": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", - "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", - "dev": true, - "optional": true - }, "asn1.js": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", @@ -197,13 +260,6 @@ "util": "0.10.3" } }, - "assert-plus": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", - "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=", - "dev": true, - "optional": true - }, "assertion-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", @@ -233,20 +289,29 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, - "aws-sign2": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=", - "dev": true, - "optional": true + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true }, "axios": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.16.2.tgz", - "integrity": "sha1-uk+S8XFn37q0CYN4VFS5rBScPG0=", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.17.1.tgz", + "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=", "requires": { - "follow-redirects": "1.2.4", + "follow-redirects": "1.4.1", "is-buffer": "1.1.5" + }, + "dependencies": { + "follow-redirects": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", + "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", + "requires": { + "debug": "3.1.0" + } + } } }, "babel-code-frame": { @@ -387,6 +452,39 @@ "mkdirp": "0.5.1", "util.promisify": "1.0.0", "yargs-parser": "5.0.0" + }, + "dependencies": { + "babel-preset-minify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.2.0.tgz", + "integrity": "sha512-mR8Q44RmMzm18bM2Lqd9uiPopzk5GDCtVuquNbLFmX6lOKnqWoenaNBxnWW0UhBFC75lEHTIgNGCbnsRI0pJVw==", + "dev": true, + "requires": { + "babel-plugin-minify-builtins": "0.2.0", + "babel-plugin-minify-constant-folding": "0.2.0", + "babel-plugin-minify-dead-code-elimination": "0.2.0", + "babel-plugin-minify-flip-comparisons": "0.2.0", + "babel-plugin-minify-guarded-expressions": "0.2.0", + "babel-plugin-minify-infinity": "0.2.0", + "babel-plugin-minify-mangle-names": "0.2.0", + "babel-plugin-minify-numeric-literals": "0.2.0", + "babel-plugin-minify-replace": "0.2.0", + "babel-plugin-minify-simplify": "0.2.0", + "babel-plugin-minify-type-constructors": "0.2.0", + "babel-plugin-transform-inline-consecutive-adds": "0.2.0", + "babel-plugin-transform-member-expression-literals": "6.8.5", + "babel-plugin-transform-merge-sibling-variables": "6.8.6", + "babel-plugin-transform-minify-booleans": "6.8.3", + "babel-plugin-transform-property-literals": "6.8.5", + "babel-plugin-transform-regexp-constructors": "0.2.0", + "babel-plugin-transform-remove-console": "6.8.5", + "babel-plugin-transform-remove-debugger": "6.8.5", + "babel-plugin-transform-remove-undefined": "0.2.0", + "babel-plugin-transform-simplify-comparison-operators": "6.8.5", + "babel-plugin-transform-undefined-to-void": "6.8.3", + "lodash.isplainobject": "4.0.6" + } + } } }, "babel-plugin-minify-builtins": { @@ -557,34 +655,239 @@ "dev": true }, "babel-preset-minify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.2.0.tgz", - "integrity": "sha512-mR8Q44RmMzm18bM2Lqd9uiPopzk5GDCtVuquNbLFmX6lOKnqWoenaNBxnWW0UhBFC75lEHTIgNGCbnsRI0pJVw==", - "dev": true, - "requires": { - "babel-plugin-minify-builtins": "0.2.0", - "babel-plugin-minify-constant-folding": "0.2.0", - "babel-plugin-minify-dead-code-elimination": "0.2.0", - "babel-plugin-minify-flip-comparisons": "0.2.0", - "babel-plugin-minify-guarded-expressions": "0.2.0", - "babel-plugin-minify-infinity": "0.2.0", - "babel-plugin-minify-mangle-names": "0.2.0", - "babel-plugin-minify-numeric-literals": "0.2.0", - "babel-plugin-minify-replace": "0.2.0", - "babel-plugin-minify-simplify": "0.2.0", - "babel-plugin-minify-type-constructors": "0.2.0", - "babel-plugin-transform-inline-consecutive-adds": "0.2.0", - "babel-plugin-transform-member-expression-literals": "6.8.5", - "babel-plugin-transform-merge-sibling-variables": "6.8.6", - "babel-plugin-transform-minify-booleans": "6.8.3", - "babel-plugin-transform-property-literals": "6.8.5", - "babel-plugin-transform-regexp-constructors": "0.2.0", - "babel-plugin-transform-remove-console": "6.8.5", - "babel-plugin-transform-remove-debugger": "6.8.5", - "babel-plugin-transform-remove-undefined": "0.2.0", - "babel-plugin-transform-simplify-comparison-operators": "6.8.5", - "babel-plugin-transform-undefined-to-void": "6.8.3", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.3.0.tgz", + "integrity": "sha512-+VV2GWEyak3eDOmzT1DDMuqHrw3VbE9nBNkx2LLVs4pH/Me32ND8DRpVDd8IRvk1xX5p75nygyRPtkMh6GIAbQ==", + "dev": true, + "requires": { + "babel-plugin-minify-builtins": "0.3.0", + "babel-plugin-minify-constant-folding": "0.3.0", + "babel-plugin-minify-dead-code-elimination": "0.3.0", + "babel-plugin-minify-flip-comparisons": "0.3.0", + "babel-plugin-minify-guarded-expressions": "0.3.0", + "babel-plugin-minify-infinity": "0.3.0", + "babel-plugin-minify-mangle-names": "0.3.0", + "babel-plugin-minify-numeric-literals": "0.3.0", + "babel-plugin-minify-replace": "0.3.0", + "babel-plugin-minify-simplify": "0.3.0", + "babel-plugin-minify-type-constructors": "0.3.0", + "babel-plugin-transform-inline-consecutive-adds": "0.3.0", + "babel-plugin-transform-member-expression-literals": "6.9.0", + "babel-plugin-transform-merge-sibling-variables": "6.9.0", + "babel-plugin-transform-minify-booleans": "6.9.0", + "babel-plugin-transform-property-literals": "6.9.0", + "babel-plugin-transform-regexp-constructors": "0.3.0", + "babel-plugin-transform-remove-console": "6.9.0", + "babel-plugin-transform-remove-debugger": "6.9.0", + "babel-plugin-transform-remove-undefined": "0.3.0", + "babel-plugin-transform-simplify-comparison-operators": "6.9.0", + "babel-plugin-transform-undefined-to-void": "6.9.0", "lodash.isplainobject": "4.0.6" + }, + "dependencies": { + "babel-helper-evaluate-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.3.0.tgz", + "integrity": "sha512-dRFlMTqUJRGzx5a2smKxmptDdNCXKSkPcXWzKLwAV72hvIZumrd/0z9RcewHkr7PmAEq+ETtpD1GK6wZ6ZUXzw==", + "dev": true + }, + "babel-helper-flip-expressions": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.3.0.tgz", + "integrity": "sha512-kNGohWmtAG3b7tN1xocRQ5rsKkH/hpvZsMiGOJ1VwGJKhnwzR5KlB3rvKBaBPl5/IGHcopB2JN+r1SUEX1iMAw==", + "dev": true + }, + "babel-helper-is-void-0": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.3.0.tgz", + "integrity": "sha512-JVqdX8y7Rf/x4NwbqtUI7mdQjL9HWoDnoAEQ8Gv8oxzjvbJv+n75f7l36m9Y8C7sCUltX3V5edndrp7Hp1oSXQ==", + "dev": true + }, + "babel-helper-mark-eval-scopes": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.3.0.tgz", + "integrity": "sha512-nrho5Dg4vl0VUgURVpGpEGiwbst5JX7efIyDHFxmkCx/ocQFnrPt8ze9Kxl6TKjR29bJ7D/XKY1NMlSxOQJRbQ==", + "dev": true + }, + "babel-helper-remove-or-void": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.3.0.tgz", + "integrity": "sha512-D68W1M3ibCcbg0ysh3ww4/O0g10X1CXK720oOuR8kpfY7w0yP4tVcpK7zDmI1JecynycTQYAZ1rhLJo9aVtIKQ==", + "dev": true + }, + "babel-helper-to-multiple-sequence-expressions": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.3.0.tgz", + "integrity": "sha512-1uCrBD+EAaMnAYh7hc944n8Ga19y3daEnoXWPYDvFVsxMCc1l8aDjksApaCEaNSSuewq8BEcff47Cy1PbLg2Gw==", + "dev": true + }, + "babel-plugin-minify-builtins": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.3.0.tgz", + "integrity": "sha512-MqhSHlxkmgURqj3144qPksbZ/qof1JWdumcbucc4tysFcf3P3V3z3munTevQgKEFNMd8F5/ECGnwb63xogLjAg==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0" + } + }, + "babel-plugin-minify-constant-folding": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.3.0.tgz", + "integrity": "sha512-1XeRpx+aY1BuNY6QU/cm6P+FtEi3ar3XceYbmC+4q4W+2Ewq5pL7V68oHg1hKXkBIE0Z4/FjSoHz6vosZLOe/A==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0" + } + }, + "babel-plugin-minify-dead-code-elimination": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.3.0.tgz", + "integrity": "sha512-SjM2Fzg85YZz+q/PNJ/HU4O3W98FKFOiP9K5z3sfonlamGOzvZw3Eup2OTiEBsbbqTeY8yzNCAv3qpJRYCgGmw==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0", + "babel-helper-mark-eval-scopes": "0.3.0", + "babel-helper-remove-or-void": "0.3.0", + "lodash.some": "4.6.0" + } + }, + "babel-plugin-minify-flip-comparisons": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.3.0.tgz", + "integrity": "sha512-B8lK+ekcpSNVH7PZpWDe5nC5zxjRiiT4nTsa6h3QkF3Kk6y9qooIFLemdGlqBq6j0zALEnebvCpw8v7gAdpgnw==", + "dev": true, + "requires": { + "babel-helper-is-void-0": "0.3.0" + } + }, + "babel-plugin-minify-guarded-expressions": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.3.0.tgz", + "integrity": "sha512-O+6CvF5/Ttsth3LMg4/BhyvVZ82GImeKMXGdVRQGK/8jFiP15EjRpdgFlxv3cnqRjqdYxLCS6r28VfLpb9C/kA==", + "dev": true, + "requires": { + "babel-helper-flip-expressions": "0.3.0" + } + }, + "babel-plugin-minify-infinity": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.3.0.tgz", + "integrity": "sha512-Sj8ia3/w9158DWieUxU6/VvnYVy59geeFEkVgLZYBE8EBP+sN48tHtBM/jSgz0ejEdBlcfqJ6TnvPmVXTzR2BQ==", + "dev": true + }, + "babel-plugin-minify-mangle-names": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.3.0.tgz", + "integrity": "sha512-PYTonhFWURsfAN8achDwvR5Xgy6EeTClLz+fSgGRqjAIXb0OyFm3/xfccbQviVi1qDXmlSnt6oJhBg8KE4Fn7Q==", + "dev": true, + "requires": { + "babel-helper-mark-eval-scopes": "0.3.0" + } + }, + "babel-plugin-minify-numeric-literals": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.3.0.tgz", + "integrity": "sha512-TgZj6ay8zDw74AS3yiIfoQ8vRSNJisYO/Du60S8nPV7EW7JM6fDMx5Sar6yVHlVuuwNgvDUBh191K33bVrAhpg==", + "dev": true + }, + "babel-plugin-minify-replace": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.3.0.tgz", + "integrity": "sha512-VR6tTg2Lt0TicHIOw04fsUtpPw7RaRP8PC8YzSFwEixnzvguZjZJoL7TgG7ZyEWQD1cJ96UezswECmFNa815bg==", + "dev": true + }, + "babel-plugin-minify-simplify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.3.0.tgz", + "integrity": "sha512-2M16ytQOCqBi7bYMu4DCWn8e6KyFCA108F6+tVrBJxOmm5u2sOmTFEa8s94tR9RHRRNYmcUf+rgidfnzL3ik9Q==", + "dev": true, + "requires": { + "babel-helper-flip-expressions": "0.3.0", + "babel-helper-is-nodes-equiv": "0.0.1", + "babel-helper-to-multiple-sequence-expressions": "0.3.0" + } + }, + "babel-plugin-minify-type-constructors": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.3.0.tgz", + "integrity": "sha512-XRXpvsUCPeVw9YEUw+9vSiugcSZfow81oIJT0yR9s8H4W7yJ6FHbImi5DJHoL8KcDUjYnL9wYASXk/fOkbyR6Q==", + "dev": true, + "requires": { + "babel-helper-is-void-0": "0.3.0" + } + }, + "babel-plugin-transform-inline-consecutive-adds": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.3.0.tgz", + "integrity": "sha512-iZsYAIjYLLfLK0yN5WVT7Xf7Y3wQ9Z75j9A8q/0IglQSpUt2ppTdHlwl/GeaXnxdaSmsxBu861klbTBbv2n+RA==", + "dev": true + }, + "babel-plugin-transform-member-expression-literals": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.0.tgz", + "integrity": "sha512-bxtac+8w755ctVeDs4vU98RhWY49eW1wO02HAN+eirZYSKk/dVrKONIznXbHmxWKxT4UX1rpTKOCyezuzLpbTw==", + "dev": true + }, + "babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.0.tgz", + "integrity": "sha512-9G1URVEEKoQLDqe0GwqYudECN7kE/q0OCNo5TiD1iwWnnaKi97xY915l5r2KKUvNflXEm9c3faNWknSXYQ7h6Q==", + "dev": true + }, + "babel-plugin-transform-minify-booleans": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.0.tgz", + "integrity": "sha512-JtpyTRyF+wF/r7GSxpRbNCrVve5M/aCC8xoGcnFItaPUDqjxKmFYvBzMc9u+g0lgo8NWjuZLc16MYaIwkHKD/A==", + "dev": true + }, + "babel-plugin-transform-property-literals": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.0.tgz", + "integrity": "sha512-B8s+71+4DPye9+pmZiPGgLPy3YqcmIuvE/9UcZLczPlwL5ALwF6qRUdLC3Fk17NhL6jxp4u33ZVZ8R4kvASPzw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "babel-plugin-transform-regexp-constructors": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.3.0.tgz", + "integrity": "sha512-h92YHzyl042rb0naKO8frTHntpRFwRgKkfWD8602kFHoQingjJNtbvZzvxqHncJ6XmKVyYvfrBpDOSkCTDIIxw==", + "dev": true + }, + "babel-plugin-transform-remove-console": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.0.tgz", + "integrity": "sha512-mck9//yGTwObqqqDzY/sISO88/5/XfIB3ILb4uJLXk2xq124NT4yQVjFSRgVSbLcNq8OyBAn2acxKUqg4W/okQ==", + "dev": true + }, + "babel-plugin-transform-remove-debugger": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.0.tgz", + "integrity": "sha512-i/HWGjsmL2d1N2dl+eIzf44XpSP5v7hi1/GXB0xzom9kjrU8js3T8Kadizn95ZxfHK592Vg8P4JJWP/fvimEWw==", + "dev": true + }, + "babel-plugin-transform-remove-undefined": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.3.0.tgz", + "integrity": "sha512-TYGQucc8iP3LJwN3kDZLEz5aa/2KuFrqpT+s8f8NnHsBU1sAgR3y8Opns0xhC+smyDYWscqFCKM1gbkWQOhhnw==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0" + } + }, + "babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.0.tgz", + "integrity": "sha512-EJyfYeph0CSekwQuwWVwJqy2go/bETkR95iaWQ/HTUis7tkCGNYmXngaFzuIXdmoPXfvmXYCvAXR4/93hqHVjw==", + "dev": true + }, + "babel-plugin-transform-undefined-to-void": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.0.tgz", + "integrity": "sha512-AVDVEmp0S9mbF1O8zekWbsOOmqnR08PZah5NRZJqSvJnFgiL0ep4Lwo4EymH8OieJR2QgQdR3q71TNW+wiVn4g==", + "dev": true + } } }, "babel-register": { @@ -723,15 +1026,6 @@ "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, - "boom": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", - "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", - "dev": true, - "requires": { - "hoek": "0.9.1" - } - }, "bower": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/bower/-/bower-1.8.2.tgz", @@ -791,27 +1085,27 @@ "dev": true }, "browserify": { - "version": "14.4.0", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.4.0.tgz", - "integrity": "sha1-CJo0Y69Y0OSNjNQHCz90ZU1avKk=", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.0.0.tgz", + "integrity": "sha512-+tpc/lBPrDSM/5DOPtKWCRvFDvC66lUKUmjft6JevGS/mhWJwrh/KZ+LsVqzkbTmrjeqAsGDbIQSMZCHPCzUPg==", "dev": true, "requires": { "JSONStream": "1.3.1", "assert": "1.4.1", "browser-pack": "6.0.2", "browser-resolve": "1.11.2", - "browserify-zlib": "0.1.4", + "browserify-zlib": "0.2.0", "buffer": "5.0.8", "cached-path-relative": "1.0.1", - "concat-stream": "1.5.2", + "concat-stream": "1.6.0", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.11.1", "defined": "1.0.0", "deps-sort": "2.0.0", - "domain-browser": "1.1.7", + "domain-browser": "1.2.0", "duplexer2": "0.1.4", - "events": "1.1.1", + "events": "2.0.0", "glob": "7.1.2", "has": "1.0.1", "htmlescape": "1.1.1", @@ -819,8 +1113,9 @@ "inherits": "2.0.3", "insert-module-globals": "7.0.1", "labeled-stream-splicer": "2.0.0", - "module-deps": "4.1.1", - "os-browserify": "0.1.2", + "mkdirp": "0.5.1", + "module-deps": "6.0.0", + "os-browserify": "0.3.0", "parents": "1.0.1", "path-browserify": "0.0.0", "process": "0.11.10", @@ -838,50 +1133,90 @@ "syntax-error": "1.3.0", "through2": "2.0.3", "timers-browserify": "1.4.2", - "tty-browserify": "0.0.0", + "tty-browserify": "0.0.1", "url": "0.11.0", "util": "0.10.3", "vm-browserify": "0.0.4", "xtend": "4.0.1" }, "dependencies": { - "concat-stream": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "1.0.6" + } + }, + "detective": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.0.2.tgz", + "integrity": "sha512-NUsLoezj4wb9o7vpxS9F3L5vcO87ceyRBcl48op06YFNwkyIEY997JpSCA5lDlDuDc6JxOtaL5qfK3muoWxpMA==", "dev": true, "requires": { + "@browserify/acorn5-object-spread": "5.0.1", + "acorn": "5.4.1", + "defined": "1.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "events": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.0.0.tgz", + "integrity": "sha512-r/M5YkNg9zwI8QbSf7tsDWWJvO3PGwZXyG7GpFAxtMASnHL2eblFd7iHiGPtyGKKFPZ59S63NeX10Ws6WqGDcg==", + "dev": true + }, + "module-deps": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.0.0.tgz", + "integrity": "sha512-BKsMhJJENEM4dTgqq2MDTTHXRHcNUFegoAwlG4HO4VMdUyMcJDKgfgI+MOv6tR5Iv8G3MKZFgsSiyP3ZoosRMw==", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.1", + "concat-stream": "1.6.0", + "defined": "1.0.0", + "detective": "5.0.2", + "duplexer2": "0.1.4", "inherits": "2.0.3", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } + "parents": "1.0.1", + "readable-stream": "2.3.3", + "resolve": "1.4.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", "dev": true } } @@ -947,15 +1282,6 @@ "parse-asn1": "5.1.0" } }, - "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", - "dev": true, - "requires": { - "pako": "0.2.9" - } - }, "buffer": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.8.tgz", @@ -1067,7 +1393,8 @@ "charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", - "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=" + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true }, "check-error": { "version": "1.0.2", @@ -1168,16 +1495,6 @@ } } }, - "combined-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", - "dev": true, - "optional": true, - "requires": { - "delayed-stream": "0.0.5" - } - }, "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", @@ -1216,24 +1533,6 @@ "typedarray": "0.0.6" } }, - "config-chain": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", - "integrity": "sha1-q6CXR9++TD5w52am5BWG4YWfxvI=", - "dev": true, - "requires": { - "ini": "1.3.4", - "proto-list": "1.2.4" - }, - "dependencies": { - "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", - "dev": true - } - } - }, "console-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", @@ -1341,17 +1640,8 @@ "crypt": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=" - }, - "cryptiles": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", - "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", - "dev": true, - "optional": true, - "requires": { - "boom": "0.4.2" - } + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "dev": true }, "crypto-browserify": { "version": "3.11.1", @@ -1371,13 +1661,6 @@ "randombytes": "2.0.5" } }, - "ctype": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", - "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=", - "dev": true, - "optional": true - }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -1445,13 +1728,6 @@ "rimraf": "2.6.2" } }, - "delayed-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", - "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", - "dev": true, - "optional": true - }, "deps-sort": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", @@ -1483,24 +1759,6 @@ "repeating": "2.0.1" } }, - "detective": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", - "integrity": "sha1-blqMaybmx6JUsca210kNmOyR7dE=", - "dev": true, - "requires": { - "acorn": "4.0.13", - "defined": "1.0.0" - }, - "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - } - } - }, "diff": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", @@ -1518,30 +1776,6 @@ "randombytes": "2.0.5" } }, - "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", - "dev": true, - "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", - "dev": true - }, "duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -1665,6 +1899,21 @@ "is-symbol": "1.0.1" } }, + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "4.2.4" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1703,33 +1952,33 @@ } }, "eslint": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.8.0.tgz", - "integrity": "sha1-Ip7w41Tg5h2DfHqA/fuoJeGZgV4=", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.17.0.tgz", + "integrity": "sha512-AyxBUCANU/o/xC0ijGMKavo5Ls3oK6xykiOITlMdjFjrKOsqLrA7Nf5cnrDgcKrHzBirclAZt63XO7YZlVUPwA==", "dev": true, "requires": { - "ajv": "5.2.3", + "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "2.1.0", + "chalk": "2.3.1", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", "debug": "3.1.0", - "doctrine": "2.0.0", + "doctrine": "2.1.0", "eslint-scope": "3.7.1", - "espree": "3.5.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.3", "esquery": "1.0.0", - "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", + "globals": "11.3.0", "ignore": "3.3.5", "imurmurhash": "0.1.4", "inquirer": "3.3.0", "is-resolvable": "1.0.0", "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", "minimatch": "3.0.4", @@ -1740,13 +1989,31 @@ "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", - "semver": "5.4.1", + "semver": "5.5.0", "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", "table": "4.0.2", "text-table": "0.2.0" }, "dependencies": { + "acorn": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.1.tgz", + "integrity": "sha512-XLmq3H/BVvW6/GbxKryGxWORz1ebilSsUDlyC27bXhWGWAZWkGwS6FLHjOlwFXNFoWFQEO/Df4u0YYd0K3BQgQ==", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -1763,14 +2030,33 @@ } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" + "supports-color": "5.2.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "espree": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.3.tgz", + "integrity": "sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==", + "dev": true, + "requires": { + "acorn": "5.4.1", + "acorn-jsx": "3.0.1" } }, "esprima": { @@ -1779,10 +2065,16 @@ "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "globals": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "dev": true + }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "js-yaml": { @@ -1802,9 +2094,9 @@ "dev": true }, "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "strip-ansi": { @@ -1817,12 +2109,12 @@ } }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -1836,6 +2128,21 @@ "eslint-restricted-globals": "0.1.1" } }, + "eslint-config-mocha": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-mocha/-/eslint-config-mocha-0.0.0.tgz", + "integrity": "sha1-QJsDThiVDUTFsSccltJTYznc+2k=", + "dev": true, + "requires": { + "lodash.mergewith": "4.6.1" + } + }, + "eslint-config-standard": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz", + "integrity": "sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE=", + "dev": true + }, "eslint-import-resolver-node": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", @@ -1885,9 +2192,9 @@ "dev": true }, "eslint-plugin-import": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz", - "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", + "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", "dev": true, "requires": { "builtin-modules": "1.1.1", @@ -1938,30 +2245,42 @@ "ramda": "0.24.1" } }, + "eslint-plugin-mocha-only": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha-only/-/eslint-plugin-mocha-only-0.0.3.tgz", + "integrity": "sha1-8dEoTPIrefVOwf35iAye8FE5wkA=", + "dev": true + }, "eslint-plugin-node": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.0.tgz", - "integrity": "sha512-N9FLFwknT5LhRhjz1lmHguNss/MCwkrLCS4CjqqTZZTJaUhLRfDNK3zxSHL/Il3Aa0Mw+xY3T1gtsJrUNoJy8Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.0.tgz", + "integrity": "sha512-Qj4dMF1N/wRALO1IRvnchn8c1i0awgrztrGx7MjF9ewDwlW/heNB+WeZ09bhp8Yp0TD+BZcADP8BRya0wmropA==", "dev": true, "requires": { - "ignore": "3.3.5", + "ignore": "3.3.7", "minimatch": "3.0.4", "resolve": "1.4.0", - "semver": "5.3.0" + "semver": "5.5.0" }, "dependencies": { + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true } } }, "eslint-plugin-promise": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz", - "integrity": "sha1-ePu2/+BHIBYnVp6FpsU3OvKmj8o=", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", + "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", "dev": true }, "eslint-restricted-globals": { @@ -1980,15 +2299,11 @@ "estraverse": "4.2.0" } }, - "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", - "dev": true, - "requires": { - "acorn": "5.1.2", - "acorn-jsx": "3.0.1" - } + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true }, "esprima": { "version": "2.7.3", @@ -2027,12 +2342,6 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "events": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true - }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -2062,18 +2371,71 @@ "tmp": "0.0.33" } }, + "extract-zip": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz", + "integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=", + "dev": true, + "requires": { + "concat-stream": "1.6.0", + "debug": "2.6.9", + "mkdirp": "0.5.0", + "yauzl": "2.4.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + } + } + }, "fast-deep-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", "dev": true }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "dev": true, + "requires": { + "pend": "1.2.0" + } + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -2115,57 +2477,12 @@ "write": "0.2.1" } }, - "follow-redirects": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.2.4.tgz", - "integrity": "sha512-Suw6KewLV2hReSyEOeql+UUkBVyiBm3ok1VPrVFRZnQInWpdoZbbiG5i8aJVSjTr0yQ4Ava0Sh6/joCg1Brdqw==", - "requires": { - "debug": "2.6.9" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, "foreach": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, - "forever-agent": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", - "integrity": "sha1-bQ4JxJIflKJ/Y9O0nF/v8epMUTA=", - "dev": true - }, - "form-data": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", - "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", - "dev": true, - "optional": true, - "requires": { - "async": "0.9.2", - "combined-stream": "0.0.7", - "mime": "1.2.11" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true, - "optional": true - } - } - }, "formatio": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", @@ -2330,19 +2647,6 @@ "minimalistic-assert": "1.0.0" } }, - "hawk": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz", - "integrity": "sha1-uQuxaYByhUEdp//LjdJZhQLTtS0=", - "dev": true, - "optional": true, - "requires": { - "boom": "0.4.2", - "cryptiles": "0.2.2", - "hoek": "0.9.1", - "sntp": "0.2.4" - } - }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", @@ -2360,12 +2664,6 @@ "minimalistic-crypto-utils": "1.0.1" } }, - "hoek": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", - "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", - "dev": true - }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -2388,24 +2686,22 @@ "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "dev": true }, - "http-signature": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", - "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", - "dev": true, - "optional": true, - "requires": { - "asn1": "0.1.11", - "assert-plus": "0.1.5", - "ctype": "0.5.3" - } - }, "https-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "https-proxy-agent": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.1.1.tgz", + "integrity": "sha512-LK6tQUR/VOkTI6ygAfWUKKP95I+e6M1h7N3PncGu1CATHCnex+CAv9ttR0lbHu1Uk2PXm/WoAHFo6JCGwMjVMw==", + "dev": true, + "requires": { + "agent-base": "4.2.0", + "debug": "3.1.0" + } + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -2451,12 +2747,6 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "ini": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.1.0.tgz", - "integrity": "sha1-ToCMLOFExsF4iRjgNNZ5e8bPYoE=", - "dev": true - }, "inline-source-map": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", @@ -2846,10 +3136,10 @@ "jsonify": "0.0.0" } }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, "json5": { @@ -2876,12 +3166,6 @@ "integrity": "sha1-MzCvdWyralQnAMZLLk5KoGLVL/8=", "dev": true }, - "kew": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.1.7.tgz", - "integrity": "sha1-CjKoF/8amzsSuMm6z0vE1nmvjnI=", - "dev": true - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -3004,6 +3288,12 @@ "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", "dev": true }, + "lodash.mergewith": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", + "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", + "dev": true + }, "lodash.some": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", @@ -3040,6 +3330,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", + "dev": true, "requires": { "charenc": "0.0.2", "crypt": "0.0.2", @@ -3078,12 +3369,6 @@ "brorand": "1.1.0" } }, - "mime": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", - "dev": true - }, "mime-db": { "version": "1.30.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", @@ -3136,6 +3421,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" }, @@ -3143,14 +3429,15 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true } } }, "mocha": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.0.1.tgz", - "integrity": "sha512-evDmhkoA+cBNiQQQdSKZa2b9+W2mpLoj50367lhy+Klnx9OV8XlCIhigUnn1gaTFLQCa0kdNhEGDr0hCXOQFDw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.0.tgz", + "integrity": "sha512-ukB2dF+u4aeJjc6IGtPNnJXfeby5d4ZqySlIBT0OEyva/DrMjVm5HkQxKnHDLKEfEQBsEnwTg9HHhtPHJdTd8w==", "dev": true, "requires": { "browser-stdout": "1.3.0", @@ -3182,10 +3469,21 @@ } } }, + "mocha-headless-chrome": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mocha-headless-chrome/-/mocha-headless-chrome-1.8.2.tgz", + "integrity": "sha512-+TRgnO1csCqcjfkN0Jr9QTmAjVnJWuwTK0fjQWQGQDnVILxpWRJpNpLvy2YFyudFCISE8hZ4TqX32O34V6ccTw==", + "dev": true, + "requires": { + "args": "3.0.8", + "puppeteer": "1.0.0" + } + }, "mocha-junit-reporter": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.14.0.tgz", "integrity": "sha1-VtWTRbRa1W9/iEi8kYRw5LzTkTo=", + "dev": true, "requires": { "debug": "2.6.9", "md5": "2.2.1", @@ -3197,90 +3495,10 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "mocha-phantomjs": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mocha-phantomjs/-/mocha-phantomjs-4.1.0.tgz", - "integrity": "sha1-x14WYS4aavCtjSgeOi/vSdVeUFs=", - "dev": true, - "requires": { - "commander": "2.11.0", - "mocha-phantomjs-core": "1.3.1", - "phantomjs": "1.9.7-15" - } - }, - "mocha-phantomjs-core": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mocha-phantomjs-core/-/mocha-phantomjs-core-1.3.1.tgz", - "integrity": "sha1-WGU4yNcfqN6QxBpGrMBIHB+4Phg=", - "dev": true - }, - "module-deps": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", - "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", - "dev": true, - "requires": { - "JSONStream": "1.3.1", - "browser-resolve": "1.11.2", - "cached-path-relative": "1.0.1", - "concat-stream": "1.5.2", - "defined": "1.0.0", - "detective": "4.5.0", - "duplexer2": "0.1.4", - "inherits": "2.0.3", - "parents": "1.0.1", - "readable-stream": "2.3.3", - "resolve": "1.4.0", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" - }, - "dependencies": { - "concat-stream": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - } - } + "ms": "2.0.0" } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true } } }, @@ -3290,6 +3508,12 @@ "integrity": "sha1-/A2ixlR31yXKa5Z51YNw7QxS9Ts=", "dev": true }, + "mri": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.0.tgz", + "integrity": "sha1-XAo/KcjM/7ux7JQdzsCdcfoy82o=", + "dev": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3313,12 +3537,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "ncp": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz", - "integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ=", - "dev": true - }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -3346,12 +3564,6 @@ } } }, - "node-uuid": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", - "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", - "dev": true - }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -3381,64 +3593,12 @@ } } }, - "npmconf": { - "version": "0.0.24", - "resolved": "https://registry.npmjs.org/npmconf/-/npmconf-0.0.24.tgz", - "integrity": "sha1-t4h1sIjMw8Cvo+zrPOMkSxtSOQw=", - "dev": true, - "requires": { - "config-chain": "1.1.11", - "inherits": "1.0.2", - "ini": "1.1.0", - "mkdirp": "0.3.5", - "nopt": "2.2.1", - "once": "1.1.1", - "osenv": "0.0.3", - "semver": "1.1.4" - }, - "dependencies": { - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", - "dev": true - }, - "mkdirp": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", - "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", - "dev": true - }, - "nopt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.2.1.tgz", - "integrity": "sha1-KqCbfRdoSHs7ianFqlIzW/8Lrqc=", - "dev": true, - "requires": { - "abbrev": "1.0.9" - } - }, - "once": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/once/-/once-1.1.1.tgz", - "integrity": "sha1-nbV0kzzLCMOnYU0VQDLAnqbzOec=", - "dev": true - } - } - }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "oauth-sign": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz", - "integrity": "sha1-y1QPk7srIqfVlBaRoojWDo6pOG4=", - "dev": true, - "optional": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3522,12 +3682,6 @@ "wordwrap": "1.0.0" } }, - "os-browserify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", - "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", - "dev": true - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -3540,12 +3694,6 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "osenv": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.0.3.tgz", - "integrity": "sha1-zWrY3bKQkVrZ4idlV2Al1BHynLY=", - "dev": true - }, "p-limit": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", @@ -3561,12 +3709,6 @@ "p-limit": "1.1.0" } }, - "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", - "dev": true - }, "parents": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", @@ -3698,43 +3840,11 @@ "sha.js": "2.4.9" } }, - "phantomjs": { - "version": "1.9.7-15", - "resolved": "https://registry.npmjs.org/phantomjs/-/phantomjs-1.9.7-15.tgz", - "integrity": "sha1-Czp85jBIaoO+kf9Ogy7uIOlxEVs=", - "dev": true, - "requires": { - "adm-zip": "0.2.1", - "kew": "0.1.7", - "mkdirp": "0.3.5", - "ncp": "0.4.2", - "npmconf": "0.0.24", - "progress": "1.1.8", - "request": "2.36.0", - "request-progress": "0.3.1", - "rimraf": "2.2.8", - "which": "1.0.9" - }, - "dependencies": { - "mkdirp": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", - "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", - "dev": true - }, - "rimraf": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", - "dev": true - }, - "which": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/which/-/which-1.0.9.tgz", - "integrity": "sha1-RgwdoPgQED0DIam2M6+eV15kSG8=", - "dev": true - } - } + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true }, "pify": { "version": "2.3.0", @@ -3766,6 +3876,12 @@ "find-up": "1.1.2" } }, + "pkginfo": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", + "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", + "dev": true + }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", @@ -3796,16 +3912,10 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", - "dev": true - }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=", "dev": true }, "pseudomap": { @@ -3833,11 +3943,61 @@ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, - "qs": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", - "integrity": "sha1-bgFQmP9RlouKPIGQAdXyyJvEsQc=", - "dev": true + "puppeteer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.0.0.tgz", + "integrity": "sha512-e00NMdUL32YhBcua9OkVXHgyDEMBWJhDXkYNv0pyKRU1Z1OrsRm5zCpppAdxAsBI+/MJBspFNfOUZuZ24qPGMQ==", + "dev": true, + "requires": { + "debug": "2.6.9", + "extract-zip": "1.6.6", + "https-proxy-agent": "2.1.1", + "mime": "1.6.0", + "progress": "2.0.0", + "proxy-from-env": "1.0.0", + "rimraf": "2.6.2", + "ws": "3.3.3" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "requires": { + "async-limiter": "1.0.0", + "safe-buffer": "5.1.1", + "ultron": "1.1.0" + } + } + } }, "querystring": { "version": "0.2.0", @@ -3965,35 +4125,6 @@ "is-finite": "1.0.2" } }, - "request": { - "version": "2.36.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.36.0.tgz", - "integrity": "sha1-KMbAQmLHuf/dIbklU3RRfubZQ/U=", - "dev": true, - "requires": { - "aws-sign2": "0.5.0", - "forever-agent": "0.5.2", - "form-data": "0.1.4", - "hawk": "1.0.0", - "http-signature": "0.10.1", - "json-stringify-safe": "5.0.1", - "mime": "1.2.11", - "node-uuid": "1.4.8", - "oauth-sign": "0.3.0", - "qs": "0.6.6", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.4.3" - } - }, - "request-progress": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-0.3.1.tgz", - "integrity": "sha1-ByHBBdipasayzossia4tXs/Pazo=", - "dev": true, - "requires": { - "throttleit": "0.0.2" - } - }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -4110,12 +4241,6 @@ "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", "dev": true }, - "semver": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-1.1.4.tgz", - "integrity": "sha1-LlpOcrqwNHLMl/cnU7RQiRLvVUA=", - "dev": true - }, "sha.js": { "version": "2.4.9", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", @@ -4213,16 +4338,6 @@ "is-fullwidth-code-point": "2.0.0" } }, - "sntp": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", - "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", - "dev": true, - "optional": true, - "requires": { - "hoek": "0.9.1" - } - }, "socket.io": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz", @@ -4390,6 +4505,15 @@ "readable-stream": "2.3.3" } }, + "string-similarity": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-1.2.0.tgz", + "integrity": "sha1-11FTyzg4RjGLejmo2SkrtNtOnDA=", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -4556,12 +4680,6 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "throttleit": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", - "integrity": "sha1-z+34jmDADdlpe2H90qg0OptoDq8=", - "dev": true - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -4613,16 +4731,6 @@ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, - "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -4635,19 +4743,6 @@ "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", "dev": true }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true, - "optional": true - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -4848,7 +4943,8 @@ "xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", - "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=" + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true }, "xmlcreate": { "version": "1.0.2", @@ -4903,6 +4999,15 @@ } } }, + "yauzl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "dev": true, + "requires": { + "fd-slicer": "1.0.1" + } + }, "yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", diff --git a/package.json b/package.json index c1b9a94..d1f7329 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opentmi-jsclient", - "version": "0.2.0", + "version": "0.3.0", "description": "OpenTMI javascript client", "main": "src/index.js", "authors": [