diff --git a/browser/extensions/loop/bootstrap.js b/browser/extensions/loop/bootstrap.js index 19d5d1945bbf..14f532f10c70 100644 --- a/browser/extensions/loop/bootstrap.js +++ b/browser/extensions/loop/bootstrap.js @@ -538,7 +538,8 @@ var WindowListener = { state = "error"; mozL10nId += "-error";} else if (this.isSlideshowOpen) { - state = "slideshow";} else + state = "slideshow"; + suffix = ".label";} else if (this.MozLoopService.screenShareActive) { state = "action"; mozL10nId += "-screensharing";} else @@ -663,7 +664,9 @@ var WindowListener = { this.activeSound.load(); this.activeSound.play(); - this.activeSound.addEventListener("ended", function () {_this11.activeSound = undefined;}, false);}, + this.activeSound.addEventListener("ended", function () { + _this11.activeSound = undefined;}, + false);}, /** @@ -744,41 +747,7 @@ var WindowListener = { this._listeningToTabSelect = false; this._browserSharePaused = false; - this._currentRoomToken = null; - - this._sendTelemetryEventsIfNeeded();}, - - - /** - * Sends telemetry events for pause/ resume buttons if needed. - */ - _sendTelemetryEventsIfNeeded: function _sendTelemetryEventsIfNeeded() { - // The user can't click Resume button without clicking Pause button first. - if (!this._pauseButtonClicked) { - return;} - - - var buckets = this.constants.SHARING_SCREEN; - this.LoopAPI.sendMessageToHandler({ - name: "TelemetryAddValue", - data: [ - "LOOP_INFOBAR_ACTION_BUTTONS", - buckets.PAUSED] }); - - - - if (this._resumeButtonClicked) { - this.LoopAPI.sendMessageToHandler({ - name: "TelemetryAddValue", - data: [ - "LOOP_INFOBAR_ACTION_BUTTONS", - buckets.RESUMED] });} - - - - - this._pauseButtonClicked = false; - this._resumeButtonClicked = false;}, + this._currentRoomToken = null;}, /** @@ -942,11 +911,8 @@ var WindowListener = { buttonNode.accessKey = stringObj.accesskey; LoopUI.MozLoopService.toggleBrowserSharing(_this13._browserSharePaused); if (_this13._browserSharePaused) { - _this13._pauseButtonClicked = true; // if paused we stop sharing remote cursors - _this13.removeRemoteCursor();} else - { - _this13._resumeButtonClicked = true;} + _this13.removeRemoteCursor();} return true;}, @@ -1418,10 +1384,10 @@ function startup(data) { // Load our stylesheets. var styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"]. getService(Components.interfaces.nsIStyleSheetService); - var sheets = ["chrome://loop-shared/skin/loop.css"]; + var sheets = [ + "chrome://loop-shared/skin/loop.css", + "chrome://loop/skin/platform.css"];var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { - if (AppConstants.platform != "linux") { - sheets.push("chrome://loop/skin/platform.css");}var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { for (var _iterator2 = sheets[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var sheet = _step2.value; diff --git a/browser/extensions/loop/chrome/content/modules/MozLoopAPI.jsm b/browser/extensions/loop/chrome/content/modules/MozLoopAPI.jsm index a9ea2c1cacc7..fc00d2c17971 100644 --- a/browser/extensions/loop/chrome/content/modules/MozLoopAPI.jsm +++ b/browser/extensions/loop/chrome/content/modules/MozLoopAPI.jsm @@ -83,47 +83,6 @@ var getObjectAPIFunctionName = function getObjectAPIFunctionName(action) { return funcName.charAt(0).toLowerCase() + funcName.substr(1);}; -/** - * Retrieves a list of Social Providers from the Social API that are explicitly - * capable of sharing URLs. - * It also adds a listener that is fired whenever a new Provider is added or - * removed. - * - * @return {Array} Sorted list of share-capable Social Providers. - */ -var updateSocialProvidersCache = function updateSocialProvidersCache() { - var providers = [];var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { - - for (var _iterator2 = Social.providers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var provider = _step2.value; - if (!provider.shareURL) { - continue;} - - - // Only pass the relevant data on to content. - providers.push({ - iconURL: provider.iconURL, - name: provider.name, - origin: provider.origin });}} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2.return) {_iterator2.return();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} - - - - var providersWasSet = !!gSocialProviders; - // Replace old with new. - gSocialProviders = providers.sort(function (a, b) {return ( - a.name.toLowerCase().localeCompare(b.name.toLowerCase()));}); - - // Start listening for changes in the social provider list, if we're not - // doing that yet. - if (!providersWasSet) { - Services.obs.addObserver(updateSocialProvidersCache, "social:providers-changed", false);} else - { - // Dispatch an event to content to let stores freshen-up. - LoopAPIInternal.broadcastPushMessage("SocialProvidersChanged");} - - - return gSocialProviders;}; - - /** * Checks that [browser.js]'s global variable `gMultiProcessBrowser` is active, * instead of checking on first available browser element. @@ -139,7 +98,6 @@ var gBrowserSharingListeners = new Set(); var gBrowserSharingWindows = new Set(); var gPageListeners = null; var gOriginalPageListeners = null; -var gSocialProviders = null; var gStringBundle = null; var gStubbedMessageHandlers = null; var kBatchMessage = "Batch"; @@ -277,27 +235,6 @@ var kMessageHandlers = { reply();}, - /** - * Activates the Social Share panel with the Social Provider panel opened - * when the popup open. - * - * @param {Object} message Message meant for the handler function, containing - * the following parameters in its `data` property: - * [ ] - * @param {Function} reply Callback function, invoked with the result of this - * message handler. The result will be sent back to - * the senders' channel. - */ - AddSocialShareProvider: function AddSocialShareProvider(message, reply) { - var win = Services.wm.getMostRecentWindow("navigator:browser"); - if (!win || !win.SocialShare) { - reply(); - return;} - - win.SocialShare.showDirectory(win.LoopUI.toolbarButton.anchor); - reply();}, - - /** * Composes an email via the external protocol service. * @@ -415,9 +352,9 @@ var kMessageHandlers = { // Get the map of strings. var strings = MozLoopService.getStrings(); // Convert it to an object. - gStringBundle = {};var _iteratorNormalCompletion3 = true;var _didIteratorError3 = false;var _iteratorError3 = undefined;try { - for (var _iterator3 = strings.entries()[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {var _ref = _step3.value;var _ref2 = _slicedToArray(_ref, 2);var key = _ref2[0];var value = _ref2[1]; - gStringBundle[key] = value;}} catch (err) {_didIteratorError3 = true;_iteratorError3 = err;} finally {try {if (!_iteratorNormalCompletion3 && _iterator3.return) {_iterator3.return();}} finally {if (_didIteratorError3) {throw _iteratorError3;}}} + gStringBundle = {};var _iteratorNormalCompletion2 = true;var _didIteratorError2 = false;var _iteratorError2 = undefined;try { + for (var _iterator2 = strings.entries()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {var _ref = _step2.value;var _ref2 = _slicedToArray(_ref, 2);var key = _ref2[0];var value = _ref2[1]; + gStringBundle[key] = value;}} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2.return) {_iterator2.return();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}} reply(gStringBundle);}, @@ -438,10 +375,7 @@ var kMessageHandlers = { LOOP_SESSION_TYPE: LOOP_SESSION_TYPE, LOOP_MAU_TYPE: LOOP_MAU_TYPE, ROOM_CREATE: ROOM_CREATE, - ROOM_DELETE: ROOM_DELETE, - SHARING_ROOM_URL: SHARING_ROOM_URL, - SHARING_SCREEN: SHARING_SCREEN, - TWO_WAY_MEDIA_CONN_LENGTH: TWO_WAY_MEDIA_CONN_LENGTH });}, + SHARING_ROOM_URL: SHARING_ROOM_URL });}, @@ -555,8 +489,8 @@ var kMessageHandlers = { * the senders' channel. */ GetErrors: function GetErrors(message, reply) { - var errors = {};var _iteratorNormalCompletion4 = true;var _didIteratorError4 = false;var _iteratorError4 = undefined;try { - for (var _iterator4 = MozLoopService.errors[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {var _ref3 = _step4.value;var _ref4 = _slicedToArray(_ref3, 2);var type = _ref4[0];var error = _ref4[1]; + var errors = {};var _iteratorNormalCompletion3 = true;var _didIteratorError3 = false;var _iteratorError3 = undefined;try { + for (var _iterator3 = MozLoopService.errors[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {var _ref3 = _step3.value;var _ref4 = _slicedToArray(_ref3, 2);var type = _ref4[0];var error = _ref4[1]; // if error.error is an nsIException, just delete it since it's hard // to clone across the boundary. if (error.error instanceof Ci.nsIException) { @@ -566,7 +500,7 @@ var kMessageHandlers = { delete error.error;} - errors[type] = cloneableError(error);}} catch (err) {_didIteratorError4 = true;_iteratorError4 = err;} finally {try {if (!_iteratorNormalCompletion4 && _iterator4.return) {_iterator4.return();}} finally {if (_didIteratorError4) {throw _iteratorError4;}}} + errors[type] = cloneableError(error);}} catch (err) {_didIteratorError3 = true;_iteratorError3 = err;} finally {try {if (!_iteratorNormalCompletion3 && _iterator3.return) {_iterator3.return();}} finally {if (_didIteratorError3) {throw _iteratorError3;}}} return reply(errors);}, @@ -699,25 +633,6 @@ var kMessageHandlers = { win.gBrowser.selectedBrowser.messageManager.sendAsyncMessage("PageMetadata:GetPageData");}, - /** - * Returns a sorted list of Social Providers that can share URLs. See - * `updateSocialProvidersCache()` for more information. - * - * @param {Object} message Message meant for the handler function, containing - * the following parameters in its `data` property: - * [ ] - * @param {Function} reply Callback function, invoked with the result of this - * message handler. The result will be sent back to - * the senders' channel. - * @return {Array} Sorted list of share-capable Social Providers. - */ - GetSocialShareProviders: function GetSocialShareProviders(message, reply) { - if (!gSocialProviders) { - updateSocialProvidersCache();} - - reply(gSocialProviders);}, - - /** * Gets an object with data that represents the currently * authenticated user's identity. @@ -990,15 +905,15 @@ var kMessageHandlers = { if (gBrowserSharingListeners.size > 0) { // There are still clients listening in, so keep on listening... reply(); - return;}var _iteratorNormalCompletion5 = true;var _didIteratorError5 = false;var _iteratorError5 = undefined;try { + return;}var _iteratorNormalCompletion4 = true;var _didIteratorError4 = false;var _iteratorError4 = undefined;try { - for (var _iterator5 = gBrowserSharingWindows[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {var win = _step5.value; + for (var _iterator4 = gBrowserSharingWindows[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {var win = _step4.value; win = win.get(); if (!win) { continue;} - win.LoopUI.stopBrowserSharing();}} catch (err) {_didIteratorError5 = true;_iteratorError5 = err;} finally {try {if (!_iteratorNormalCompletion5 && _iterator5.return) {_iterator5.return();}} finally {if (_didIteratorError5) {throw _iteratorError5;}}} + win.LoopUI.stopBrowserSharing();}} catch (err) {_didIteratorError4 = true;_iteratorError4 = err;} finally {try {if (!_iteratorNormalCompletion4 && _iterator4.return) {_iterator4.return();}} finally {if (_didIteratorError4) {throw _iteratorError4;}}} NewTabURL.reset(); @@ -1090,42 +1005,6 @@ var kMessageHandlers = { reply();}, - /** - * Share a room URL with the Social API. - * - * @param {Object} message Message meant for the handler function, containing - * the following parameters in its `data` property: - * [ - * {String} providerOrigin URL fragment that identifies - * a social provider - * {String} roomURL URL of a room - * {String} title Title of the sharing message - * {String} body Body of the sharing message - * ] - * @param {Function} reply Callback function, invoked with the result of this - * message handler. The result will be sent back to - * the senders' channel. - */ - SocialShareRoom: function SocialShareRoom(message, reply) { - var win = Services.wm.getMostRecentWindow("navigator:browser"); - if (!win || !win.SocialShare) { - reply(); - return;}var _message$data10 = _slicedToArray( - - - message.data, 4);var providerOrigin = _message$data10[0];var roomURL = _message$data10[1];var title = _message$data10[2];var body = _message$data10[3]; - var graphData = { - url: roomURL, - title: title }; - - if (body) { - graphData.body = body;} - - win.SocialShare.sharePage(providerOrigin, graphData, null, - win.LoopUI.toolbarButton.anchor); - reply();}, - - /** * Adds a value to a telemetry histogram. * @@ -1141,8 +1020,8 @@ var kMessageHandlers = { * message handler. The result will be sent back to * the senders' channel. */ - TelemetryAddValue: function TelemetryAddValue(message, reply) {var _message$data11 = _slicedToArray( - message.data, 2);var histogramId = _message$data11[0];var value = _message$data11[1]; + TelemetryAddValue: function TelemetryAddValue(message, reply) {var _message$data10 = _slicedToArray( + message.data, 2);var histogramId = _message$data10[0];var value = _message$data10[1]; if (histogramId === "LOOP_ACTIVITY_COUNTER") { var pref = "mau." + kMauPrefMap.get(value); @@ -1189,13 +1068,13 @@ var LoopAPIInternal = { new RemotePages("about:loopconversation"), // Slideshow added here to expose the loop api to make L10n work. // XXX Can remove once slideshow is made remote. - new RemotePages("chrome://loop/content/panels/slideshow.html")];var _iteratorNormalCompletion6 = true;var _didIteratorError6 = false;var _iteratorError6 = undefined;try { - for (var _iterator6 = gPageListeners[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {var page = _step6.value; + new RemotePages("chrome://loop/content/panels/slideshow.html")];var _iteratorNormalCompletion5 = true;var _didIteratorError5 = false;var _iteratorError5 = undefined;try { + for (var _iterator5 = gPageListeners[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {var page = _step5.value; page.addMessageListener(kMessageName, this.handleMessage.bind(this));} // Subscribe to global events: - } catch (err) {_didIteratorError6 = true;_iteratorError6 = err;} finally {try {if (!_iteratorNormalCompletion6 && _iterator6.return) {_iterator6.return();}} finally {if (_didIteratorError6) {throw _iteratorError6;}}}Services.obs.addObserver(this.handleStatusChanged, "loop-status-changed", false);}, + } catch (err) {_didIteratorError5 = true;_iteratorError5 = err;} finally {try {if (!_iteratorNormalCompletion5 && _iterator5.return) {_iterator5.return();}} finally {if (_didIteratorError5) {throw _iteratorError5;}}}Services.obs.addObserver(this.handleStatusChanged, "loop-status-changed", false);}, /** @@ -1351,14 +1230,14 @@ var LoopAPIInternal = { MozLoopService.log.debug("Unable to send event through to target: " + ex.message); // Unregister event handlers when the message port is unreachable. - var _iteratorNormalCompletion7 = true;var _didIteratorError7 = false;var _iteratorError7 = undefined;try {for (var _iterator7 = events[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {var eventName = _step7.value; - api.off(eventName, handlerFunc);}} catch (err) {_didIteratorError7 = true;_iteratorError7 = err;} finally {try {if (!_iteratorNormalCompletion7 && _iterator7.return) {_iterator7.return();}} finally {if (_didIteratorError7) {throw _iteratorError7;}}}}};var _iteratorNormalCompletion8 = true;var _didIteratorError8 = false;var _iteratorError8 = undefined;try { + var _iteratorNormalCompletion6 = true;var _didIteratorError6 = false;var _iteratorError6 = undefined;try {for (var _iterator6 = events[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {var eventName = _step6.value; + api.off(eventName, handlerFunc);}} catch (err) {_didIteratorError6 = true;_iteratorError6 = err;} finally {try {if (!_iteratorNormalCompletion6 && _iterator6.return) {_iterator6.return();}} finally {if (_didIteratorError6) {throw _iteratorError6;}}}}};var _iteratorNormalCompletion7 = true;var _didIteratorError7 = false;var _iteratorError7 = undefined;try { - for (var _iterator8 = events[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {var eventName = _step8.value; - api.on(eventName, handlerFunc);}} catch (err) {_didIteratorError8 = true;_iteratorError8 = err;} finally {try {if (!_iteratorNormalCompletion8 && _iterator8.return) {_iterator8.return();}} finally {if (_didIteratorError8) {throw _iteratorError8;}}} + for (var _iterator7 = events[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {var eventName = _step7.value; + api.on(eventName, handlerFunc);}} catch (err) {_didIteratorError7 = true;_iteratorError7 = err;} finally {try {if (!_iteratorNormalCompletion7 && _iterator7.return) {_iterator7.return();}} finally {if (_didIteratorError7) {throw _iteratorError7;}}} reply(); return { v: void 0 };}();if ((typeof _ret === "undefined" ? "undefined" : _typeof(_ret)) === "object") return _ret.v;} @@ -1388,16 +1267,16 @@ var LoopAPIInternal = { */ broadcastPushMessage: function broadcastPushMessage(name, data) { if (!gPageListeners) { - return;}var _iteratorNormalCompletion9 = true;var _didIteratorError9 = false;var _iteratorError9 = undefined;try { + return;}var _iteratorNormalCompletion8 = true;var _didIteratorError8 = false;var _iteratorError8 = undefined;try { - for (var _iterator9 = gPageListeners[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {var page = _step9.value; + for (var _iterator8 = gPageListeners[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {var page = _step8.value; try { page.sendAsyncMessage(kPushMessageName, [name, data]);} catch (ex) { // Only make noise when the Remote Page Manager needs more time to // initialize. if (ex.result != Components.results.NS_ERROR_NOT_INITIALIZED) { - throw ex;}}}} catch (err) {_didIteratorError9 = true;_iteratorError9 = err;} finally {try {if (!_iteratorNormalCompletion9 && _iterator9.return) {_iterator9.return();}} finally {if (_didIteratorError9) {throw _iteratorError9;}}}}, + throw ex;}}}} catch (err) {_didIteratorError8 = true;_iteratorError8 = err;} finally {try {if (!_iteratorNormalCompletion8 && _iterator8.return) {_iterator8.return();}} finally {if (_didIteratorError8) {throw _iteratorError8;}}}}, @@ -1408,19 +1287,15 @@ var LoopAPIInternal = { */ destroy: function destroy() { if (!gPageListeners) { - return;}var _iteratorNormalCompletion10 = true;var _didIteratorError10 = false;var _iteratorError10 = undefined;try { + return;}var _iteratorNormalCompletion9 = true;var _didIteratorError9 = false;var _iteratorError9 = undefined;try { - for (var _iterator10 = gPageListeners[Symbol.iterator](), _step10; !(_iteratorNormalCompletion10 = (_step10 = _iterator10.next()).done); _iteratorNormalCompletion10 = true) {var listener = _step10.value; - listener.destroy();}} catch (err) {_didIteratorError10 = true;_iteratorError10 = err;} finally {try {if (!_iteratorNormalCompletion10 && _iterator10.return) {_iterator10.return();}} finally {if (_didIteratorError10) {throw _iteratorError10;}}} + for (var _iterator9 = gPageListeners[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {var listener = _step9.value; + listener.destroy();}} catch (err) {_didIteratorError9 = true;_iteratorError9 = err;} finally {try {if (!_iteratorNormalCompletion9 && _iterator9.return) {_iterator9.return();}} finally {if (_didIteratorError9) {throw _iteratorError9;}}} gPageListeners = null; // Unsubscribe from global events. - Services.obs.removeObserver(this.handleStatusChanged, "loop-status-changed"); - // Stop listening for changes in the social provider list, if necessary. - if (gSocialProviders) { - Services.obs.removeObserver(updateSocialProvidersCache, "social:providers-changed");}} }; - + Services.obs.removeObserver(this.handleStatusChanged, "loop-status-changed");} }; diff --git a/browser/extensions/loop/chrome/content/modules/MozLoopService.jsm b/browser/extensions/loop/chrome/content/modules/MozLoopService.jsm index 9be4a2ab8783..440dd92e4e87 100644 --- a/browser/extensions/loop/chrome/content/modules/MozLoopService.jsm +++ b/browser/extensions/loop/chrome/content/modules/MozLoopService.jsm @@ -11,20 +11,6 @@ var LOOP_SESSION_TYPE = { FXA: 2 }; -/** - * Values that we segment 2-way media connection length telemetry probes - * into. - * - * @type {{SHORTER_THAN_10S: Number, BETWEEN_10S_AND_30S: Number, - * BETWEEN_30S_AND_5M: Number, MORE_THAN_5M: Number}} - */ -var TWO_WAY_MEDIA_CONN_LENGTH = { - SHORTER_THAN_10S: 0, - BETWEEN_10S_AND_30S: 1, - BETWEEN_30S_AND_5M: 2, - MORE_THAN_5M: 3 }; - - /** * Values that we segment sharing a room URL action telemetry probes into. * @@ -51,26 +37,6 @@ var ROOM_CREATE = { CREATE_FAIL: 1 }; -/** - * Values that we segment room delete action telemetry probes into. - * - * @type {{DELETE_SUCCESS: Number, DELETE_FAIL: Number}} - */ -var ROOM_DELETE = { - DELETE_SUCCESS: 0, - DELETE_FAIL: 1 }; - - -/** - * Values that we segment sharing screen pause/ resume action telemetry probes into. - * - * @type {{PAUSED: Number, RESUMED: Number}} - */ -var SHARING_SCREEN = { - PAUSED: 0, - RESUMED: 1 }; - - /** * Values that we segment copy panel action telemetry probes into. * @@ -126,16 +92,12 @@ Cu.import("resource://gre/modules/FxAccountsOAuthClient.jsm"); Cu.importGlobalProperties(["URL"]); this.EXPORTED_SYMBOLS = ["MozLoopService", "LOOP_SESSION_TYPE", "LOOP_MAU_TYPE", -"TWO_WAY_MEDIA_CONN_LENGTH", "SHARING_ROOM_URL", "SHARING_SCREEN", "COPY_PANEL", -"ROOM_CREATE", "ROOM_DELETE"]; +"SHARING_ROOM_URL", "COPY_PANEL", "ROOM_CREATE"]; XPCOMUtils.defineConstant(this, "LOOP_SESSION_TYPE", LOOP_SESSION_TYPE); -XPCOMUtils.defineConstant(this, "TWO_WAY_MEDIA_CONN_LENGTH", TWO_WAY_MEDIA_CONN_LENGTH); XPCOMUtils.defineConstant(this, "SHARING_ROOM_URL", SHARING_ROOM_URL); -XPCOMUtils.defineConstant(this, "SHARING_SCREEN", SHARING_SCREEN); XPCOMUtils.defineConstant(this, "COPY_PANEL", COPY_PANEL); XPCOMUtils.defineConstant(this, "ROOM_CREATE", ROOM_CREATE); -XPCOMUtils.defineConstant(this, "ROOM_DELETE", ROOM_DELETE); XPCOMUtils.defineConstant(this, "LOOP_MAU_TYPE", LOOP_MAU_TYPE); XPCOMUtils.defineLazyModuleGetter(this, "LoopAPI", @@ -829,7 +791,9 @@ var MozLoopServiceInternal = { var report = convertToRTCStatsReport(internalFormat); var logStr = ""; - logs.forEach(function (s) {logStr += s + "\n";}); + logs.forEach(function (s) { + logStr += s + "\n";}); + // We have stats and logs. diff --git a/browser/extensions/loop/chrome/content/panels/css/desktop.css b/browser/extensions/loop/chrome/content/panels/css/desktop.css index 8f43ef2a8593..b93d577471a9 100644 --- a/browser/extensions/loop/chrome/content/panels/css/desktop.css +++ b/browser/extensions/loop/chrome/content/panels/css/desktop.css @@ -151,43 +151,6 @@ html[dir="rtl"] .share-action-group > .invite-button:last-child { color: #4a4a4a; } -.share-service-dropdown { - color: #000; - text-align: start; - bottom: auto; - top: 0; - overflow: hidden; - overflow-y: auto; -} - -/* When the dropdown is showing a vertical scrollbar, compensate for its width. */ -body[platform="other"] .share-service-dropdown.overflow > .dropdown-menu-item, -body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item { - padding-inline-end: 20px; -} - -.share-service-dropdown > .dropdown-menu-item > .icon { - width: 14px; - height: 14px; - margin-right: 4px; -} - -.dropdown-menu-item > .icon-add-share-service { - background-image: url("../img/icons-16x16.svg#add"); - background-repeat: no-repeat; - background-size: 12px 12px; - width: 12px; - height: 12px; -} - -.dropdown-menu-item:hover > .icon-add-share-service { - background-image: url("../img/icons-16x16.svg#add-hover"); -} - -.dropdown-menu-item:hover:active > .icon-add-share-service { - background-image: url("../img/icons-16x16.svg#add-active"); -} - .share-panel-container { position: absolute; top: 0; diff --git a/browser/extensions/loop/chrome/content/panels/js/conversation.js b/browser/extensions/loop/chrome/content/panels/js/conversation.js index b4e3d507a616..7d1c44ac945c 100644 --- a/browser/extensions/loop/chrome/content/panels/js/conversation.js +++ b/browser/extensions/loop/chrome/content/panels/js/conversation.js @@ -179,9 +179,6 @@ loop.conversation = function (mozL10n) { sdk: OT }); - // expose for functional tests - loop.conversation._sdkDriver = sdkDriver; - // Create the stores. var activeRoomStore = new loop.store.ActiveRoomStore(dispatcher, { isDesktop: true, @@ -236,15 +233,7 @@ loop.conversation = function (mozL10n) { return { AppControllerView: AppControllerView, - init: init, - - /** - * Exposed for the use of functional tests to be able to check - * metric-related execution as the call sequence progresses. - * - * @type loop.OTSdkDriver - */ - _sdkDriver: null };}( + init: init };}( document.mozL10n); diff --git a/browser/extensions/loop/chrome/content/panels/js/desktopViews.js b/browser/extensions/loop/chrome/content/panels/js/desktopViews.js index 677d3562144d..4c3be6d82007 100644 --- a/browser/extensions/loop/chrome/content/panels/js/desktopViews.js +++ b/browser/extensions/loop/chrome/content/panels/js/desktopViews.js @@ -157,8 +157,7 @@ loop.shared.desktopViews = function (mozL10n) { locationForMetrics: React.PropTypes.string.isRequired, // This data is supplied by the activeRoomStore. roomData: React.PropTypes.object.isRequired, - show: React.PropTypes.bool.isRequired, - socialShareProviders: React.PropTypes.array }, + show: React.PropTypes.bool.isRequired }, render: function render() {var _this = this; @@ -204,84 +203,9 @@ loop.shared.desktopViews = function (mozL10n) { locationForMetrics: _this.props.locationForMetrics, roomData: _this.props.roomData });} - return null;}()), + return null;}())));} }); - React.createElement(SocialShareDropdown, { - dispatcher: this.props.dispatcher, - ref: "menu", - roomUrl: this.props.roomData.roomUrl, - show: this.state.showMenu, - socialShareProviders: this.props.socialShareProviders })));} }); - - - - - - var SocialShareDropdown = React.createClass({ displayName: "SocialShareDropdown", - propTypes: { - dispatcher: React.PropTypes.instanceOf(loop.Dispatcher).isRequired, - roomUrl: React.PropTypes.string, - show: React.PropTypes.bool.isRequired, - socialShareProviders: React.PropTypes.array }, - - - handleAddServiceClick: function handleAddServiceClick(event) { - event.preventDefault(); - - this.props.dispatcher.dispatch(new sharedActions.AddSocialShareProvider());}, - - - handleProviderClick: function handleProviderClick(event) { - event.preventDefault(); - - var origin = event.currentTarget.dataset.provider; - var provider = this.props.socialShareProviders. - filter(function (socialProvider) { - return socialProvider.origin === origin;})[ - 0]; - - this.props.dispatcher.dispatch(new sharedActions.ShareRoomUrl({ - provider: provider, - roomUrl: this.props.roomUrl, - previews: [] }));}, - - - - render: function render() { - // Don't render a thing when no data has been fetched yet. - if (!this.props.socialShareProviders) { - return null;} - - - var cx = classNames; - var shareDropdown = cx({ - "share-service-dropdown": true, - "dropdown-menu": true, - "visually-hidden": true, - "hide": !this.props.show }); - - - return ( - React.createElement("ul", { className: shareDropdown }, - React.createElement("li", { className: "dropdown-menu-item", onClick: this.handleAddServiceClick }, - React.createElement("i", { className: "icon icon-add-share-service" }), - React.createElement("span", null, mozL10n.get("share_add_service_button"))), - - this.props.socialShareProviders.length ? React.createElement("li", { className: "dropdown-menu-separator" }) : null, - - this.props.socialShareProviders.map(function (provider, idx) { - return ( - React.createElement("li", { className: "dropdown-menu-item", - "data-provider": provider.origin, - key: "provider-" + idx, - onClick: this.handleProviderClick }, - React.createElement("img", { className: "icon", src: provider.iconURL }), - React.createElement("span", null, provider.name)));}. - - - bind(this))));} }); - @@ -291,7 +215,6 @@ loop.shared.desktopViews = function (mozL10n) { CopyLinkButton: CopyLinkButton, EmailLinkButton: EmailLinkButton, FacebookShareButton: FacebookShareButton, - SharePanelView: SharePanelView, - SocialShareDropdown: SocialShareDropdown };}( + SharePanelView: SharePanelView };}( navigator.mozL10n || document.mozL10n); diff --git a/browser/extensions/loop/chrome/content/panels/js/panel.js b/browser/extensions/loop/chrome/content/panels/js/panel.js index a54e9a8cf64a..d95e672cd94a 100644 --- a/browser/extensions/loop/chrome/content/panels/js/panel.js +++ b/browser/extensions/loop/chrome/content/panels/js/panel.js @@ -687,7 +687,9 @@ loop.panel = _.extend(loop.panel || {}, function (_, mozL10n) { topPos = clickYPos - listTop + clickOffset;} // Ensure menu is not cut off at top - if (topPos < 0) {topPos = 0;} + if (topPos < 0) { + topPos = 0;} + return topPos;} @@ -1128,8 +1130,7 @@ loop.panel = _.extend(loop.panel || {}, function (_, mozL10n) { facebookEnabled: this.state.facebookEnabled, locationForMetrics: "panel", roomData: roomData, - show: true, - socialShareProviders: this.state.socialShareProviders })));} }); + show: true })));} }); diff --git a/browser/extensions/loop/chrome/content/panels/js/roomStore.js b/browser/extensions/loop/chrome/content/panels/js/roomStore.js index 9a9e541eefc1..9f022b333b40 100644 --- a/browser/extensions/loop/chrome/content/panels/js/roomStore.js +++ b/browser/extensions/loop/chrome/content/panels/js/roomStore.js @@ -77,7 +77,6 @@ loop.store = loop.store || {}; * @type {Array} */ actions: [ - "addSocialShareProvider", "createRoom", "createdRoom", "createRoomError", @@ -89,7 +88,6 @@ loop.store = loop.store || {}; "getAllRooms", "getAllRoomsError", "openRoom", - "shareRoomUrl", "updateRoomContext", "updateRoomContextDone", "updateRoomContextError", @@ -348,10 +346,7 @@ loop.store = loop.store || {}; console.error("No URL sharing type bucket found for '" + from + "'"); return;} - loop.requestMulti( - ["TelemetryAddValue", "LOOP_SHARING_ROOM_URL", bucket], - ["TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_SHARE]);}, - + loop.request("TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_SHARE);}, /** @@ -373,7 +368,6 @@ loop.store = loop.store || {}; loop.requestMulti( ["NotifyUITour", "Loop:RoomURLEmailed"], - ["TelemetryAddValue", "LOOP_SHARING_ROOM_URL", bucket], ["TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_SHARE]);}, @@ -411,49 +405,7 @@ loop.store = loop.store || {}; console.error("No URL sharing type bucket found for '" + from + "'"); return;} - loop.requestMulti( - ["TelemetryAddValue", "LOOP_SHARING_ROOM_URL", bucket], - ["TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_SHARE]);}, - - - - /** - * Share a room url. - * - * @param {sharedActions.ShareRoomUrl} actionData The action data. - */ - shareRoomUrl: function shareRoomUrl(actionData) { - var providerOrigin = new URL(actionData.provider.origin).hostname; - var shareTitle = ""; - var shareBody = null; - - switch (providerOrigin) { - case "mail.google.com": - shareTitle = mozL10n.get("share_email_subject7"); - shareBody = mozL10n.get("share_email_body7", { - callUrl: actionData.roomUrl }); - - shareBody += mozL10n.get("share_email_footer2"); - break; - case "twitter.com": - default: - shareTitle = mozL10n.get("share_tweet", { - clientShortname2: mozL10n.get("clientShortname2") }); - - break;} - - - loop.requestMulti( - ["SocialShareRoom", actionData.provider.origin, actionData.roomUrl, - shareTitle, shareBody], - ["NotifyUITour", "Loop:RoomURLShared"]);}, - - - /** - * Open the share panel to add a Social share provider. - */ - addSocialShareProvider: function addSocialShareProvider() { - loop.request("AddSocialShareProvider");}, + loop.request("TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_SHARE);}, /** @@ -467,12 +419,7 @@ loop.store = loop.store || {}; if (isError) { this.dispatchAction(new sharedActions.DeleteRoomError({ error: result }));} - var buckets = this._constants.ROOM_DELETE; - loop.requestMulti( - ["TelemetryAddValue", "LOOP_ROOM_DELETE", buckets[isError ? - "DELETE_FAIL" : "DELETE_SUCCESS"]], - ["TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_DELETE]);}. - + loop.request("TelemetryAddValue", "LOOP_ACTIVITY_COUNTER", this._constants.LOOP_MAU_TYPE.ROOM_DELETE);}. bind(this));}, diff --git a/browser/extensions/loop/chrome/content/panels/js/roomViews.js b/browser/extensions/loop/chrome/content/panels/js/roomViews.js index 551865d49f97..eaa3e179229d 100644 --- a/browser/extensions/loop/chrome/content/panels/js/roomViews.js +++ b/browser/extensions/loop/chrome/content/panels/js/roomViews.js @@ -372,8 +372,7 @@ loop.roomViews = function (mozL10n) { facebookEnabled: this.props.facebookEnabled, locationForMetrics: "conversation", roomData: roomData, - show: shouldRenderInvitationOverlay, - socialShareProviders: this.state.socialShareProviders }))));}}} }); + show: shouldRenderInvitationOverlay }))));}}} }); diff --git a/browser/extensions/loop/chrome/content/panels/test/desktopViews_test.js b/browser/extensions/loop/chrome/content/panels/test/desktopViews_test.js index ca349dd1ab10..fc1601c56cb2 100644 --- a/browser/extensions/loop/chrome/content/panels/test/desktopViews_test.js +++ b/browser/extensions/loop/chrome/content/panels/test/desktopViews_test.js @@ -267,96 +267,4 @@ describe("loop.shared.desktopViews", function () { roomData: {} }); - expect(ReactDOM.findDOMNode(view)).eql(null);});}); - - - - describe("SocialShareDropdown", function () { - var fakeProvider, view; - - beforeEach(function () { - fakeProvider = { - name: "foo", - origin: "https://foo", - iconURL: "http://example.com/foo.png" };}); - - - - afterEach(function () { - fakeProvider = null;}); - - - function mountTestComponent(props) { - props = _.extend({ - dispatcher: dispatcher, - show: true }, - props); - return TestUtils.renderIntoDocument( - React.createElement(sharedDesktopViews.SocialShareDropdown, props));} - - - describe("#render", function () { - it("should show no contents when the Social Providers have not been fetched yet", function () { - view = mountTestComponent(); - - expect(ReactDOM.findDOMNode(view)).to.eql(null);}); - - - it("should show an empty list when no Social Providers are available", function () { - view = mountTestComponent({ - socialShareProviders: [] }); - - - var node = ReactDOM.findDOMNode(view); - expect(node.querySelector(".icon-add-share-service")).to.not.eql(null); - expect(node.querySelectorAll(".dropdown-menu-item").length).to.eql(1);}); - - - it("should show a list of available Social Providers", function () { - view = mountTestComponent({ - socialShareProviders: [fakeProvider] }); - - - var node = ReactDOM.findDOMNode(view); - expect(node.querySelector(".icon-add-share-service")).to.not.eql(null); - expect(node.querySelector(".dropdown-menu-separator")).to.not.eql(null); - - var dropdownNodes = node.querySelectorAll(".dropdown-menu-item"); - expect(dropdownNodes.length).to.eql(2); - expect(dropdownNodes[1].querySelector("img").src).to.eql(fakeProvider.iconURL); - expect(dropdownNodes[1].querySelector("span").textContent). - to.eql(fakeProvider.name);});}); - - - - describe("#handleAddServiceClick", function () { - it("should dispatch an action when the 'add provider' item is clicked", function () { - view = mountTestComponent({ - socialShareProviders: [] }); - - - var addItem = ReactDOM.findDOMNode(view).querySelector(".dropdown-menu-item:first-child"); - React.addons.TestUtils.Simulate.click(addItem); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.AddSocialShareProvider());});}); - - - - describe("#handleProviderClick", function () { - it("should dispatch an action when a provider item is clicked", function () { - view = mountTestComponent({ - roomUrl: "http://example.com", - socialShareProviders: [fakeProvider] }); - - - var providerItem = ReactDOM.findDOMNode(view).querySelector(".dropdown-menu-item:last-child"); - React.addons.TestUtils.Simulate.click(providerItem); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.ShareRoomUrl({ - provider: fakeProvider, - roomUrl: "http://example.com", - previews: [] }));});});});}); + expect(ReactDOM.findDOMNode(view)).eql(null);});});}); diff --git a/browser/extensions/loop/chrome/content/panels/test/roomStore_test.js b/browser/extensions/loop/chrome/content/panels/test/roomStore_test.js index 1d18fa025edd..2e54973ddd03 100644 --- a/browser/extensions/loop/chrome/content/panels/test/roomStore_test.js +++ b/browser/extensions/loop/chrome/content/panels/test/roomStore_test.js @@ -41,10 +41,6 @@ describe("loop.store.RoomStore", function () { CREATE_SUCCESS: 0, CREATE_FAIL: 1 }, - ROOM_DELETE: { - DELETE_SUCCESS: 0, - DELETE_FAIL: 1 }, - LOOP_MAU_TYPE: { OPEN_PANEL: 0, OPEN_CONVERSATION: 1, @@ -104,7 +100,9 @@ describe("loop.store.RoomStore", function () { ctime: 1405518241 }]; - document.mozL10n.get = function (str) {return str;};}); + document.mozL10n.get = function (str) { + return str;};}); + afterEach(function () { @@ -505,34 +503,10 @@ describe("loop.store.RoomStore", function () { sinon.assert.calledOnce(dispatcher.dispatch); sinon.assert.calledWithExactly(dispatcher.dispatch, new sharedActions.DeleteRoomError({ - error: err }));}); + error: err }));});}); - it("should log a telemetry event when the operation is successful", function () { - store.deleteRoom(new sharedActions.DeleteRoom({ - roomToken: fakeRoomToken })); - - - sinon.assert.calledTwice(requestStubs.TelemetryAddValue); - sinon.assert.calledWithExactly(requestStubs.TelemetryAddValue.getCall(0), - "LOOP_ROOM_DELETE", 0);}); - - - it("should log a telemetry event when the operation fails", function () { - var err = new Error("fake"); - err.isError = true; - requestStubs["Rooms:Delete"].returns(err); - - store.deleteRoom(new sharedActions.DeleteRoom({ - roomToken: fakeRoomToken })); - - - sinon.assert.calledTwice(requestStubs.TelemetryAddValue); - sinon.assert.calledWithExactly(requestStubs.TelemetryAddValue.getCall(0), - "LOOP_ROOM_DELETE", 1);});}); - - describe("#copyRoomUrl", function () { it("should copy the room URL", function () { @@ -542,29 +516,7 @@ describe("loop.store.RoomStore", function () { sinon.assert.calledOnce(requestStubs.CopyString); - sinon.assert.calledWithExactly(requestStubs.CopyString, "http://invalid");}); - - - it("should send a telemetry event for copy from panel", function () { - store.copyRoomUrl(new sharedActions.CopyRoomUrl({ - roomUrl: "http://invalid", - from: "panel" })); - - - sinon.assert.calledTwice(requestStubs.TelemetryAddValue); - sinon.assert.calledWithExactly(requestStubs.TelemetryAddValue.getCall(0), - "LOOP_SHARING_ROOM_URL", 0);}); - - - it("should send a telemetry event for copy from conversation", function () { - store.copyRoomUrl(new sharedActions.CopyRoomUrl({ - roomUrl: "http://invalid", - from: "conversation" })); - - - sinon.assert.calledTwice(requestStubs.TelemetryAddValue); - sinon.assert.calledWithExactly(requestStubs.TelemetryAddValue.getCall(0), - "LOOP_SHARING_ROOM_URL", 1);});}); + sinon.assert.calledWithExactly(requestStubs.CopyString, "http://invalid");});}); @@ -647,76 +599,7 @@ describe("loop.store.RoomStore", function () { sinon.assert.calledOnce(requestStubs.OpenURL); sinon.assert.calledWithMatch(requestStubs.OpenURL, sharingSite); sinon.assert.calledWithMatch(requestStubs.OpenURL, room); - sinon.assert.calledWithMatch(requestStubs.OpenURL, fallback);}); - - - it("should send a telemetry event for facebook share from conversation", function () { - store.facebookShareRoomUrl(new sharedActions.FacebookShareRoomUrl({ - from: "conversation", - roomUrl: "http://invalid" })); - - - sinon.assert.calledTwice(requestStubs.TelemetryAddValue); - sinon.assert.calledWithExactly(requestStubs.TelemetryAddValue.getCall(0), - "LOOP_SHARING_ROOM_URL", 4);});}); - - - - describe("#shareRoomUrl", function () { - var socialShareRoomStub; - - beforeEach(function () { - socialShareRoomStub = sinon.stub(); - LoopMochaUtils.stubLoopRequest({ - SocialShareRoom: socialShareRoomStub });}); - - - - it("should pass the correct data for GMail sharing", function () { - var roomUrl = "http://invalid"; - var origin = "https://mail.google.com/v1"; - store.shareRoomUrl(new sharedActions.ShareRoomUrl({ - roomUrl: roomUrl, - provider: { - origin: origin } })); - - - - sinon.assert.calledOnce(socialShareRoomStub); - sinon.assert.calledWithExactly(socialShareRoomStub, - origin, - roomUrl, - "share_email_subject7", - "share_email_body7" + - "share_email_footer2");}); - - - it("should pass the correct data for all other Social Providers", function () { - var roomUrl = "http://invalid2"; - var origin = "https://twitter.com/share"; - store.shareRoomUrl(new sharedActions.ShareRoomUrl({ - roomUrl: roomUrl, - provider: { - origin: origin } })); - - - - sinon.assert.calledOnce(socialShareRoomStub); - sinon.assert.calledWithExactly(socialShareRoomStub, origin, - roomUrl, "share_tweet", null);});}); - - - - describe("#addSocialShareProvider", function () { - it("should invoke to the correct mozLoop function", function () { - var stub = sinon.stub(); - LoopMochaUtils.stubLoopRequest({ - AddSocialShareProvider: stub }); - - - store.addSocialShareProvider(new sharedActions.AddSocialShareProvider()); - - sinon.assert.calledOnce(stub);});}); + sinon.assert.calledWithMatch(requestStubs.OpenURL, fallback);});}); @@ -1038,8 +921,8 @@ describe("loop.store.RoomStore", function () { from: "conversation" })); - sinon.assert.calledTwice(requestStubs["TelemetryAddValue"]); - sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"].getCall(1), + sinon.assert.calledOnce(requestStubs["TelemetryAddValue"]); + sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"], "LOOP_ACTIVITY_COUNTER", store._constants.LOOP_MAU_TYPE.ROOM_SHARE);}); @@ -1049,8 +932,8 @@ describe("loop.store.RoomStore", function () { from: "conversation" })); - sinon.assert.calledTwice(requestStubs["TelemetryAddValue"]); - sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"].getCall(1), + sinon.assert.calledOnce(requestStubs["TelemetryAddValue"]); + sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"], "LOOP_ACTIVITY_COUNTER", store._constants.LOOP_MAU_TYPE.ROOM_SHARE);}); @@ -1060,8 +943,8 @@ describe("loop.store.RoomStore", function () { from: "conversation" })); - sinon.assert.calledTwice(requestStubs["TelemetryAddValue"]); - sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"].getCall(1), + sinon.assert.calledOnce(requestStubs["TelemetryAddValue"]); + sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"], "LOOP_ACTIVITY_COUNTER", store._constants.LOOP_MAU_TYPE.ROOM_SHARE);}); @@ -1070,6 +953,6 @@ describe("loop.store.RoomStore", function () { roomToken: "42abc" })); - sinon.assert.calledTwice(requestStubs["TelemetryAddValue"]); - sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"].getCall(1), + sinon.assert.calledOnce(requestStubs["TelemetryAddValue"]); + sinon.assert.calledWithExactly(requestStubs["TelemetryAddValue"], "LOOP_ACTIVITY_COUNTER", store._constants.LOOP_MAU_TYPE.ROOM_DELETE);});});}); diff --git a/browser/extensions/loop/chrome/content/preferences/prefs.js b/browser/extensions/loop/chrome/content/preferences/prefs.js index a3402b9ecb9c..2df537d8bf0d 100644 --- a/browser/extensions/loop/chrome/content/preferences/prefs.js +++ b/browser/extensions/loop/chrome/content/preferences/prefs.js @@ -1,7 +1,7 @@ pref("loop.enabled", true); pref("loop.remote.autostart", true); #ifdef LOOP_DEV_XPI -pref("loop.server", "https://loop-dev.stage.mozaws.net/v0"); +pref("loop.server", "https://loop.dev.mozaws.net/v0"); pref("loop.linkClicker.url", "https://loop-webapp-dev.stage.mozaws.net/"); #else pref("loop.server", "https://loop.services.mozilla.com/v0"); @@ -24,7 +24,6 @@ pref("loop.copy.ticket", -1); pref("loop.debug.loglevel", "Error"); pref("loop.debug.dispatcher", false); pref("loop.debug.sdk", false); -pref("loop.debug.twoWayMediaTelemetry", false); pref("loop.feedback.dateLastSeenSec", 0); pref("loop.feedback.periodSec", 15770000); // 6 months. pref("loop.feedback.formURL", "https://www.surveygizmo.com/s3/2651383/Firefox-Hello-Product-Survey-II?version=%APP_VERSION%"); diff --git a/browser/extensions/loop/chrome/content/shared/css/common.css b/browser/extensions/loop/chrome/content/shared/css/common.css index cdaaf155f7eb..ed027101f5bb 100644 --- a/browser/extensions/loop/chrome/content/shared/css/common.css +++ b/browser/extensions/loop/chrome/content/shared/css/common.css @@ -63,10 +63,6 @@ p { display: none !important; } -.visually-hidden { - visibility: hidden; -} - .tc { text-align: center; } @@ -466,13 +462,6 @@ html[dir="rtl"] .dropdown-menu { background-color: #dbf7ff; } -.dropdown-menu-separator { - height: 1px; - margin: 2px -2px 1px -2px; - border-top: 1px solid #dedede; - background-color: #fff; -} - /* Custom checkbox */ .checkbox-wrapper { diff --git a/browser/extensions/loop/chrome/content/shared/js/actions.js b/browser/extensions/loop/chrome/content/shared/js/actions.js index 5c648ac8ea00..b52ffd8107e1 100644 --- a/browser/extensions/loop/chrome/content/shared/js/actions.js +++ b/browser/extensions/loop/chrome/content/shared/js/actions.js @@ -417,24 +417,6 @@ loop.shared.actions = function () { // roomOrigin: String }), - /** - * Share a room url via the Social API. - * XXX: should move to some roomActions module - refs bug 1079284 - * @provider: one of the share-capable Social Providers included - * @roomUrl: the URL that is shared - */ - ShareRoomUrl: Action.define("shareRoomUrl", { - provider: Object, - roomUrl: String }), - - - /** - * Open the share panel to add a Social share provider. - * XXX: should move to some roomActions module - refs bug 1079284 - */ - AddSocialShareProvider: Action.define("addSocialShareProvider", {}), - - /** * XXX: should move to some roomActions module - refs bug 1079284 */ @@ -458,9 +440,8 @@ loop.shared.actions = function () { // roomInfoFailure: String - Optional. // roomName: String - Optional. // roomState: String - Optional. - roomUrl: String - // socialShareProviders: Array - Optional. - }), + roomUrl: String }), + /** * Notifies if the user agent will handle the room or not. @@ -469,14 +450,6 @@ loop.shared.actions = function () { handlesRoom: Boolean }), - /** - * Updates the Social API information when it is received. - * XXX: should move to some roomActions module - refs bug 1079284 - */ - UpdateSocialShareInfo: Action.define("updateSocialShareInfo", { - socialShareProviders: Array }), - - /** * Starts the process for the user to join the room. * XXX: should move to some roomActions module - refs bug 1079284 diff --git a/browser/extensions/loop/chrome/content/shared/js/activeRoomStore.js b/browser/extensions/loop/chrome/content/shared/js/activeRoomStore.js index c636e304a373..f175baf3360e 100644 --- a/browser/extensions/loop/chrome/content/shared/js/activeRoomStore.js +++ b/browser/extensions/loop/chrome/content/shared/js/activeRoomStore.js @@ -55,8 +55,7 @@ loop.store.ActiveRoomStore = function (mozL10n) { roomDescription: "roomDescription", roomInfoFailure: "roomInfoFailure", roomName: "roomName", - roomState: "roomState", - socialShareProviders: "socialShareProviders" }; + roomState: "roomState" }; var updateContextTimer = null; @@ -158,8 +157,6 @@ loop.store.ActiveRoomStore = function (mozL10n) { roomName: null, // True when sharing screen has been paused. streamPaused: false, - // Social API state. - socialShareProviders: null, // True if media has been connected both-ways. mediaConnected: false, // True if a chat message was sent or received during a session. @@ -273,7 +270,6 @@ loop.store.ActiveRoomStore = function (mozL10n) { "startBrowserShare", "endScreenShare", "toggleBrowserSharing", - "updateSocialShareInfo", "connectionStatus", "mediaConnected", "videoScreenStreamChanged"]; @@ -288,13 +284,11 @@ loop.store.ActiveRoomStore = function (mozL10n) { this._onUpdateListener = this._handleRoomUpdate.bind(this); this._onDeleteListener = this._handleRoomDelete.bind(this); - this._onSocialShareUpdate = this._handleSocialShareUpdate.bind(this); var roomToken = this._storeState.roomToken; loop.request("Rooms:PushSubscription", ["delete:" + roomToken, "update:" + roomToken]); loop.subscribe("Rooms:Delete:" + roomToken, this._handleRoomDelete.bind(this)); - loop.subscribe("Rooms:Update:" + roomToken, this._handleRoomUpdate.bind(this)); - loop.subscribe("SocialProvidersChanged", this._onSocialShareUpdate);}, + loop.subscribe("Rooms:Update:" + roomToken, this._handleRoomUpdate.bind(this));}, /** @@ -320,16 +314,12 @@ loop.store.ActiveRoomStore = function (mozL10n) { this._registerPostSetupActions(); // Get the window data from the Loop API. - return loop.requestMulti( - ["Rooms:Get", actionData.roomToken], - ["GetSocialShareProviders"]). - then(function (results) { - var room = results[0]; - var socialShareProviders = results[1]; + return loop.request("Rooms:Get", actionData.roomToken).then(function (result) { + var room = result; - if (room.isError) { + if (result.isError) { this.dispatchAction(new sharedActions.RoomFailure({ - error: room, + error: result, failedJoinRequest: false })); return;} @@ -341,8 +331,7 @@ loop.store.ActiveRoomStore = function (mozL10n) { roomDescription: room.decryptedContext.description, roomName: room.decryptedContext.roomName, roomState: ROOM_STATES.READY, - roomUrl: room.roomUrl, - socialShareProviders: socialShareProviders })); + roomUrl: room.roomUrl })); // For the conversation window, we need to automatically join the room. @@ -548,18 +537,6 @@ loop.store.ActiveRoomStore = function (mozL10n) { - /** - * Handles the updateSocialShareInfo action. Updates the room data with new - * Social API info. - * - * @param {sharedActions.UpdateSocialShareInfo} actionData - */ - updateSocialShareInfo: function updateSocialShareInfo(actionData) { - this.setStoreState({ - socialShareProviders: actionData.socialShareProviders });}, - - - /** * Handles room updates notified by the Loop rooms API. * @@ -585,18 +562,6 @@ loop.store.ActiveRoomStore = function (mozL10n) { - /** - * Handles an update of the position of the Share widget and changes to list - * of Social API providers, notified by the Loop API. - */ - _handleSocialShareUpdate: function _handleSocialShareUpdate() { - loop.request("GetSocialShareProviders").then(function (result) { - this.dispatchAction(new sharedActions.UpdateSocialShareInfo({ - socialShareProviders: result }));}. - - bind(this));}, - - /** * Checks that there are audio and video devices available, and joins the * room if there are. If there aren't then it will dispatch a ConnectionFailure @@ -751,9 +716,6 @@ loop.store.ActiveRoomStore = function (mozL10n) { this._setRefreshTimeout(actionData.expires); - // Only send media telemetry on one side of the call: the desktop side. - actionData.sendTwoWayMediaTelemetry = this._isDesktop; - this._sdkDriver.connectSession(actionData); loop.request("AddConversationContext", this._storeState.windowId, @@ -1161,10 +1123,6 @@ loop.store.ActiveRoomStore = function (mozL10n) { return;} - if (loop.standaloneMedia) { - loop.standaloneMedia.multiplexGum.reset();} - - if (this._browserSharingListener) { // Remove the browser sharing listener as we don't need it now. loop.unsubscribe("BrowserSwitch", this._browserSharingListener); @@ -1263,10 +1221,8 @@ loop.store.ActiveRoomStore = function (mozL10n) { // There's no need to listen to these actions anymore. this.dispatcher.unregister(this, [ "receivedTextChatMessage", - "sendTextChatMessage"]); + "sendTextChatMessage"]);}, - // Ping telemetry of this session with successful message(s) exchange. - loop.request("TelemetryAddValue", "LOOP_ROOM_SESSION_WITHCHAT", 1);}, /** diff --git a/browser/extensions/loop/chrome/content/shared/js/loopapi-client.js b/browser/extensions/loop/chrome/content/shared/js/loopapi-client.js index c0ba8b93ef00..84f6e94296ce 100644 --- a/browser/extensions/loop/chrome/content/shared/js/loopapi-client.js +++ b/browser/extensions/loop/chrome/content/shared/js/loopapi-client.js @@ -78,7 +78,9 @@ var loop = loop || {}; // These functions should only be used in unit tests. - loop.request.inspect = function () {return _.extend({}, gListenersMap);}; + loop.request.inspect = function () { + return _.extend({}, gListenersMap);}; + loop.request.reset = function () { gListeningForMessages = false; gListenersMap = {};}; @@ -187,7 +189,9 @@ var loop = loop || {}; // These functions should only be used in unit tests. - loop.subscribe.inspect = function () {return _.extend({}, gSubscriptionsMap);}; + loop.subscribe.inspect = function () { + return _.extend({}, gSubscriptionsMap);}; + loop.subscribe.reset = function () { gListeningForPushMessages = false; gSubscriptionsMap = {};}; diff --git a/browser/extensions/loop/chrome/content/shared/js/otSdkDriver.js b/browser/extensions/loop/chrome/content/shared/js/otSdkDriver.js index 93cb98353da5..94c75c43c3b6 100644 --- a/browser/extensions/loop/chrome/content/shared/js/otSdkDriver.js +++ b/browser/extensions/loop/chrome/content/shared/js/otSdkDriver.js @@ -45,15 +45,6 @@ loop.OTSdkDriver = function () { "toggleBrowserSharing"]); - // Set loop.debug.twoWayMediaTelemetry to true in the browser - // by changing the hidden pref loop.debug.twoWayMediaTelemetry using - // about:config, or use - // - // localStorage.setItem("debug.twoWayMediaTelemetry", true); - loop.shared.utils.getBoolPreference("debug.twoWayMediaTelemetry", function (enabled) { - this._debugTwoWayMediaTelemetry = enabled;}. - bind(this)); - // Set loop.debug.sdk to true in the browser, or in standalone: // localStorage.setItem("debug.sdk", true); loop.shared.utils.getBoolPreference("debug.sdk", function (enabled) { @@ -260,20 +251,12 @@ loop.OTSdkDriver = function () { * - sessionId: The OT session ID * - apiKey: The OT API key * - sessionToken: The token for the OT session - * - sendTwoWayMediaTelemetry: boolean should we send telemetry on length - * of media sessions. Callers should ensure - * that this is only set for one side of the - * session so that things don't get - * double-counted. * * @param {Object} sessionData The session data for setting up the OT session. */ connectSession: function connectSession(sessionData) { this.session = this.sdk.initSession(sessionData.sessionId); - this._sendTwoWayMediaTelemetry = !!sessionData.sendTwoWayMediaTelemetry; - this._setTwoWayMediaStartTime(this.CONNECTION_START_TIME_UNINITIALIZED); - this.session.on("sessionDisconnected", this._onSessionDisconnected.bind(this)); this.session.on("connectionCreated", this._onConnectionCreated.bind(this)); @@ -324,8 +307,6 @@ loop.OTSdkDriver = function () { // Now reset the metrics as well. this._resetMetrics(); - this._noteConnectionLengthIfNeeded(this._getTwoWayMediaStartTime(), performance.now()); - // Also, tidy these variables ready for next time. delete this._sessionConnected; delete this._publisherReady; @@ -334,8 +315,7 @@ loop.OTSdkDriver = function () { delete this._mockPublisherEl; delete this._publisherChannel; delete this._subscriberChannel; - this.connections = {}; - this._setTwoWayMediaStartTime(this.CONNECTION_START_TIME_UNINITIALIZED);}, + this.connections = {};}, /** @@ -407,8 +387,6 @@ loop.OTSdkDriver = function () { this._notifyMetricsEvent("Session.connectionDestroyed", "peer"); - this._noteConnectionLengthIfNeeded(this._getTwoWayMediaStartTime(), performance.now()); - this.dispatcher.dispatch(new sharedActions.RemotePeerDisconnected({ peerHungup: event.reason === "clientDisconnected" }));}, @@ -435,8 +413,6 @@ loop.OTSdkDriver = function () { return;} - this._noteConnectionLengthIfNeeded(this._getTwoWayMediaStartTime(), - performance.now()); this._notifyMetricsEvent("Session." + event.reason); this.dispatcher.dispatch(new sharedActions.ConnectionFailure({ reason: reason }));}, @@ -526,6 +502,8 @@ loop.OTSdkDriver = function () { break; case "Session.networkDisconnected": case "Session.forceDisconnected": + case "Session.subscribeCompleted": + case "Session.screen.subscribeCompleted": break; default: // We don't want unexpected events being sent to the server, so @@ -646,9 +624,9 @@ loop.OTSdkDriver = function () { srcMediaElement: sdkSubscriberVideo })); + this._notifyMetricsEvent("Session.subscribeCompleted"); this._subscribedRemoteStream = true; if (this._checkAllStreamsConnected()) { - this._setTwoWayMediaStartTime(performance.now()); this.dispatcher.dispatch(new sharedActions.MediaConnected());} @@ -677,9 +655,10 @@ loop.OTSdkDriver = function () { // _handleRemoteScreenShareCreated. Maybe these should be separate // actions. But even so, this shouldn't be necessary.... this.dispatcher.dispatch(new sharedActions.ReceivingScreenShare({ - receiving: true, srcMediaElement: sdkSubscriberVideo }));}, + receiving: true, srcMediaElement: sdkSubscriberVideo })); + this._notifyMetricsEvent("Session.screen.subscribeCompleted");}, /** @@ -873,57 +852,6 @@ loop.OTSdkDriver = function () { - /** - * Implementation detail, may be set to one of the CONNECTION_START_TIME - * constants, or a positive integer in milliseconds. - * - * @private - */ - __twoWayMediaStartTime: undefined, - - /** - * Used as a guard to make sure we don't inadvertently use an - * uninitialized value. - */ - CONNECTION_START_TIME_UNINITIALIZED: -1, - - /** - * Use as a guard to ensure that we don't note any bidirectional sessions - * twice. - */ - CONNECTION_START_TIME_ALREADY_NOTED: -2, - - /** - * Set and get the start time of the two-way media connection. These - * are done as wrapper functions so that we can log sets to make manual - * verification of various telemetry scenarios possible. The get API is - * analogous in order to follow the principle of least surprise for - * people consuming this code. - * - * If this._sendTwoWayMediaTelemetry is not true, returns immediately - * without making any changes, since this data is not used, and it makes - * reading the logs confusing for manual verification of both ends of the - * call in the same browser, which is a case we care about. - * - * @param start start time in milliseconds, as returned by - * performance.now() - * @private - */ - _setTwoWayMediaStartTime: function _setTwoWayMediaStartTime(start) { - if (!this._sendTwoWayMediaTelemetry) { - return;} - - - this.__twoWayMediaStartTime = start; - if (this._debugTwoWayMediaTelemetry) { - console.log("Loop Telemetry: noted two-way connection start, " + - "start time in ms:", start);}}, - - - _getTwoWayMediaStartTime: function _getTwoWayMediaStartTime() { - return this.__twoWayMediaStartTime;}, - - /** * Handles the event when the remote stream is destroyed. * @@ -1050,13 +978,18 @@ loop.OTSdkDriver = function () { * @param {OT.Event} event */ _onOTException: function _onOTException(event) { + var baseException = "sdk.exception."; + if (event.target && event.target === this.screenshare) { + baseException += "screen.";} + + switch (event.code) { case OT.ExceptionCodes.PUBLISHER_ICE_WORKFLOW_FAILED: case OT.ExceptionCodes.SUBSCRIBER_ICE_WORKFLOW_FAILED: this.dispatcher.dispatch(new sharedActions.ConnectionFailure({ reason: FAILURE_DETAILS.ICE_FAILED })); - this._notifyMetricsEvent("sdk.exception." + event.code); + this._notifyMetricsEvent(baseException + event.code); break; case OT.ExceptionCodes.TERMS_OF_SERVICE_FAILURE: this.dispatcher.dispatch(new sharedActions.ConnectionFailure({ @@ -1064,21 +997,17 @@ loop.OTSdkDriver = function () { // We still need to log the exception so that the server knows why this // attempt failed. - this._notifyMetricsEvent("sdk.exception." + event.code); + this._notifyMetricsEvent(baseException + event.code); break; case OT.ExceptionCodes.UNABLE_TO_PUBLISH: // Don't report errors for GetUserMedia events as these are expected if // the user denies the prompt. if (event.message !== "GetUserMedia") { - var baseException = "sdk.exception."; - if (event.target && event.target === this.screenshare) { - baseException += "screen.";} - this._notifyMetricsEvent(baseException + event.code + "." + event.message);} break; default: - this._notifyMetricsEvent("sdk.exception." + event.code); + this._notifyMetricsEvent(baseException + event.code); break;}}, @@ -1150,7 +1079,6 @@ loop.OTSdkDriver = function () { // Now record the fact, and check if we've got all media yet. this._publishedLocalStream = true; if (this._checkAllStreamsConnected()) { - this._setTwoWayMediaStartTime(performance.now()); this.dispatcher.dispatch(new sharedActions.MediaConnected());}}}, @@ -1215,92 +1143,8 @@ loop.OTSdkDriver = function () { * Called when a screenshare stream is published. */ _onScreenShareStreamCreated: function _onScreenShareStreamCreated() { - this._notifyMetricsEvent("Publisher.streamCreated");}, + this._notifyMetricsEvent("Publisher.streamCreated");} }; - /* - * XXX all of the bi-directional media connection telemetry stuff in this - * file, (much, but not all, of it is below) should be hoisted into its - * own object for maintainability and clarity, also in part because this - * stuff only wants to run one side of the connection, not both (tracked - * by bug 1145237). - */ - - /** - * A hook exposed only for the use of the functional tests so that - * they can check that the bi-directional media count is being updated - * correctly. - * - * @type number - * @private - */ - _connectionLengthNotedCalls: 0, - - /** - * Wrapper for adding a keyed value that also updates - * connectionLengthNoted calls and sets the twoWayMediaStartTime to - * this.CONNECTION_START_TIME_ALREADY_NOTED. - * - * @param {number} callLengthSeconds the call length in seconds - * @private - */ - _noteConnectionLength: function _noteConnectionLength(callLengthSeconds) { - var buckets = this._constants.TWO_WAY_MEDIA_CONN_LENGTH; - - var bucket = buckets.SHORTER_THAN_10S; - if (callLengthSeconds >= 10 && callLengthSeconds <= 30) { - bucket = buckets.BETWEEN_10S_AND_30S;} else - if (callLengthSeconds > 30 && callLengthSeconds <= 300) { - bucket = buckets.BETWEEN_30S_AND_5M;} else - if (callLengthSeconds > 300) { - bucket = buckets.MORE_THAN_5M;} - - - loop.request("TelemetryAddValue", "LOOP_TWO_WAY_MEDIA_CONN_LENGTH_1", bucket); - this._setTwoWayMediaStartTime(this.CONNECTION_START_TIME_ALREADY_NOTED); - - this._connectionLengthNotedCalls++; - if (this._debugTwoWayMediaTelemetry) { - console.log("Loop Telemetry: noted two-way media connection " + - "in bucket: ", bucket);}}, - - - - /** - * Note connection length if it's valid (the startTime has been initialized - * and is not later than endTime) and not yet already noted. If - * this._sendTwoWayMediaTelemetry is not true, we return immediately. - * - * @param {number} startTime in milliseconds - * @param {number} endTime in milliseconds - * @private - */ - _noteConnectionLengthIfNeeded: function _noteConnectionLengthIfNeeded(startTime, endTime) { - if (!this._sendTwoWayMediaTelemetry) { - return;} - - - if (startTime === this.CONNECTION_START_TIME_ALREADY_NOTED || - startTime === this.CONNECTION_START_TIME_UNINITIALIZED || - startTime > endTime) { - if (this._debugTwoWayMediaTelemetry) { - console.log("_noteConnectionLengthIfNeeded called with " + - " invalid params, either the calls were never" + - " connected or there is a bug; startTime:", startTime, - "endTime:", endTime);} - - return;} - - - var callLengthSeconds = (endTime - startTime) / 1000; - this._noteConnectionLength(callLengthSeconds);}, - - - /** - * If set to true, make it easy to test/verify 2-way media connection - * telemetry code operation by viewing the logs. - */ - _debugTwoWayMediaTelemetry: false }; - return OTSdkDriver;}(); diff --git a/browser/extensions/loop/chrome/content/shared/js/textChatView.js b/browser/extensions/loop/chrome/content/shared/js/textChatView.js index b285f953cde0..25d039c95497 100644 --- a/browser/extensions/loop/chrome/content/shared/js/textChatView.js +++ b/browser/extensions/loop/chrome/content/shared/js/textChatView.js @@ -217,7 +217,10 @@ loop.shared.views.chat = function (mozL10n) { this.props.messageList.map(function (entry, i) { if (entry.type === CHAT_MESSAGE_TYPES.SPECIAL) { - if (!this.props.showInitialContext) {return null;} + if (!this.props.showInitialContext) { + return null;} + + switch (entry.contentType) { case CHAT_CONTENT_TYPES.CONTEXT: return ( diff --git a/browser/extensions/loop/chrome/content/shared/test/activeRoomStore_test.js b/browser/extensions/loop/chrome/content/shared/test/activeRoomStore_test.js index 93596916a63d..07d41c1918b5 100644 --- a/browser/extensions/loop/chrome/content/shared/test/activeRoomStore_test.js +++ b/browser/extensions/loop/chrome/content/shared/test/activeRoomStore_test.js @@ -13,8 +13,7 @@ describe("loop.store.ActiveRoomStore", function () { var FAILURE_DETAILS = loop.shared.utils.FAILURE_DETAILS; var SCREEN_SHARE_STATES = loop.shared.utils.SCREEN_SHARE_STATES; var ROOM_INFO_FAILURES = loop.shared.utils.ROOM_INFO_FAILURES; - var sandbox, dispatcher, store, requestStubs, fakeSdkDriver, fakeMultiplexGum; - var standaloneMediaRestore; + var sandbox, dispatcher, store, requestStubs, fakeSdkDriver; var clock; beforeEach(function () { @@ -38,7 +37,6 @@ describe("loop.store.ActiveRoomStore", function () { "Rooms:PushSubscription": sinon.stub(), SetScreenShareState: sinon.stub(), GetActiveTabWindowId: sandbox.stub().returns(42), - GetSocialShareProviders: sinon.stub().returns([]), TelemetryAddValue: sinon.stub() }); @@ -56,15 +54,6 @@ describe("loop.store.ActiveRoomStore", function () { endScreenShare: sinon.stub().returns(true) }; - fakeMultiplexGum = { - reset: sandbox.spy() }; - - - standaloneMediaRestore = loop.standaloneMedia; - loop.standaloneMedia = { - multiplexGum: fakeMultiplexGum }; - - store = new loop.store.ActiveRoomStore(dispatcher, { sdkDriver: fakeSdkDriver }); @@ -76,8 +65,7 @@ describe("loop.store.ActiveRoomStore", function () { afterEach(function () { sandbox.restore(); - LoopMochaUtils.restore(); - loop.standaloneMedia = standaloneMediaRestore;}); + LoopMochaUtils.restore();}); describe("#constructor", function () { @@ -182,15 +170,6 @@ describe("loop.store.ActiveRoomStore", function () { expect(store._storeState.failureReason).eql(FAILURE_DETAILS.EXPIRED_OR_INVALID);}); - it("should reset the multiplexGum", function () { - store.roomFailure(new sharedActions.RoomFailure({ - error: fakeError, - failedJoinRequest: false })); - - - sinon.assert.calledOnce(fakeMultiplexGum.reset);}); - - it("should disconnect from the servers via the sdk", function () { store.roomFailure(new sharedActions.RoomFailure({ error: fakeError, @@ -370,8 +349,7 @@ describe("loop.store.ActiveRoomStore", function () { participants: [], roomName: fakeRoomData.decryptedContext.roomName, roomState: ROOM_STATES.READY, - roomUrl: fakeRoomData.roomUrl, - socialShareProviders: [] }));});}); + roomUrl: fakeRoomData.roomUrl }));});}); @@ -806,28 +784,6 @@ describe("loop.store.ActiveRoomStore", function () { - describe("#updateSocialShareInfo", function () { - var fakeSocialShareInfo; - - beforeEach(function () { - fakeSocialShareInfo = { - socialShareProviders: [{ - name: "foo", - origin: "https://example.com", - iconURL: "icon.png" }] };}); - - - - - it("should save the Social API information", function () { - store.updateSocialShareInfo(new sharedActions.UpdateSocialShareInfo(fakeSocialShareInfo)); - - var state = store.getStoreState(); - expect(state.socialShareProviders). - eql(fakeSocialShareInfo.socialShareProviders);});}); - - - describe("#joinRoom", function () { var hasDevicesStub; @@ -1128,28 +1084,6 @@ describe("loop.store.ActiveRoomStore", function () { actionData);}); - it("should pass 'sendTwoWayMediaTelemetry' as true to connectSession if " + - "store._isDesktop is true", function () { - store._isDesktop = true; - - store.joinedRoom(new sharedActions.JoinedRoom(fakeJoinedData)); - - sinon.assert.calledOnce(fakeSdkDriver.connectSession); - sinon.assert.calledWithMatch(fakeSdkDriver.connectSession, - sinon.match.has("sendTwoWayMediaTelemetry", true));}); - - - it("should pass 'sendTwoWayTelemetry' as false to connectionSession if " + - "store._isDesktop is false", function () { - store._isDesktop = false; - - store.joinedRoom(new sharedActions.JoinedRoom(fakeJoinedData)); - - sinon.assert.calledOnce(fakeSdkDriver.connectSession); - sinon.assert.calledWithMatch(fakeSdkDriver.connectSession, - sinon.match.has("sendTwoWayMediaTelemetry", false));}); - - it("should call LoopAPI.AddConversationContext", function () { var actionData = new sharedActions.JoinedRoom(fakeJoinedData); @@ -1245,12 +1179,6 @@ describe("loop.store.ActiveRoomStore", function () { expect(store.getStoreState().failureReason).eql("FAIL");}); - it("should reset the multiplexGum", function () { - store.connectionFailure(connectionFailureAction); - - sinon.assert.calledOnce(fakeMultiplexGum.reset);}); - - it("should disconnect from the servers via the sdk", function () { store.connectionFailure(connectionFailureAction); @@ -1312,7 +1240,6 @@ describe("loop.store.ActiveRoomStore", function () { store.connectionFailure(connectionFailureAction); - sinon.assert.notCalled(fakeMultiplexGum.reset); sinon.assert.notCalled(fakeSdkDriver.disconnectSession);});}); @@ -1958,12 +1885,6 @@ describe("loop.store.ActiveRoomStore", function () { sinon.assert.calledWithExactly(requestStubs.SetScreenShareState, "1234", false);}); - it("should reset the multiplexGum", function () { - store.windowUnload(); - - sinon.assert.calledOnce(fakeMultiplexGum.reset);}); - - it("should disconnect from the servers via the sdk", function () { store.windowUnload(); @@ -2027,12 +1948,6 @@ describe("loop.store.ActiveRoomStore", function () { - it("should reset the multiplexGum", function () { - store.leaveRoom(); - - sinon.assert.calledOnce(fakeMultiplexGum.reset);}); - - it("should disconnect from the servers via the sdk", function () { store.leaveRoom(); @@ -2129,24 +2044,6 @@ describe("loop.store.ActiveRoomStore", function () { - describe("#_handleSocialShareUpdate", function () { - it("should dispatch an UpdateRoomInfo action", function () { - store._handleSocialShareUpdate(); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.UpdateSocialShareInfo({ - socialShareProviders: [] }));}); - - - - it("should call respective mozLoop methods", function () { - store._handleSocialShareUpdate(); - - sinon.assert.calledOnce(requestStubs.GetSocialShareProviders);});}); - - - describe("#_handleTextChatMessage", function () { beforeEach(function () { var fakeRoomData = { @@ -2204,22 +2101,7 @@ describe("loop.store.ActiveRoomStore", function () { sentTimestamp: "1970-01-01T00:00:00.000Z" })); - assertWeDidNothing();}); - - - it("should ping telemetry when a chat message arrived or is to be sent", function () { - store._handleTextChatMessage(new sharedActions.ReceivedTextChatMessage({ - contentType: CHAT_CONTENT_TYPES.TEXT, - message: "Hello!", - receivedTimestamp: "1970-01-01T00:00:00.000Z" })); - - - sinon.assert.calledOnce(requestStubs.TelemetryAddValue); - sinon.assert.calledWithExactly(requestStubs.TelemetryAddValue, - "LOOP_ROOM_SESSION_WITHCHAT", 1); - expect(store.getStoreState().chatMessageExchanged).eql(true); - expect(dispatcher._eventData.hasOwnProperty("receivedTextChatMessage")).eql(false); - expect(dispatcher._eventData.hasOwnProperty("sendTextChatMessage")).eql(false);});}); + assertWeDidNothing();});}); diff --git a/browser/extensions/loop/chrome/content/shared/test/otSdkDriver_test.js b/browser/extensions/loop/chrome/content/shared/test/otSdkDriver_test.js index 9dc5475b1a5a..bbc620334982 100644 --- a/browser/extensions/loop/chrome/content/shared/test/otSdkDriver_test.js +++ b/browser/extensions/loop/chrome/content/shared/test/otSdkDriver_test.js @@ -13,7 +13,7 @@ describe("loop.OTSdkDriver", function () { var CURSOR_MESSAGE_TYPES = loop.shared.utils.CURSOR_MESSAGE_TYPES; var sandbox, constants; - var dispatcher, driver, requestStubs, publisher, screenshare, sdk, session; + var dispatcher, driver, publisher, screenshare, sdk, session; var sessionData, subscriber, publisherConfig, fakeEvent; beforeEach(function () { @@ -31,11 +31,6 @@ describe("loop.OTSdkDriver", function () { sessionToken: "1357924680" }; - LoopMochaUtils.stubLoopRequest(requestStubs = { - TelemetryAddValue: sinon.stub(), - GetLoopPref: sinon.stub() }); - - dispatcher = new loop.Dispatcher(); sandbox.stub(dispatcher, "dispatch"); @@ -84,12 +79,6 @@ describe("loop.OTSdkDriver", function () { constants = { - TWO_WAY_MEDIA_CONN_LENGTH: { - SHORTER_THAN_10S: 0, - BETWEEN_10S_AND_30S: 1, - BETWEEN_30S_AND_5M: 2, - MORE_THAN_5M: 3 }, - SHARING_STATE_CHANGE: { WINDOW_ENABLED: 0, WINDOW_DISABLED: 1, @@ -144,23 +133,6 @@ describe("loop.OTSdkDriver", function () { - it("should enable debug for two way media telemetry if required", function () { - // Simulate the pref being enabled. - sandbox.stub(loop.shared.utils, "getBoolPreference", function (prefName, callback) { - if (prefName === "debug.twoWayMediaTelemetry") { - callback(true);}}); - - - - driver = new loop.OTSdkDriver({ - constants: constants, - dispatcher: dispatcher, - sdk: sdk }); - - - expect(driver._debugTwoWayMediaTelemetry).eql(true);}); - - it("should enable debug on the sdk if required", function () { // Simulate the pref being enabled. sandbox.stub(loop.shared.utils, "getBoolPreference", function (prefName, callback) { @@ -446,15 +418,6 @@ describe("loop.OTSdkDriver", function () { sinon.assert.calledWith(session.connect, "1234567890", "1357924680");}); - it("should set the two-way media start time to 'uninitialized' " + - "when sessionData.sendTwoWayMediaTelemetry is true'", function () { - driver.connectSession(_.extend(sessionData, - { sendTwoWayMediaTelemetry: true })); - - expect(driver._getTwoWayMediaStartTime()).to.eql( - driver.CONNECTION_START_TIME_UNINITIALIZED);}); - - describe("On connection complete", function () { beforeEach(function () { sandbox.stub(window.console, "error");}); @@ -637,109 +600,7 @@ describe("loop.OTSdkDriver", function () { driver.disconnectSession(); - sinon.assert.calledOnce(publisher.destroy);}); - - - it("should call _noteConnectionLengthIfNeeded with connection duration", function () { - driver.session = session; - var startTime = 1; - var endTime = 3; - driver._sendTwoWayMediaTelemetry = true; - driver._setTwoWayMediaStartTime(startTime); - sandbox.stub(performance, "now").returns(endTime); - sandbox.stub(driver, "_noteConnectionLengthIfNeeded"); - - driver.disconnectSession(); - - sinon.assert.calledWith(driver._noteConnectionLengthIfNeeded, startTime, - endTime);}); - - - it("should reset the two-way media connection start time", function () { - driver.session = session; - var startTime = 1; - driver._sendTwoWayMediaTelemetry = true; - driver._setTwoWayMediaStartTime(startTime); - sandbox.stub(performance, "now"); - sandbox.stub(driver, "_noteConnectionLengthIfNeeded"); - - driver.disconnectSession(); - - expect(driver._getTwoWayMediaStartTime()).to.eql( - driver.CONNECTION_START_TIME_UNINITIALIZED);});}); - - - - describe("#_noteConnectionLengthIfNeeded", function () { - var startTimeMS; - beforeEach(function () { - startTimeMS = 1; - driver._sendTwoWayMediaTelemetry = true; - driver._setTwoWayMediaStartTime(startTimeMS);}); - - - it("should set two-way media start time to CONNECTION_START_TIME_ALREADY_NOTED", function () { - var endTimeMS = 3; - driver._noteConnectionLengthIfNeeded(startTimeMS, endTimeMS); - - expect(driver._getTwoWayMediaStartTime()).to.eql( - driver.CONNECTION_START_TIME_ALREADY_NOTED);}); - - - it("should record telemetry with SHORTER_THAN_10S for calls less than 10s", function () { - var endTimeMS = 9000; - - driver._noteConnectionLengthIfNeeded(startTimeMS, endTimeMS); - - sinon.assert.calledOnce(requestStubs.TelemetryAddValue); - sinon.assert.calledWith(requestStubs.TelemetryAddValue, - "LOOP_TWO_WAY_MEDIA_CONN_LENGTH_1", - constants.TWO_WAY_MEDIA_CONN_LENGTH.SHORTER_THAN_10S);}); - - - it("should call record telemetry with BETWEEN_10S_AND_30S for 15s calls", - function () { - var endTimeMS = 15000; - - driver._noteConnectionLengthIfNeeded(startTimeMS, endTimeMS); - - sinon.assert.calledOnce(requestStubs.TelemetryAddValue); - sinon.assert.calledWith(requestStubs.TelemetryAddValue, - "LOOP_TWO_WAY_MEDIA_CONN_LENGTH_1", - constants.TWO_WAY_MEDIA_CONN_LENGTH.BETWEEN_10S_AND_30S);}); - - - it("should call record telemetry with BETWEEN_30S_AND_5M for 60s calls", - function () { - var endTimeMS = 60 * 1000; - - driver._noteConnectionLengthIfNeeded(startTimeMS, endTimeMS); - - sinon.assert.calledOnce(requestStubs.TelemetryAddValue); - sinon.assert.calledWith(requestStubs.TelemetryAddValue, - "LOOP_TWO_WAY_MEDIA_CONN_LENGTH_1", - constants.TWO_WAY_MEDIA_CONN_LENGTH.BETWEEN_30S_AND_5M);}); - - - it("should call record telemetry with MORE_THAN_5M for 10m calls", function () { - var endTimeMS = 10 * 60 * 1000; - - driver._noteConnectionLengthIfNeeded(startTimeMS, endTimeMS); - - sinon.assert.calledOnce(requestStubs.TelemetryAddValue); - sinon.assert.calledWith(requestStubs.TelemetryAddValue, - "LOOP_TWO_WAY_MEDIA_CONN_LENGTH_1", - constants.TWO_WAY_MEDIA_CONN_LENGTH.MORE_THAN_5M);}); - - - it("should not call record telemetry if driver._sendTwoWayMediaTelemetry is false", - function () { - var endTimeMS = 10 * 60 * 1000; - driver._sendTwoWayMediaTelemetry = false; - - driver._noteConnectionLengthIfNeeded(startTimeMS, endTimeMS); - - sinon.assert.notCalled(requestStubs.TelemetryAddValue);});}); + sinon.assert.calledOnce(publisher.destroy);});}); @@ -919,27 +780,10 @@ describe("loop.OTSdkDriver", function () { state: "waiting", connections: 0, sendStreams: 0, - recvStreams: 0 }));}); + recvStreams: 0 }));});}); - it("should call _noteConnectionLengthIfNeeded with connection duration", function () { - driver.session = session; - var startTime = 1; - var endTime = 3; - driver._sendTwoWayMediaTelemetry = true; - driver._setTwoWayMediaStartTime(startTime); - sandbox.stub(performance, "now").returns(endTime); - sandbox.stub(driver, "_noteConnectionLengthIfNeeded"); - - session.trigger("connectionDestroyed", { - reason: "clientDisconnected" }); - - - sinon.assert.calledWith(driver._noteConnectionLengthIfNeeded, startTime, - endTime);});}); - - describe("sessionDisconnected", function () { it("should notify metrics", function () { @@ -981,25 +825,7 @@ describe("loop.OTSdkDriver", function () { sinon.assert.calledWithMatch(dispatcher.dispatch, sinon.match.hasOwn("name", "connectionFailure")); sinon.assert.calledWithMatch(dispatcher.dispatch, - sinon.match.hasOwn("reason", FAILURE_DETAILS.EXPIRED_OR_INVALID));}); - - - it("should call _noteConnectionLengthIfNeeded with connection duration", function () { - driver.session = session; - var startTime = 1; - var endTime = 3; - driver._sendTwoWayMediaTelemetry = true; - driver._setTwoWayMediaStartTime(startTime); - sandbox.stub(performance, "now").returns(endTime); - sandbox.stub(driver, "_noteConnectionLengthIfNeeded"); - - session.trigger("sessionDisconnected", { - reason: "networkDisconnected" }); - - - sinon.assert.calledWith(driver._noteConnectionLengthIfNeeded, startTime, - endTime);});}); - + sinon.match.hasOwn("reason", FAILURE_DETAILS.EXPIRED_OR_INVALID));});}); @@ -1166,29 +992,23 @@ describe("loop.OTSdkDriver", function () { new sharedActions.MediaConnected({}));}); - it("should store the start time when both streams are up and" + - " driver._sendTwoWayMediaTelemetry is true", function () { - driver._sendTwoWayMediaTelemetry = true; + it("should dispatch a connectionStatus action if both streams are up", function () { driver._publishedLocalStream = true; - var startTime = 1; - sandbox.stub(performance, "now").returns(startTime); session.trigger("streamCreated", { stream: fakeStream }); - expect(driver._getTwoWayMediaStartTime()).to.eql(startTime);}); + // Called twice due to the VideoDimensionsChanged above. + sinon.assert.called(dispatcher.dispatch); + sinon.assert.calledWithMatch(dispatcher.dispatch, + new sharedActions.ConnectionStatus({ + event: "Session.subscribeCompleted", + state: "receiving", + // Local stream connection is faked, so connections/sendStreams=0. + connections: 0, + sendStreams: 0, + recvStreams: 1 }));}); - it("should not store the start time when both streams are up and" + - " driver._isDesktop is false", function () { - driver._isDesktop = false; - driver._publishedLocalStream = true; - var startTime = 73; - sandbox.stub(performance, "now").returns(startTime); - - session.trigger("streamCreated", { stream: fakeStream }); - - expect(driver._getTwoWayMediaStartTime()).to.not.eql(startTime);}); - describe("Data channel setup", function () { var fakeChannel; @@ -1365,7 +1185,45 @@ describe("loop.OTSdkDriver", function () { // Called twice due to the VideoDimensionsChanged above. sinon.assert.called(dispatcher.dispatch); sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.ReceivingScreenShare({ receiving: true }));});});}); + new sharedActions.ReceivingScreenShare({ receiving: true }));}); + + + describe("screen share subscribe completed", function () { + beforeEach(function () { + fakeStream.videoType = "screen"; + + session.subscribe.yieldsOn(driver, null, fakeSubscriberObject, + videoElement).returns(this.fakeSubscriberObject);}); + + + it("should dispatch ReceivingScreenShare on completion", function () { + fakeStream.connection = fakeConnection; + fakeStream.hasVideo = false; + + session.trigger("streamCreated", { stream: fakeStream }); + + sinon.assert.called(dispatcher.dispatch); + sinon.assert.calledWithExactly(dispatcher.dispatch, + new sharedActions.ReceivingScreenShare({ + receiving: true, + srcMediaElement: videoElement }));}); + + + + it("should dispatch a connectionStatus action", function () { + session.trigger("streamCreated", { stream: fakeStream }); + + // Called twice due to the VideoDimensionsChanged above. + sinon.assert.called(dispatcher.dispatch); + sinon.assert.calledWithMatch(dispatcher.dispatch, + new sharedActions.ConnectionStatus({ + event: "Session.screen.subscribeCompleted", + state: "receiving", + connections: 0, + sendStreams: 0, + recvStreams: 1 }));});});});}); + + diff --git a/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.css b/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.css index 3b82ae915c17..759a6c8c47e4 100644 --- a/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.css +++ b/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.css @@ -261,6 +261,15 @@ body { #mocha-stats .progress { float: right; padding-top: 0; + + /** + * Set safe initial values, so mochas .progress does not inherit these + * properties from Bootstrap .progress (which causes .progress height to + * equal line height set in Bootstrap). + */ + height: auto; + box-shadow: none; + background-color: initial; } #mocha-stats em { diff --git a/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.js b/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.js index 19561978ebe1..af90adac662c 100644 --- a/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.js +++ b/browser/extensions/loop/chrome/content/shared/test/vendor/mocha.js @@ -1,11 +1,174 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;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 require=="function"&&require;for(var o=0;o‣'; + var el = fragment(markup, test.speed, test.title, test.duration, url); + self.addCodeToggle(el, test.body); + appendToStack(el); + updateStats(); }); - runner.on('test end', function(test) { + runner.on('fail', function(test) { + var el = fragment('
  • %e

  • ', + test.title, self.testURL(test)); + var stackString; // Note: Includes leading newline + var message = test.err.toString(); + + // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we + // check for the result of the stringifying. + if (message === '[object Error]') { + message = test.err.message; + } + + if (test.err.stack) { + var indexOfMessage = test.err.stack.indexOf(test.err.message); + if (indexOfMessage === -1) { + stackString = test.err.stack; + } else { + stackString = test.err.stack.substr(test.err.message.length + indexOfMessage); + } + } else if (test.err.sourceURL && test.err.line !== undefined) { + // Safari doesn't give you a stack. Let's at least provide a source line. + stackString = '\n(' + test.err.sourceURL + ':' + test.err.line + ')'; + } + + stackString = stackString || ''; + + if (test.err.htmlMessage && stackString) { + el.appendChild(fragment('
    %s\n
    %e
    ', + test.err.htmlMessage, stackString)); + } else if (test.err.htmlMessage) { + el.appendChild(fragment('
    %s
    ', test.err.htmlMessage)); + } else { + el.appendChild(fragment('
    %e%e
    ', message, stackString)); + } + + self.addCodeToggle(el, test.body); + appendToStack(el); + updateStats(); + }); + + runner.on('pending', function(test) { + var el = fragment('
  • %e

  • ', test.title); + appendToStack(el); + updateStats(); + }); + + function appendToStack(el) { + // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. + if (stack[0]) { + stack[0].appendChild(el); + } + } + + function updateStats() { // TODO: add to stats var percent = stats.tests / this.total * 100 | 0; if (progress) { @@ -2464,67 +2684,7 @@ function HTML(runner) { text(passes, stats.passes); text(failures, stats.failures); text(duration, (ms / 1000).toFixed(2)); - - // test - var el; - if (test.state === 'passed') { - var url = self.testURL(test); - el = fragment('
  • %e%ems

  • ', test.speed, test.title, test.duration, url); - } else if (test.pending) { - el = fragment('
  • %e

  • ', test.title); - } else { - el = fragment('
  • %e

  • ', test.title, self.testURL(test)); - var stackString; // Note: Includes leading newline - var message = test.err.toString(); - - // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we - // check for the result of the stringifying. - if (message === '[object Error]') { - message = test.err.message; - } - - if (test.err.stack) { - var indexOfMessage = test.err.stack.indexOf(test.err.message); - if (indexOfMessage === -1) { - stackString = test.err.stack; - } else { - stackString = test.err.stack.substr(test.err.message.length + indexOfMessage); - } - } else if (test.err.sourceURL && test.err.line !== undefined) { - // Safari doesn't give you a stack. Let's at least provide a source line. - stackString = '\n(' + test.err.sourceURL + ':' + test.err.line + ')'; - } - - stackString = stackString || ''; - - if (test.err.htmlMessage && stackString) { - el.appendChild(fragment('
    %s\n
    %e
    ', test.err.htmlMessage, stackString)); - } else if (test.err.htmlMessage) { - el.appendChild(fragment('
    %s
    ', test.err.htmlMessage)); - } else { - el.appendChild(fragment('
    %e%e
    ', message, stackString)); - } - } - - // toggle code - // TODO: defer - if (!test.pending) { - var h2 = el.getElementsByTagName('h2')[0]; - - on(h2, 'click', function() { - pre.style.display = pre.style.display === 'none' ? 'block' : 'none'; - }); - - var pre = fragment('
    %e
    ', utils.clean(test.body)); - el.appendChild(pre); - pre.style.display = 'none'; - } - - // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack. - if (stack[0]) { - stack[0].appendChild(el); - } - }); + } } /** @@ -2562,6 +2722,24 @@ HTML.prototype.testURL = function(test) { return makeUrl(test.fullTitle()); }; +/** + * Adds code toggle functionality for the provided test's list element. + * + * @param {HTMLLIElement} el + * @param {string} contents + */ +HTML.prototype.addCodeToggle = function(el, contents) { + var h2 = el.getElementsByTagName('h2')[0]; + + on(h2, 'click', function() { + pre.style.display = pre.style.display === 'none' ? 'block' : 'none'; + }); + + var pre = fragment('
    %e
    ', utils.clean(contents)); + el.appendChild(pre); + pre.style.display = 'none'; +}; + /** * Display error `msg`. * @@ -2644,7 +2822,7 @@ function on(el, event, fn) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../browser/progress":4,"../utils":39,"./base":17,"escape-string-regexp":68}],22:[function(require,module,exports){ +},{"../browser/progress":4,"../utils":39,"./base":17,"escape-string-regexp":49}],22:[function(require,module,exports){ // Alias exports to a their normalized format Mocha#reporter to prevent a need // for dynamic (try/catch) requires, which Browserify doesn't handle. exports.Base = exports.base = require('./base'); @@ -2820,7 +2998,7 @@ function clean(test) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./base":17,"_process":51}],24:[function(require,module,exports){ +},{"./base":17,"_process":58}],24:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -2884,7 +3062,7 @@ function clean(test) { } }).call(this,require('_process')) -},{"./base":17,"_process":51}],25:[function(require,module,exports){ +},{"./base":17,"_process":58}],25:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -2978,7 +3156,7 @@ function errorJSON(err) { } }).call(this,require('_process')) -},{"./base":17,"_process":51}],26:[function(require,module,exports){ +},{"./base":17,"_process":58}],26:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -3074,7 +3252,7 @@ function Landing(runner) { inherits(Landing, Base); }).call(this,require('_process')) -},{"../utils":39,"./base":17,"_process":51}],27:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58}],27:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -3139,7 +3317,7 @@ function List(runner) { inherits(List, Base); }).call(this,require('_process')) -},{"../utils":39,"./base":17,"_process":51}],28:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58}],28:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -3240,7 +3418,7 @@ function Markdown(runner) { } }).call(this,require('_process')) -},{"../utils":39,"./base":17,"_process":51}],29:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58}],29:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -3280,7 +3458,7 @@ function Min(runner) { inherits(Min, Base); }).call(this,require('_process')) -},{"../utils":39,"./base":17,"_process":51}],30:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58}],30:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -3545,7 +3723,7 @@ function write(string) { } }).call(this,require('_process')) -},{"../utils":39,"./base":17,"_process":51}],31:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58}],31:[function(require,module,exports){ (function (process){ /** * Module dependencies. @@ -3638,7 +3816,7 @@ function Progress(runner, options) { inherits(Progress, Base); }).call(this,require('_process')) -},{"../utils":39,"./base":17,"_process":51}],32:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58}],32:[function(require,module,exports){ /** * Module dependencies. */ @@ -3927,8 +4105,8 @@ XUnit.prototype.test = function(test) { if (test.state === 'failed') { var err = test.err; - this.write(tag('testcase', attrs, false, tag('failure', {}, false, cdata(escape(err.message) + '\n' + err.stack)))); - } else if (test.pending) { + this.write(tag('testcase', attrs, false, tag('failure', {}, false, escape(err.message) + '\n' + escape(err.stack)))); + } else if (test.isPending()) { this.write(tag('testcase', attrs, false, tag('skipped', {}, true))); } else { this.write(tag('testcase', attrs, true)); @@ -3962,16 +4140,8 @@ function tag(name, attrs, close, content) { return tag; } -/** - * Return cdata escaped CDATA `str`. - */ - -function cdata(str) { - return ''; -} - }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../utils":39,"./base":17,"_process":51,"fs":41,"mkdirp":70,"path":41}],35:[function(require,module,exports){ +},{"../utils":39,"./base":17,"_process":58,"fs":43,"mkdirp":55,"path":43}],35:[function(require,module,exports){ (function (global){ /** * Module dependencies. @@ -4020,6 +4190,7 @@ module.exports = Runnable; function Runnable(title, fn) { this.title = title; this.fn = fn; + this.body = (fn || '').toString(); this.async = fn && fn.length; this.sync = !this.async; this._timeout = 2000; @@ -4029,6 +4200,7 @@ function Runnable(title, fn) { this._trace = new Error('done() called multiple times'); this._retries = -1; this._currentRetry = 0; + this.pending = false; } /** @@ -4099,12 +4271,21 @@ Runnable.prototype.enableTimeouts = function(enabled) { /** * Halt and mark as pending. * - * @api private + * @api public */ Runnable.prototype.skip = function() { throw new Pending(); }; +/** + * Check if this runnable or its parent suite is marked as pending. + * + * @api private + */ +Runnable.prototype.isPending = function() { + return this.pending || (this.parent && this.parent.isPending()); +}; + /** * Set number of retries. * @@ -4277,7 +4458,7 @@ Runnable.prototype.run = function(fn) { // sync or promise-returning try { - if (this.pending) { + if (this.isPending()) { done(); } else { callFn(this.fn); @@ -4838,12 +5019,7 @@ Runner.prototype.runTests = function(suite, fn) { return; } - function parentPending(suite) { - return suite.pending || (suite.parent && parentPending(suite.parent)); - } - - // pending - if (test.pending || parentPending(test.parent)) { + if (test.isPending()) { self.emit('pending', test); self.emit('test end', test); return next(); @@ -4852,7 +5028,7 @@ Runner.prototype.runTests = function(suite, fn) { // execute test and hook(s) self.emit('test', self.test = test); self.hookDown('beforeEach', function(err, errSuite) { - if (suite.pending) { + if (suite.isPending()) { self.emit('pending', test); self.emit('test end', test); return next(); @@ -5230,7 +5406,7 @@ function extraGlobals() { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./pending":16,"./runnable":35,"./utils":39,"_process":51,"debug":2,"events":3}],37:[function(require,module,exports){ +},{"./pending":16,"./runnable":35,"./utils":39,"_process":58,"debug":2,"events":3}],37:[function(require,module,exports){ /** * Module dependencies. */ @@ -5261,9 +5437,6 @@ exports = module.exports = Suite; exports.create = function(parent, title) { var suite = new Suite(title, parent.ctx); suite.parent = parent; - if (parent.pending) { - suite.pending = true; - } title = suite.fullTitle(); parent.addSuite(suite); return suite; @@ -5409,6 +5582,15 @@ Suite.prototype.bail = function(bail) { return this; }; +/** + * Check if this suite or its parent suite is marked as pending. + * + * @api private + */ +Suite.prototype.isPending = function() { + return this.pending || (this.parent && this.parent.isPending()); +}; + /** * Run `fn(test[, done])` before running tests. * @@ -5418,7 +5600,7 @@ Suite.prototype.bail = function(bail) { * @return {Suite} for chaining */ Suite.prototype.beforeAll = function(title, fn) { - if (this.pending) { + if (this.isPending()) { return this; } if (typeof title === 'function') { @@ -5448,7 +5630,7 @@ Suite.prototype.beforeAll = function(title, fn) { * @return {Suite} for chaining */ Suite.prototype.afterAll = function(title, fn) { - if (this.pending) { + if (this.isPending()) { return this; } if (typeof title === 'function') { @@ -5478,7 +5660,7 @@ Suite.prototype.afterAll = function(title, fn) { * @return {Suite} for chaining */ Suite.prototype.beforeEach = function(title, fn) { - if (this.pending) { + if (this.isPending()) { return this; } if (typeof title === 'function') { @@ -5508,7 +5690,7 @@ Suite.prototype.beforeEach = function(title, fn) { * @return {Suite} for chaining */ Suite.prototype.afterEach = function(title, fn) { - if (this.pending) { + if (this.isPending()) { return this; } if (typeof title === 'function') { @@ -5646,7 +5828,6 @@ function Test(title, fn) { Runnable.call(this, title, fn); this.pending = !fn; this.type = 'test'; - this.body = (fn || '').toString(); } /** @@ -5684,6 +5865,7 @@ var join = require('path').join; var readdirSync = require('fs').readdirSync; var statSync = require('fs').statSync; var watchFile = require('fs').watchFile; +var toISOString = require('to-iso-string'); /** * Ignored directories. @@ -6126,7 +6308,7 @@ function jsonStringify(object, spaces, depth) { var space = spaces * depth; var str = isArray(object) ? '[' : '{'; var end = isArray(object) ? ']' : '}'; - var length = object.length || exports.keys(object).length; + var length = typeof object.length === 'number' ? object.length : exports.keys(object).length; // `.repeat()` polyfill function repeat(s, n) { return new Array(n).join(s); @@ -6144,15 +6326,19 @@ function jsonStringify(object, spaces, depth) { break; case 'boolean': case 'regexp': + case 'symbol': case 'number': val = val === 0 && (1 / val) === -Infinity // `-0` ? '-0' : val.toString(); break; case 'date': - var sDate = isNaN(val.getTime()) // Invalid date - ? val.toString() - : val.toISOString(); + var sDate; + if (isNaN(val.getTime())) { // Invalid date + sDate = val.toString(); + } else { + sDate = val.toISOString ? val.toISOString() : toISOString(val); + } val = '[Date: ' + sDate + ']'; break; case 'buffer': @@ -6170,7 +6356,7 @@ function jsonStringify(object, spaces, depth) { } for (var i in object) { - if (!object.hasOwnProperty(i)) { + if (!Object.prototype.hasOwnProperty.call(object, i)) { continue; // not my business } --length; @@ -6269,6 +6455,7 @@ exports.canonicalize = function(value, stack) { case 'number': case 'regexp': case 'boolean': + case 'symbol': canonicalizedObj = value; break; default: @@ -6403,7 +6590,11 @@ exports.stackTraceFilter = function() { } // Clean up cwd(absolute) - list.push(line.replace(cwd, '')); + if (/\(?.+:\d+:\d+\)?$/.test(line)) { + line = line.replace(cwd, ''); + } + + list.push(line); return list; }, []); @@ -6412,7 +6603,120 @@ exports.stackTraceFilter = function() { }; }).call(this,require('_process'),require("buffer").Buffer) -},{"_process":51,"buffer":43,"debug":2,"fs":41,"glob":41,"path":41,"util":66}],40:[function(require,module,exports){ +},{"_process":58,"buffer":45,"debug":2,"fs":43,"glob":43,"path":43,"to-iso-string":72,"util":75}],40:[function(require,module,exports){ +'use strict' + +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +function init () { + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i + } + + revLookup['-'.charCodeAt(0)] = 62 + revLookup['_'.charCodeAt(0)] = 63 +} + +init() + +function toByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(len * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] + arr[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') +} + +},{}],41:[function(require,module,exports){ + +},{}],42:[function(require,module,exports){ (function (process){ var WritableStream = require('stream').Writable var inherits = require('util').inherits @@ -6441,28 +6745,139 @@ BrowserStdout.prototype._write = function(chunks, encoding, cb) { } }).call(this,require('_process')) -},{"_process":51,"stream":63,"util":66}],41:[function(require,module,exports){ - -},{}],42:[function(require,module,exports){ +},{"_process":58,"stream":59,"util":75}],43:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"dup":41}],43:[function(require,module,exports){ +},{"dup":41}],44:[function(require,module,exports){ +(function (global){ +'use strict'; + +var buffer = require('buffer'); +var Buffer = buffer.Buffer; +var SlowBuffer = buffer.SlowBuffer; +var MAX_LEN = buffer.kMaxLength || 2147483647; +exports.alloc = function alloc(size, fill, encoding) { + if (typeof Buffer.alloc === 'function') { + return Buffer.alloc(size, fill, encoding); + } + if (typeof encoding === 'number') { + throw new TypeError('encoding must not be number'); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size > MAX_LEN) { + throw new RangeError('size is too large'); + } + var enc = encoding; + var _fill = fill; + if (_fill === undefined) { + enc = undefined; + _fill = 0; + } + var buf = new Buffer(size); + if (typeof _fill === 'string') { + var fillBuf = new Buffer(_fill, enc); + var flen = fillBuf.length; + var i = -1; + while (++i < size) { + buf[i] = fillBuf[i % flen]; + } + } else { + buf.fill(_fill); + } + return buf; +} +exports.allocUnsafe = function allocUnsafe(size) { + if (typeof Buffer.allocUnsafe === 'function') { + return Buffer.allocUnsafe(size); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size > MAX_LEN) { + throw new RangeError('size is too large'); + } + return new Buffer(size); +} +exports.from = function from(value, encodingOrOffset, length) { + if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) { + return Buffer.from(value, encodingOrOffset, length); + } + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number'); + } + if (typeof value === 'string') { + return new Buffer(value, encodingOrOffset); + } + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + var offset = encodingOrOffset; + if (arguments.length === 1) { + return new Buffer(value); + } + if (typeof offset === 'undefined') { + offset = 0; + } + var len = length; + if (typeof len === 'undefined') { + len = value.byteLength - offset; + } + if (offset >= value.byteLength) { + throw new RangeError('\'offset\' is out of bounds'); + } + if (len > value.byteLength - offset) { + throw new RangeError('\'length\' is out of bounds'); + } + return new Buffer(value.slice(offset, offset + len)); + } + if (Buffer.isBuffer(value)) { + var out = new Buffer(value.length); + value.copy(out, 0, 0, value.length); + return out; + } + if (value) { + if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) { + return new Buffer(value); + } + if (value.type === 'Buffer' && Array.isArray(value.data)) { + return new Buffer(value.data); + } + } + + throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.'); +} +exports.allocUnsafeSlow = function allocUnsafeSlow(size) { + if (typeof Buffer.allocUnsafeSlow === 'function') { + return Buffer.allocUnsafeSlow(size); + } + if (typeof size !== 'number') { + throw new TypeError('size must be a number'); + } + if (size >= MAX_LEN) { + throw new RangeError('size is too large'); + } + return new SlowBuffer(size); +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"buffer":45}],45:[function(require,module,exports){ +(function (global){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ +/* eslint-disable no-proto */ + +'use strict' var base64 = require('base64-js') var ieee754 = require('ieee754') -var isArray = require('is-array') +var isArray = require('isarray') exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 -Buffer.poolSize = 8192 // not used by this implementation - -var rootParent = {} /** * If `Buffer.TYPED_ARRAY_SUPPORT`: @@ -6480,9 +6895,6 @@ var rootParent = {} * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * - * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property - * on objects. - * * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. * * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of @@ -6491,20 +6903,26 @@ var rootParent = {} * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they * get the Object implementation, which is slower but behaves correctly. */ -Buffer.TYPED_ARRAY_SUPPORT = (function () { - function Bar () {} +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() + +function typedArraySupport () { try { var arr = new Uint8Array(1) arr.foo = function () { return 42 } - arr.constructor = Bar return arr.foo() === 42 && // typed array instances can be augmented - arr.constructor === Bar && // constructor can be set typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` } catch (e) { return false } -})() +} function kMaxLength () { return Buffer.TYPED_ARRAY_SUPPORT @@ -6512,168 +6930,236 @@ function kMaxLength () { : 0x3fffffff } -/** - * Class: Buffer - * ============= - * - * The Buffer constructor returns instances of `Uint8Array` that are augmented - * with function properties for all the node `Buffer` API functions. We use - * `Uint8Array` so that square bracket notation works as expected -- it returns - * a single octet. - * - * By augmenting the instances, we can avoid modifying the `Uint8Array` - * prototype. - */ -function Buffer (arg) { - if (!(this instanceof Buffer)) { - // Avoid going through an ArgumentsAdaptorTrampoline in the common case. - if (arguments.length > 1) return new Buffer(arg, arguments[1]) - return new Buffer(arg) +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length } - this.length = 0 - this.parent = undefined + return that +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } // Common case. if (typeof arg === 'number') { - return fromNumber(this, arg) + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) } - - // Slightly less common case. - if (typeof arg === 'string') { - return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') - } - - // Unusual. - return fromObject(this, arg) + return from(this, arg, encodingOrOffset, length) } -function fromNumber (that, length) { - that = allocate(that, length < 0 ? 0 : checked(length) | 0) +Buffer.poolSize = 8192 // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} + +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, value) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } +} + +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} + +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < length; i++) { + for (var i = 0; i < size; i++) { that[i] = 0 } } return that } -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } - // Assumption: byteLength() return value is always < kMaxLength. var length = byteLength(string, encoding) | 0 - that = allocate(that, length) + that = createBuffer(that, length) that.write(string, encoding) return that } -function fromObject (that, object) { - if (Buffer.isBuffer(object)) return fromBuffer(that, object) - - if (isArray(object)) return fromArray(that, object) - - if (object == null) { - throw new TypeError('must start with number, buffer, array or string') - } - - if (typeof ArrayBuffer !== 'undefined') { - if (object.buffer instanceof ArrayBuffer) { - return fromTypedArray(that, object) - } - if (object instanceof ArrayBuffer) { - return fromArrayBuffer(that, object) - } - } - - if (object.length) return fromArrayLike(that, object) - - return fromJsonObject(that, object) -} - -function fromBuffer (that, buffer) { - var length = checked(buffer.length) | 0 - that = allocate(that, length) - buffer.copy(that, 0, 0, length) - return that -} - -function fromArray (that, array) { - var length = checked(array.length) | 0 - that = allocate(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -// Duplicate of fromArray() to keep fromArray() monomorphic. -function fromTypedArray (that, array) { - var length = checked(array.length) | 0 - that = allocate(that, length) - // Truncating the elements is probably not what people expect from typed - // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior - // of the old Buffer constructor. - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -function fromArrayBuffer (that, array) { - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - array.byteLength - that = Buffer._augment(new Uint8Array(array)) - } else { - // Fallback: Return an object instance of the Buffer class - that = fromTypedArray(that, new Uint8Array(array)) - } - return that -} - function fromArrayLike (that, array) { var length = checked(array.length) | 0 - that = allocate(that, length) + that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that } -// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. -// Returns a zero-length buffer for inputs that don't conform to the spec. -function fromJsonObject (that, object) { - var array - var length = 0 +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer - if (object.type === 'Buffer' && isArray(object.data)) { - array = object.data - length = checked(array.length) | 0 + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') } - that = allocate(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) } - return that -} -function allocate (that, length) { if (Buffer.TYPED_ARRAY_SUPPORT) { // Return an augmented `Uint8Array` instance, for best performance - that = Buffer._augment(new Uint8Array(length)) + that = array + that.__proto__ = Buffer.prototype } else { // Fallback: Return an object instance of the Buffer class - that.length = length - that._isBuffer = true + that = fromArrayLike(that, array) + } + return that +} + +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len) + return that } - var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 - if (fromPool) that.parent = rootParent + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } - return that + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } function checked (length) { @@ -6686,12 +7172,11 @@ function checked (length) { return length | 0 } -function SlowBuffer (subject, encoding) { - if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) - - var buf = new Buffer(subject, encoding) - delete buf.parent - return buf +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { @@ -6708,17 +7193,12 @@ Buffer.compare = function compare (a, b) { var x = a.length var y = b.length - var i = 0 - var len = Math.min(x, y) - while (i < len) { - if (a[i] !== b[i]) break - - ++i - } - - if (i !== len) { - x = a[i] - y = b[i] + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } } if (x < y) return -1 @@ -6746,10 +7226,12 @@ Buffer.isEncoding = function isEncoding (encoding) { } Buffer.concat = function concat (list, length) { - if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } if (list.length === 0) { - return new Buffer(0) + return Buffer.alloc(0) } var i @@ -6760,18 +7242,30 @@ Buffer.concat = function concat (list, length) { } } - var buf = new Buffer(length) + var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; i++) { - var item = list[i] - item.copy(buf, pos) - pos += item.length + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length } - return buf + return buffer } function byteLength (string, encoding) { - if (typeof string !== 'string') string = '' + string + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } var len = string.length if (len === 0) return 0 @@ -6788,6 +7282,7 @@ function byteLength (string, encoding) { return len case 'utf8': case 'utf-8': + case undefined: return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': @@ -6807,20 +7302,42 @@ function byteLength (string, encoding) { } Buffer.byteLength = byteLength -// pre-set for values that may exist in the future -Buffer.prototype.length = undefined -Buffer.prototype.parent = undefined - function slowToString (encoding, start, end) { var loweredCase = false - start = start | 0 - end = end === undefined || end === Infinity ? this.length : end | 0 + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } if (!encoding) encoding = 'utf8' - if (start < 0) start = 0 - if (end > this.length) end = this.length - if (end <= start) return '' while (true) { switch (encoding) { @@ -6854,6 +7371,39 @@ function slowToString (encoding, start, end) { } } +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + Buffer.prototype.toString = function toString () { var length = this.length | 0 if (length === 0) return '' @@ -6877,15 +7427,114 @@ Buffer.prototype.inspect = function inspect () { return '' } -Buffer.prototype.compare = function compare (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return 0 - return Buffer.compare(this, b) +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 } -Buffer.prototype.indexOf = function indexOf (val, byteOffset) { - if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff - else if (byteOffset < -0x80000000) byteOffset = -0x80000000 +function arrayIndexOf (arr, val, byteOffset, encoding) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var foundIndex = -1 + for (var i = 0; byteOffset + i < arrLength; i++) { + if (read(arr, byteOffset + i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return (byteOffset + foundIndex) * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + return -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } byteOffset >>= 0 if (this.length === 0) return -1 @@ -6895,45 +7544,28 @@ Buffer.prototype.indexOf = function indexOf (val, byteOffset) { if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) if (typeof val === 'string') { - if (val.length === 0) return -1 // special case: looking for empty string always fails - return String.prototype.indexOf.call(this, val, byteOffset) + val = Buffer.from(val, encoding) } + if (Buffer.isBuffer(val)) { - return arrayIndexOf(this, val, byteOffset) + // special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(this, val, byteOffset, encoding) } if (typeof val === 'number') { if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { return Uint8Array.prototype.indexOf.call(this, val, byteOffset) } - return arrayIndexOf(this, [ val ], byteOffset) - } - - function arrayIndexOf (arr, val, byteOffset) { - var foundIndex = -1 - for (var i = 0; byteOffset + i < arr.length; i++) { - if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex - } else { - foundIndex = -1 - } - } - return -1 + return arrayIndexOf(this, [ val ], byteOffset, encoding) } throw new TypeError('val must be string, number or Buffer') } -// `get` is deprecated -Buffer.prototype.get = function get (offset) { - console.log('.get() is deprecated. Access using array indexes instead.') - return this.readUInt8(offset) -} - -// `set` is deprecated -Buffer.prototype.set = function set (v, offset) { - console.log('.set() is deprecated. Access using array indexes instead.') - return this.writeUInt8(v, offset) +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 } function hexWrite (buf, string, offset, length) { @@ -6957,7 +7589,7 @@ function hexWrite (buf, string, offset, length) { } for (var i = 0; i < length; i++) { var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) throw new Error('Invalid hex string') + if (isNaN(parsed)) return i buf[offset + i] = parsed } return i @@ -7006,17 +7638,16 @@ Buffer.prototype.write = function write (string, offset, length, encoding) { } // legacy write(string, encoding, offset, length) - remove in v0.13 } else { - var swap = encoding - encoding = offset - offset = length | 0 - length = swap + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('attempt to write outside buffer bounds') + throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' @@ -7231,7 +7862,8 @@ Buffer.prototype.slice = function slice (start, end) { var newBuf if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = Buffer._augment(this.subarray(start, end)) + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype } else { var sliceLen = end - start newBuf = new Buffer(sliceLen, undefined) @@ -7240,8 +7872,6 @@ Buffer.prototype.slice = function slice (start, end) { } } - if (newBuf.length) newBuf.parent = this.parent || this - return newBuf } @@ -7410,16 +8040,19 @@ Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { } function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') - if (value > max || value < min) throw new RangeError('value is out of bounds') - if (offset + ext > buf.length) throw new RangeError('index out of range') + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset | 0 byteLength = byteLength | 0 - if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } var mul = 1 var i = 0 @@ -7435,7 +8068,10 @@ Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, value = +value offset = offset | 0 byteLength = byteLength | 0 - if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } var i = byteLength - 1 var mul = 1 @@ -7452,7 +8088,7 @@ Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = value + this[offset] = (value & 0xff) return offset + 1 } @@ -7469,7 +8105,7 @@ Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = value + this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) @@ -7483,7 +8119,7 @@ Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) - this[offset + 1] = value + this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } @@ -7505,7 +8141,7 @@ Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) - this[offset] = value + this[offset] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, true) } @@ -7520,7 +8156,7 @@ Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) - this[offset + 3] = value + this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } @@ -7538,9 +8174,12 @@ Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, no var i = 0 var mul = 1 - var sub = value < 0 ? 1 : 0 + var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } @@ -7558,9 +8197,12 @@ Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, no var i = byteLength - 1 var mul = 1 - var sub = value < 0 ? 1 : 0 + var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } @@ -7573,7 +8215,7 @@ Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) if (value < 0) value = 0xff + value + 1 - this[offset] = value + this[offset] = (value & 0xff) return offset + 1 } @@ -7582,7 +8224,7 @@ Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = value + this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) } else { objectWriteUInt16(this, value, offset, true) @@ -7596,7 +8238,7 @@ Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) if (Buffer.TYPED_ARRAY_SUPPORT) { this[offset] = (value >>> 8) - this[offset + 1] = value + this[offset + 1] = (value & 0xff) } else { objectWriteUInt16(this, value, offset, false) } @@ -7608,7 +8250,7 @@ Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) offset = offset | 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = value + this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) @@ -7627,7 +8269,7 @@ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) - this[offset + 3] = value + this[offset + 3] = (value & 0xff) } else { objectWriteUInt32(this, value, offset, false) } @@ -7635,9 +8277,8 @@ Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) } function checkIEEE754 (buf, value, offset, ext, max, min) { - if (value > max || value < min) throw new RangeError('value is out of bounds') - if (offset + ext > buf.length) throw new RangeError('index out of range') - if (offset < 0) throw new RangeError('index out of range') + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { @@ -7711,134 +8352,82 @@ Buffer.prototype.copy = function copy (target, targetStart, start, end) { target[i + targetStart] = this[i + start] } } else { - target._set(this.subarray(start, start + len), targetStart) + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) } return len } -// fill(value, start=0, end=buffer.length) -Buffer.prototype.fill = function fill (value, start, end) { - if (!value) value = 0 - if (!start) start = 0 - if (!end) end = this.length +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } - if (end < start) throw new RangeError('end < start') + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } - // Fill 0 bytes; we're done - if (end === start) return - if (this.length === 0) return + if (end <= start) { + return this + } - if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') - if (end < 0 || end > this.length) throw new RangeError('end out of bounds') + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 var i - if (typeof value === 'number') { + if (typeof val === 'number') { for (i = start; i < end; i++) { - this[i] = value + this[i] = val } } else { - var bytes = utf8ToBytes(value.toString()) + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) var len = bytes.length - for (i = start; i < end; i++) { - this[i] = bytes[i % len] + for (i = 0; i < end - start; i++) { + this[i + start] = bytes[i % len] } } return this } -/** - * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. - * Added in Node 0.12. Only available in browsers that support ArrayBuffer. - */ -Buffer.prototype.toArrayBuffer = function toArrayBuffer () { - if (typeof Uint8Array !== 'undefined') { - if (Buffer.TYPED_ARRAY_SUPPORT) { - return (new Buffer(this)).buffer - } else { - var buf = new Uint8Array(this.length) - for (var i = 0, len = buf.length; i < len; i += 1) { - buf[i] = this[i] - } - return buf.buffer - } - } else { - throw new TypeError('Buffer.toArrayBuffer not supported in this browser') - } -} - // HELPER FUNCTIONS // ================ -var BP = Buffer.prototype - -/** - * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods - */ -Buffer._augment = function _augment (arr) { - arr.constructor = Buffer - arr._isBuffer = true - - // save reference to original Uint8Array set method before overwriting - arr._set = arr.set - - // deprecated - arr.get = BP.get - arr.set = BP.set - - arr.write = BP.write - arr.toString = BP.toString - arr.toLocaleString = BP.toString - arr.toJSON = BP.toJSON - arr.equals = BP.equals - arr.compare = BP.compare - arr.indexOf = BP.indexOf - arr.copy = BP.copy - arr.slice = BP.slice - arr.readUIntLE = BP.readUIntLE - arr.readUIntBE = BP.readUIntBE - arr.readUInt8 = BP.readUInt8 - arr.readUInt16LE = BP.readUInt16LE - arr.readUInt16BE = BP.readUInt16BE - arr.readUInt32LE = BP.readUInt32LE - arr.readUInt32BE = BP.readUInt32BE - arr.readIntLE = BP.readIntLE - arr.readIntBE = BP.readIntBE - arr.readInt8 = BP.readInt8 - arr.readInt16LE = BP.readInt16LE - arr.readInt16BE = BP.readInt16BE - arr.readInt32LE = BP.readInt32LE - arr.readInt32BE = BP.readInt32BE - arr.readFloatLE = BP.readFloatLE - arr.readFloatBE = BP.readFloatBE - arr.readDoubleLE = BP.readDoubleLE - arr.readDoubleBE = BP.readDoubleBE - arr.writeUInt8 = BP.writeUInt8 - arr.writeUIntLE = BP.writeUIntLE - arr.writeUIntBE = BP.writeUIntBE - arr.writeUInt16LE = BP.writeUInt16LE - arr.writeUInt16BE = BP.writeUInt16BE - arr.writeUInt32LE = BP.writeUInt32LE - arr.writeUInt32BE = BP.writeUInt32BE - arr.writeIntLE = BP.writeIntLE - arr.writeIntBE = BP.writeIntBE - arr.writeInt8 = BP.writeInt8 - arr.writeInt16LE = BP.writeInt16LE - arr.writeInt16BE = BP.writeInt16BE - arr.writeInt32LE = BP.writeInt32LE - arr.writeInt32BE = BP.writeInt32BE - arr.writeFloatLE = BP.writeFloatLE - arr.writeFloatBE = BP.writeFloatBE - arr.writeDoubleLE = BP.writeDoubleLE - arr.writeDoubleBE = BP.writeDoubleBE - arr.fill = BP.fill - arr.inspect = BP.inspect - arr.toArrayBuffer = BP.toArrayBuffer - - return arr -} - var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g function base64clean (str) { @@ -7902,7 +8491,7 @@ function utf8ToBytes (string, units) { } // valid surrogate pair - codePoint = leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00 | 0x10000 + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) @@ -7980,2518 +8569,19 @@ function blitBuffer (src, dst, offset, length) { return i } -},{"base64-js":44,"ieee754":45,"is-array":46}],44:[function(require,module,exports){ -var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - -;(function (exports) { - 'use strict'; - - var Arr = (typeof Uint8Array !== 'undefined') - ? Uint8Array - : Array - - var PLUS = '+'.charCodeAt(0) - var SLASH = '/'.charCodeAt(0) - var NUMBER = '0'.charCodeAt(0) - var LOWER = 'a'.charCodeAt(0) - var UPPER = 'A'.charCodeAt(0) - var PLUS_URL_SAFE = '-'.charCodeAt(0) - var SLASH_URL_SAFE = '_'.charCodeAt(0) - - function decode (elt) { - var code = elt.charCodeAt(0) - if (code === PLUS || - code === PLUS_URL_SAFE) - return 62 // '+' - if (code === SLASH || - code === SLASH_URL_SAFE) - return 63 // '/' - if (code < NUMBER) - return -1 //no match - if (code < NUMBER + 10) - return code - NUMBER + 26 + 26 - if (code < UPPER + 26) - return code - UPPER - if (code < LOWER + 26) - return code - LOWER + 26 - } - - function b64ToByteArray (b64) { - var i, j, l, tmp, placeHolders, arr - - if (b64.length % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - var len = b64.length - placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 - - // base64 is 4/3 + up to two characters of the original data - arr = new Arr(b64.length * 3 / 4 - placeHolders) - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? b64.length - 4 : b64.length - - var L = 0 - - function push (v) { - arr[L++] = v - } - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) - push((tmp & 0xFF0000) >> 16) - push((tmp & 0xFF00) >> 8) - push(tmp & 0xFF) - } - - if (placeHolders === 2) { - tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) - push(tmp & 0xFF) - } else if (placeHolders === 1) { - tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) - push((tmp >> 8) & 0xFF) - push(tmp & 0xFF) - } - - return arr - } - - function uint8ToBase64 (uint8) { - var i, - extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes - output = "", - temp, length - - function encode (num) { - return lookup.charAt(num) - } - - function tripletToBase64 (num) { - return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) - } - - // go through the array every three bytes, we'll deal with trailing stuff later - for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { - temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) - output += tripletToBase64(temp) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - switch (extraBytes) { - case 1: - temp = uint8[uint8.length - 1] - output += encode(temp >> 2) - output += encode((temp << 4) & 0x3F) - output += '==' - break - case 2: - temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) - output += encode(temp >> 10) - output += encode((temp >> 4) & 0x3F) - output += encode((temp << 2) & 0x3F) - output += '=' - break - } - - return output - } - - exports.toByteArray = b64ToByteArray - exports.fromByteArray = uint8ToBase64 -}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) - -},{}],45:[function(require,module,exports){ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare } -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"base64-js":40,"ieee754":52,"isarray":46}],46:[function(require,module,exports){ +var toString = {}.toString; - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - -},{}],46:[function(require,module,exports){ - -/** - * isArray - */ - -var isArray = Array.isArray; - -/** - * toString - */ - -var str = Object.prototype.toString; - -/** - * Whether or not the given `val` - * is an array. - * - * example: - * - * isArray([]); - * // > true - * isArray(arguments); - * // > false - * isArray(''); - * // > false - * - * @param {mixed} val - * @return {bool} - */ - -module.exports = isArray || function (val) { - return !! val && '[object Array]' == str.call(val); +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; }; },{}],47:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } - throw TypeError('Uncaught, unspecified "error" event.'); - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - len = arguments.length; - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - handler.apply(this, args); - } - } else if (isObject(handler)) { - len = arguments.length; - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - var m; - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.listenerCount = function(emitter, type) { - var ret; - if (!emitter._events || !emitter._events[type]) - ret = 0; - else if (isFunction(emitter._events[type])) - ret = 1; - else - ret = emitter._events[type].length; - return ret; -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - -},{}],48:[function(require,module,exports){ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} - -},{}],49:[function(require,module,exports){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -},{}],50:[function(require,module,exports){ -exports.endianness = function () { return 'LE' }; - -exports.hostname = function () { - if (typeof location !== 'undefined') { - return location.hostname - } - else return ''; -}; - -exports.loadavg = function () { return [] }; - -exports.uptime = function () { return 0 }; - -exports.freemem = function () { - return Number.MAX_VALUE; -}; - -exports.totalmem = function () { - return Number.MAX_VALUE; -}; - -exports.cpus = function () { return [] }; - -exports.type = function () { return 'Browser' }; - -exports.release = function () { - if (typeof navigator !== 'undefined') { - return navigator.appVersion; - } - return ''; -}; - -exports.networkInterfaces -= exports.getNetworkInterfaces -= function () { return {} }; - -exports.arch = function () { return 'javascript' }; - -exports.platform = function () { return 'browser' }; - -exports.tmpdir = exports.tmpDir = function () { - return '/tmp'; -}; - -exports.EOL = '\n'; - -},{}],51:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],52:[function(require,module,exports){ -module.exports = require("./lib/_stream_duplex.js") - -},{"./lib/_stream_duplex.js":53}],53:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -module.exports = Duplex; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -forEach(objectKeys(Writable.prototype), function(method) { - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -}); - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - process.nextTick(this.end.bind(this)); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -}).call(this,require('_process')) -},{"./_stream_readable":55,"./_stream_writable":57,"_process":51,"core-util-is":58,"inherits":48}],54:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; - -},{"./_stream_transform":56,"core-util-is":58,"inherits":48}],55:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -var Stream = require('stream'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var StringDecoder; - - -/**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = options.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - var Duplex = require('./_stream_duplex'); - - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (util.isString(chunk) && !state.objectMode) { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (util.isNullOrUndefined(chunk)) { - state.reading = false; - if (!state.ended) - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (isNaN(n) || util.isNull(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else - return state.length; - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (!util.isNumber(n) || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (util.isNull(ret)) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); - - if (!util.isNull(ret)) - this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!util.isBuffer(chunk) && - !util.isString(chunk) && - !util.isNullOrUndefined(chunk) && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) - process.nextTick(function() { - emitReadable_(stream); - }); - else - emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(function() { - maybeReadMore_(stream, state); - }); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - process.nextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - var self = this; - process.nextTick(function() { - debug('readable nexttick read 0'); - self.read(0); - }); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - if (!state.reading) { - debug('resume read 0'); - this.read(0); - } - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(function() { - resume_(stream, state); - }); - } -} - -function resume_(stream, state) { - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); -} - -Readable.prototype.pause = function() { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - if (!chunk || !state.objectMode && !chunk.length) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (util.isFunction(stream[i]) && util.isUndefined(this[i])) { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }}(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(function() { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } - }); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} - -}).call(this,require('_process')) -},{"./_stream_duplex":53,"_process":51,"buffer":43,"core-util-is":58,"events":47,"inherits":48,"isarray":49,"stream":63,"string_decoder/":64,"util":42}],56:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(options, stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (!util.isNullOrUndefined(data)) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(options, this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - this.once('prefinish', function() { - if (util.isFunction(this._flush)) - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} - -},{"./_stream_duplex":53,"core-util-is":58,"inherits":48}],57:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -module.exports = Writable; - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Stream = require('stream'); - -util.inherits(Writable, Stream); - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; -} - -function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = options.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.buffer = []; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, state, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - if (!util.isBuffer(chunk) && - !util.isString(chunk) && - !util.isNullOrUndefined(chunk) && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (util.isFunction(encoding)) { - cb = encoding; - encoding = null; - } - - if (util.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (!util.isFunction(cb)) - cb = function() {}; - - if (state.ended) - writeAfterEnd(this, state, cb); - else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function() { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.buffer.length) - clearBuffer(this, state); - } -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - util.isString(chunk)) { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - if (util.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing || state.corked) - state.buffer.push(new WriteReq(chunk, encoding, cb)); - else - doWrite(stream, state, false, len, chunk, encoding, cb); - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - if (sync) - process.nextTick(function() { - state.pendingcb--; - cb(er); - }); - else { - state.pendingcb--; - cb(er); - } - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(stream, state); - - if (!finished && - !state.corked && - !state.bufferProcessing && - state.buffer.length) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(function() { - afterWrite(stream, state, finished, cb); - }); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - - if (stream._writev && state.buffer.length > 1) { - // Fast case, write everything using _writev() - var cbs = []; - for (var c = 0; c < state.buffer.length; c++) - cbs.push(state.buffer[c].callback); - - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - doWrite(stream, state, true, state.length, state.buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer - state.buffer = []; - } else { - // Slow case, write chunks one-by-one - for (var c = 0; c < state.buffer.length; c++) { - var entry = state.buffer[c]; - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - c++; - break; - } - } - - if (c < state.buffer.length) - state.buffer = state.buffer.slice(c); - else - state.buffer.length = 0; - } - - state.bufferProcessing = false; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); - -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (util.isFunction(chunk)) { - cb = chunk; - chunk = null; - encoding = null; - } else if (util.isFunction(encoding)) { - cb = encoding; - encoding = null; - } - - if (!util.isNullOrUndefined(chunk)) - this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(stream, state) { - return (state.ending && - state.length === 0 && - !state.finished && - !state.writing); -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(stream, state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else - prefinish(stream, state); - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - process.nextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} - -}).call(this,require('_process')) -},{"./_stream_duplex":53,"_process":51,"buffer":43,"core-util-is":58,"inherits":48,"stream":63}],58:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -10516,8 +8606,12 @@ function endWritable(stream, state, cb) { // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; @@ -10557,7 +8651,7 @@ function isUndefined(arg) { exports.isUndefined = isUndefined; function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; + return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; @@ -10567,13 +8661,12 @@ function isObject(arg) { exports.isObject = isObject; function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; + return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); + return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; @@ -10592,983 +8685,14 @@ function isPrimitive(arg) { } exports.isPrimitive = isPrimitive; -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} -}).call(this,require("buffer").Buffer) -},{"buffer":43}],59:[function(require,module,exports){ -module.exports = require("./lib/_stream_passthrough.js") - -},{"./lib/_stream_passthrough.js":54}],60:[function(require,module,exports){ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = require('stream'); -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); - -},{"./lib/_stream_duplex.js":53,"./lib/_stream_passthrough.js":54,"./lib/_stream_readable.js":55,"./lib/_stream_transform.js":56,"./lib/_stream_writable.js":57,"stream":63}],61:[function(require,module,exports){ -module.exports = require("./lib/_stream_transform.js") - -},{"./lib/_stream_transform.js":56}],62:[function(require,module,exports){ -module.exports = require("./lib/_stream_writable.js") - -},{"./lib/_stream_writable.js":57}],63:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -module.exports = Stream; - -var EE = require('events').EventEmitter; -var inherits = require('inherits'); - -inherits(Stream, EE); -Stream.Readable = require('readable-stream/readable.js'); -Stream.Writable = require('readable-stream/writable.js'); -Stream.Duplex = require('readable-stream/duplex.js'); -Stream.Transform = require('readable-stream/transform.js'); -Stream.PassThrough = require('readable-stream/passthrough.js'); - -// Backwards-compat with node 0.4.x -Stream.Stream = Stream; - - - -// old-style streams. Note that the pipe method (the only relevant -// part of this class) is overridden in the Readable class. - -function Stream() { - EE.call(this); -} - -Stream.prototype.pipe = function(dest, options) { - var source = this; - - function ondata(chunk) { - if (dest.writable) { - if (false === dest.write(chunk) && source.pause) { - source.pause(); - } - } - } - - source.on('data', ondata); - - function ondrain() { - if (source.readable && source.resume) { - source.resume(); - } - } - - dest.on('drain', ondrain); - - // If the 'end' option is not supplied, dest.end() will be called when - // source gets the 'end' or 'close' events. Only dest.end() once. - if (!dest._isStdio && (!options || options.end !== false)) { - source.on('end', onend); - source.on('close', onclose); - } - - var didOnEnd = false; - function onend() { - if (didOnEnd) return; - didOnEnd = true; - - dest.end(); - } - - - function onclose() { - if (didOnEnd) return; - didOnEnd = true; - - if (typeof dest.destroy === 'function') dest.destroy(); - } - - // don't leave dangling pipes when there are errors. - function onerror(er) { - cleanup(); - if (EE.listenerCount(this, 'error') === 0) { - throw er; // Unhandled stream error in pipe. - } - } - - source.on('error', onerror); - dest.on('error', onerror); - - // remove all the event listeners that were added. - function cleanup() { - source.removeListener('data', ondata); - dest.removeListener('drain', ondrain); - - source.removeListener('end', onend); - source.removeListener('close', onclose); - - source.removeListener('error', onerror); - dest.removeListener('error', onerror); - - source.removeListener('end', cleanup); - source.removeListener('close', cleanup); - - dest.removeListener('close', cleanup); - } - - source.on('end', cleanup); - source.on('close', cleanup); - - dest.on('close', cleanup); - - dest.emit('pipe', source); - - // Allow for unix-like usage: A.pipe(B).pipe(C) - return dest; -}; - -},{"events":47,"inherits":48,"readable-stream/duplex.js":52,"readable-stream/passthrough.js":59,"readable-stream/readable.js":60,"readable-stream/transform.js":61,"readable-stream/writable.js":62}],64:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} - -},{"buffer":43}],65:[function(require,module,exports){ -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} -},{}],66:[function(require,module,exports){ -(function (process,global){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (process.noDeprecation === true) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnviron; -exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = process.env.NODE_DEBUG || ''; - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = require('./support/isBuffer'); +exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = require('inherits'); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":65,"_process":51,"inherits":48}],67:[function(require,module,exports){ +}).call(this,{"isBuffer":require("../../is-buffer/index.js")}) +},{"../../is-buffer/index.js":54}],48:[function(require,module,exports){ /* See LICENSE file for terms of use */ /* @@ -12189,7 +9313,7 @@ function hasOwnProperty(obj, prop) { } }(this)); -},{}],68:[function(require,module,exports){ +},{}],49:[function(require,module,exports){ 'use strict'; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; @@ -12202,7 +9326,307 @@ module.exports = function (str) { return str.replace(matchOperatorsRe, '\\$&'); }; -},{}],69:[function(require,module,exports){ +},{}],50:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } + throw TypeError('Uncaught, unspecified "error" event.'); + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}],51:[function(require,module,exports){ (function (process){ // Growl - Copyright TJ Holowaychuk (MIT Licensed) @@ -12221,7 +9645,7 @@ var exec = require('child_process').exec function which(name) { var paths = process.env.PATH.split(':'); var loc; - + for (var i = 0, len = paths.length; i < len; ++i) { loc = path.join(paths[i], name); if (exists(loc)) return loc; @@ -12237,6 +9661,9 @@ switch(os.type()) { , msg: '-message' , title: '-title' , subtitle: '-subtitle' + , icon: '-appIcon' + , sound: '-sound' + , url: '-open' , priority: { cmd: '-execute' , range: [] @@ -12267,21 +9694,35 @@ switch(os.type()) { } break; case 'Linux': - cmd = { - type: "Linux" - , pkg: "notify-send" - , msg: '' - , sticky: '-t 0' - , icon: '-i' - , priority: { - cmd: '-u' - , range: [ - "low" - , "normal" - , "critical" - ] - } - }; + if (which('growl')) { + cmd = { + type: "Linux-Growl" + , pkg: "growl" + , msg: '-m' + , title: '-title' + , subtitle: '-subtitle' + , host: { + cmd: '-H' + , hostname: '192.168.33.1' + } + }; + } else { + cmd = { + type: "Linux" + , pkg: "notify-send" + , msg: '' + , sticky: '-t 0' + , icon: '-i' + , priority: { + cmd: '-u' + , range: [ + "low" + , "normal" + , "critical" + ] + } + }; + } break; case 'Windows_NT': cmd = { @@ -12291,6 +9732,7 @@ switch(os.type()) { , sticky: '/s:true' , title: '/t:' , icon: '/i:' + , url: '/cu:' , priority: { cmd: '/p:' , range: [ @@ -12326,6 +9768,7 @@ exports.version = '1.4.1' * - sticky Make the notification stick (defaults to false) * - priority Specify an int or named key (default is 0) * - name Application name (defaults to growlnotify) + * - sound Sound efect ( in OSx defined in preferences -> sound -> effects) * works only in OSX > 10.8x * - image * - path to an icon sets --iconpath * - path to an image sets --image @@ -12337,6 +9780,7 @@ exports.version = '1.4.1' * * growl('New email') * growl('5 new emails', { title: 'Thunderbird' }) + * growl('5 new emails', { title: 'Thunderbird', sound: 'Purr' }) * growl('Email sent', function(){ * // ... notification sent * }) @@ -12353,6 +9797,14 @@ function growl(msg, options, fn) { , options = options || {} , fn = fn || function(){}; + if (options.exec) { + cmd = { + type: "Custom" + , pkg: options.exec + , range: [] + }; + } + // noop if (!cmd) return fn(new Error('growl not supported on this platform')); args = [cmd.pkg]; @@ -12369,6 +9821,9 @@ function growl(msg, options, fn) { flag = flag || 'icon' args.push('--' + flag, quote(image)) break; + case 'Darwin-NotificationCenter': + args.push(cmd.icon, quote(image)); + break; case 'Linux': args.push(cmd.icon, quote(image)); // libnotify defaults to sticky, set a hint for transient notifications @@ -12392,6 +9847,11 @@ function growl(msg, options, fn) { } } + //sound + if(options.sound && cmd.type === 'Darwin-NotificationCenter'){ + args.push(cmd.sound, options.sound) + } + // name if (options.name && cmd.type === "Darwin-Growl") { args.push('--name', options.name); @@ -12400,12 +9860,14 @@ function growl(msg, options, fn) { switch(cmd.type) { case 'Darwin-Growl': args.push(cmd.msg); - args.push(quote(msg)); + args.push(quote(msg).replace(/\\n/g, '\n')); if (options.title) args.push(quote(options.title)); break; case 'Darwin-NotificationCenter': args.push(cmd.msg); - args.push(quote(msg)); + var stringifiedMsg = quote(msg); + var escapedMsg = stringifiedMsg.replace(/\\n/g, '\n'); + args.push(escapedMsg); if (options.title) { args.push(cmd.title); args.push(quote(options.title)); @@ -12414,24 +9876,42 @@ function growl(msg, options, fn) { args.push(cmd.subtitle); args.push(quote(options.subtitle)); } + if (options.url) { + args.push(cmd.url); + args.push(quote(options.url)); + } break; - case 'Darwin-Growl': + case 'Linux-Growl': args.push(cmd.msg); - args.push(quote(msg)); + args.push(quote(msg).replace(/\\n/g, '\n')); if (options.title) args.push(quote(options.title)); + if (cmd.host) { + args.push(cmd.host.cmd, cmd.host.hostname) + } break; case 'Linux': if (options.title) { args.push(quote(options.title)); args.push(cmd.msg); - args.push(quote(msg)); + args.push(quote(msg).replace(/\\n/g, '\n')); } else { - args.push(quote(msg)); + args.push(quote(msg).replace(/\\n/g, '\n')); } break; case 'Windows': - args.push(quote(msg)); + args.push(quote(msg).replace(/\\n/g, '\n')); if (options.title) args.push(cmd.title + quote(options.title)); + if (options.url) args.push(cmd.url + quote(options.url)); + break; + case 'Custom': + args[0] = (function(origCommand) { + var message = options.title + ? options.title + ': ' + msg + : msg; + var command = origCommand.replace(/(^|[^%])%s/g, '$1' + quote(message)); + if (command === origCommand) args.push(quote(message)); + return command; + })(args[0]); break; } @@ -12440,7 +9920,137 @@ function growl(msg, options, fn) { }; }).call(this,require('_process')) -},{"_process":51,"child_process":41,"fs":41,"os":50,"path":41}],70:[function(require,module,exports){ +},{"_process":58,"child_process":43,"fs":43,"os":56,"path":43}],52:[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],53:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],54:[function(require,module,exports){ +/** + * Determine if an object is Buffer + * + * Author: Feross Aboukhadijeh + * License: MIT + * + * `npm install is-buffer` + */ + +module.exports = function (obj) { + return !!(obj != null && + (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor) + (obj.constructor && + typeof obj.constructor.isBuffer === 'function' && + obj.constructor.isBuffer(obj)) + )) +} + +},{}],55:[function(require,module,exports){ (function (process){ var path = require('path'); var fs = require('fs'); @@ -12542,169 +10152,2998 @@ mkdirP.sync = function sync (p, opts, made) { }; }).call(this,require('_process')) -},{"_process":51,"fs":41,"path":41}],71:[function(require,module,exports){ -(function (process,global){ -/** - * Shim process.stdout. - */ +},{"_process":58,"fs":43,"path":43}],56:[function(require,module,exports){ +exports.endianness = function () { return 'LE' }; -process.stdout = require('browser-stdout')(); - -var Mocha = require('../'); - -/** - * Create a Mocha instance. - * - * @return {undefined} - */ - -var mocha = new Mocha({ reporter: 'html' }); - -/** - * Save timer references to avoid Sinon interfering (see GH-237). - */ - -var Date = global.Date; -var setTimeout = global.setTimeout; -var setInterval = global.setInterval; -var clearTimeout = global.clearTimeout; -var clearInterval = global.clearInterval; - -var uncaughtExceptionHandlers = []; - -var originalOnerrorHandler = global.onerror; - -/** - * Remove uncaughtException listener. - * Revert to original onerror handler if previously defined. - */ - -process.removeListener = function(e, fn){ - if ('uncaughtException' == e) { - if (originalOnerrorHandler) { - global.onerror = originalOnerrorHandler; - } else { - global.onerror = function() {}; +exports.hostname = function () { + if (typeof location !== 'undefined') { + return location.hostname } - var i = Mocha.utils.indexOf(uncaughtExceptionHandlers, fn); - if (i != -1) { uncaughtExceptionHandlers.splice(i, 1); } - } + else return ''; }; -/** - * Implements uncaughtException listener. - */ +exports.loadavg = function () { return [] }; -process.on = function(e, fn){ - if ('uncaughtException' == e) { - global.onerror = function(err, url, line){ - fn(new Error(err + ' (' + url + ':' + line + ')')); - return !mocha.allowUncaught; - }; - uncaughtExceptionHandlers.push(fn); - } +exports.uptime = function () { return 0 }; + +exports.freemem = function () { + return Number.MAX_VALUE; }; -// The BDD UI is registered by default, but no UI will be functional in the -// browser without an explicit call to the overridden `mocha.ui` (see below). -// Ensure that this default UI does not expose its methods to the global scope. -mocha.suite.removeAllListeners('pre-require'); +exports.totalmem = function () { + return Number.MAX_VALUE; +}; -var immediateQueue = [] - , immediateTimeout; +exports.cpus = function () { return [] }; -function timeslice() { - var immediateStart = new Date().getTime(); - while (immediateQueue.length && (new Date().getTime() - immediateStart) < 100) { - immediateQueue.shift()(); +exports.type = function () { return 'Browser' }; + +exports.release = function () { + if (typeof navigator !== 'undefined') { + return navigator.appVersion; + } + return ''; +}; + +exports.networkInterfaces += exports.getNetworkInterfaces += function () { return {} }; + +exports.arch = function () { return 'javascript' }; + +exports.platform = function () { return 'browser' }; + +exports.tmpdir = exports.tmpDir = function () { + return '/tmp'; +}; + +exports.EOL = '\n'; + +},{}],57:[function(require,module,exports){ +(function (process){ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); } - if (immediateQueue.length) { - immediateTimeout = setTimeout(timeslice, 0); - } else { - immediateTimeout = null; + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); } } -/** - * High-performance override of Runner.immediately. - */ +}).call(this,require('_process')) +},{"_process":58}],58:[function(require,module,exports){ +// shim for using process in browser -Mocha.Runner.immediately = function(callback) { - immediateQueue.push(callback); - if (!immediateTimeout) { - immediateTimeout = setTimeout(timeslice, 0); +var process = module.exports = {}; +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = setTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + setTimeout(drainQueue, 0); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],59:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Stream; + +var EE = require('events').EventEmitter; +var inherits = require('inherits'); + +inherits(Stream, EE); +Stream.Readable = require('readable-stream/readable.js'); +Stream.Writable = require('readable-stream/writable.js'); +Stream.Duplex = require('readable-stream/duplex.js'); +Stream.Transform = require('readable-stream/transform.js'); +Stream.PassThrough = require('readable-stream/passthrough.js'); + +// Backwards-compat with node 0.4.x +Stream.Stream = Stream; + + + +// old-style streams. Note that the pipe method (the only relevant +// part of this class) is overridden in the Readable class. + +function Stream() { + EE.call(this); +} + +Stream.prototype.pipe = function(dest, options) { + var source = this; + + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); + } + } + } + + source.on('data', ondata); + + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + + dest.on('drain', ondrain); + + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend); + source.on('close', onclose); + } + + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + + dest.end(); + } + + + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + + if (typeof dest.destroy === 'function') dest.destroy(); + } + + // don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, 'error') === 0) { + throw er; // Unhandled stream error in pipe. + } + } + + source.on('error', onerror); + dest.on('error', onerror); + + // remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata); + dest.removeListener('drain', ondrain); + + source.removeListener('end', onend); + source.removeListener('close', onclose); + + source.removeListener('error', onerror); + dest.removeListener('error', onerror); + + source.removeListener('end', cleanup); + source.removeListener('close', cleanup); + + dest.removeListener('close', cleanup); + } + + source.on('end', cleanup); + source.on('close', cleanup); + + dest.on('close', cleanup); + + dest.emit('pipe', source); + + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest; +}; + +},{"events":50,"inherits":53,"readable-stream/duplex.js":61,"readable-stream/passthrough.js":67,"readable-stream/readable.js":68,"readable-stream/transform.js":69,"readable-stream/writable.js":70}],60:[function(require,module,exports){ +arguments[4][46][0].apply(exports,arguments) +},{"dup":46}],61:[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") + +},{"./lib/_stream_duplex.js":62}],62:[function(require,module,exports){ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} +},{"./_stream_readable":64,"./_stream_writable":66,"core-util-is":47,"inherits":53,"process-nextick-args":57}],63:[function(require,module,exports){ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":65,"core-util-is":47,"inherits":53}],64:[function(require,module,exports){ +(function (process){ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var isArray = require('isarray'); +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +var hasPrependListener = typeof EE.prototype.prependListener === 'function'; + +function prependListener(emitter, event, fn) { + if (hasPrependListener) return emitter.prependListener(event, fn); + + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. This is here + // only because this code needs to continue to work with older versions + // of Node.js that do not include the prependListener() method. The goal + // is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = bufferShim.from(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); + } else { + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } + + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; + + if (state.objectMode) return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } + + if (n <= 0) return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) return null; + + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var _buf = list[0]; + var cpy = Math.min(n - c, _buf.length); + + if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + + if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} +}).call(this,require('_process')) +},{"./_stream_duplex":62,"_process":58,"buffer":45,"buffer-shims":44,"core-util-is":47,"events":50,"inherits":53,"isarray":60,"process-nextick-args":57,"string_decoder/":71,"util":41}],65:[function(require,module,exports){ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) stream.push(data); + + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('Not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; -/** - * Function to allow assertion libraries to throw errors directly into mocha. - * This is useful when running tests in a browser because window.onerror will - * only receive the 'message' attribute of the Error. - */ -mocha.throwError = function(err) { - Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) { - fn(err); - }); - throw err; +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } }; -/** - * Override ui to ensure that the ui functions are initialized. - * Normally this would happen in Mocha.prototype.loadFiles. - */ +function done(stream, er) { + if (er) return stream.emit('error', er); -mocha.ui = function(ui){ - Mocha.prototype.ui.call(this, ui); - this.suite.emit('pre-require', global, null, this); + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + + if (ts.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} +},{"./_stream_duplex":62,"core-util-is":47,"inherits":53}],66:[function(require,module,exports){ +(function (process){ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); + +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + // Always throw error if a null is written + // if we are not in object mode then throw + // if it is not a buffer, string, or undefined. + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; return this; }; -/** - * Setup mocha with the given setting options. - */ +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = bufferShim.from(chunk, encoding); + } + return chunk; +} -mocha.setup = function(opts){ - if ('string' == typeof opts) opts = { ui: opts }; - for (var opt in opts) this[opt](opts[opt]); - return this; -}; +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); -/** - * Run mocha, returning the Runner. - */ + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; -mocha.run = function(fn){ - var options = mocha.options; - mocha.globals('location'); + state.length += len; - var query = Mocha.utils.parseQuery(global.location.search || ''); - if (query.grep) mocha.grep(new RegExp(query.grep)); - if (query.fgrep) mocha.grep(query.fgrep); - if (query.invert) mocha.invert(); + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - return Mocha.prototype.run.call(mocha, function(err){ - // The DOM Document is not available in Web Workers. - var document = global.document; - if (document && document.getElementById('mocha') && options.noHighlighting !== true) { - Mocha.utils.highlightTags('code'); + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; } - if (fn) fn(err); - }); + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); }; -/** - * Expose the process shim. - * https://github.com/mochajs/mocha/pull/916 - */ +Writable.prototype._writev = null; -Mocha.process = process; +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} +}).call(this,require('_process')) +},{"./_stream_duplex":62,"_process":58,"buffer":45,"buffer-shims":44,"core-util-is":47,"events":50,"inherits":53,"process-nextick-args":57,"util-deprecate":73}],67:[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") + +},{"./lib/_stream_passthrough.js":63}],68:[function(require,module,exports){ +(function (process){ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; +} + +}).call(this,require('_process')) +},{"./lib/_stream_duplex.js":62,"./lib/_stream_passthrough.js":63,"./lib/_stream_readable.js":64,"./lib/_stream_transform.js":65,"./lib/_stream_writable.js":66,"_process":58}],69:[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":65}],70:[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":66}],71:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} + +},{"buffer":45}],72:[function(require,module,exports){ /** - * Expose mocha. + * Expose `toIsoString`. */ -global.Mocha = Mocha; -global.mocha = mocha; +module.exports = toIsoString; + + +/** + * Turn a `date` into an ISO string. + * + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString + * + * @param {Date} date + * @return {String} + */ + +function toIsoString (date) { + return date.getUTCFullYear() + + '-' + pad(date.getUTCMonth() + 1) + + '-' + pad(date.getUTCDate()) + + 'T' + pad(date.getUTCHours()) + + ':' + pad(date.getUTCMinutes()) + + ':' + pad(date.getUTCSeconds()) + + '.' + String((date.getUTCMilliseconds()/1000).toFixed(3)).slice(2, 5) + + 'Z'; +} + + +/** + * Pad a `number` with a ten's place zero. + * + * @param {Number} number + * @return {String} + */ + +function pad (number) { + var n = number.toString(); + return n.length === 1 ? '0' + n : n; +} +},{}],73:[function(require,module,exports){ +(function (global){ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],74:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],75:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../":1,"_process":51,"browser-stdout":40}]},{},[71]); +},{"./support/isBuffer":74,"_process":58,"inherits":53}]},{},[1]); diff --git a/browser/extensions/loop/chrome/content/shared/test/vendor/react-dom-server.js b/browser/extensions/loop/chrome/content/shared/test/vendor/react-dom-server.js index a8048d0dc330..586130d1cd7b 100644 --- a/browser/extensions/loop/chrome/content/shared/test/vendor/react-dom-server.js +++ b/browser/extensions/loop/chrome/content/shared/test/vendor/react-dom-server.js @@ -1,5 +1,5 @@ /** - * ReactDOMServer v15.0.2 + * ReactDOMServer v15.1.0 * * Copyright 2013-present, Facebook, Inc. * All rights reserved. diff --git a/browser/extensions/loop/chrome/content/shared/vendor/react-dom-prod.js b/browser/extensions/loop/chrome/content/shared/vendor/react-dom-prod.js index e9996da0b45b..b5fa6fcde246 100644 --- a/browser/extensions/loop/chrome/content/shared/vendor/react-dom-prod.js +++ b/browser/extensions/loop/chrome/content/shared/vendor/react-dom-prod.js @@ -1,5 +1,5 @@ /** - * ReactDOM v15.0.2 + * ReactDOM v15.1.0 * * Copyright 2013-present, Facebook, Inc. * All rights reserved. diff --git a/browser/extensions/loop/chrome/content/shared/vendor/react-dom.js b/browser/extensions/loop/chrome/content/shared/vendor/react-dom.js index 5f621f4ec250..1cf5496b5aa1 100644 --- a/browser/extensions/loop/chrome/content/shared/vendor/react-dom.js +++ b/browser/extensions/loop/chrome/content/shared/vendor/react-dom.js @@ -1,5 +1,5 @@ /** - * ReactDOM v15.0.2 + * ReactDOM v15.1.0 * * Copyright 2013-present, Facebook, Inc. * All rights reserved. diff --git a/browser/extensions/loop/chrome/content/shared/vendor/react-prod.js b/browser/extensions/loop/chrome/content/shared/vendor/react-prod.js index 8697569e1281..acb89ddad3c2 100644 --- a/browser/extensions/loop/chrome/content/shared/vendor/react-prod.js +++ b/browser/extensions/loop/chrome/content/shared/vendor/react-prod.js @@ -1,5 +1,5 @@ /** - * React (with addons) v15.0.2 + * React (with addons) v15.1.0 * * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9,8 +9,8 @@ * of patent rights can be found in the PATENTS file in the same directory. * */ -!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?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.React=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a8&&11>=T),N=32,w=String.fromCharCode(N),S=f.topLevelTypes,M={beforeInput:{phasedRegistrationNames:{bubbled:C({onBeforeInput:null}),captured:C({onBeforeInputCapture:null})},dependencies:[S.topCompositionEnd,S.topKeyPress,S.topTextInput,S.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:C({onCompositionEnd:null}),captured:C({onCompositionEndCapture:null})},dependencies:[S.topBlur,S.topCompositionEnd,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:C({onCompositionStart:null}),captured:C({onCompositionStartCapture:null})},dependencies:[S.topBlur,S.topCompositionStart,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:C({onCompositionUpdate:null}),captured:C({onCompositionUpdateCapture:null})},dependencies:[S.topBlur,S.topCompositionUpdate,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]}},k=!1,R=null,D={eventTypes:M,extractEvents:function(e,t,n,r){return[l(e,t,n,r),d(e,t,n,r)]}};t.exports=D},{110:110,114:114,156:156,16:16,174:174,20:20,21:21}],3:[function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},i=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){i.forEach(function(t){o[r(t,e)]=o[e]})});var a={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:o,shorthandPropertyExpansions:a};t.exports=s},{}],4:[function(e,t,n){"use strict";var r=e(3),o=e(156),i=e(86),a=(e(158),e(127)),s=e(169),u=e(176),l=(e(178),u(function(e){return s(e)})),c=!1,p="cssFloat";if(o.canUseDOM){var d=document.createElement("div").style;try{d.font=""}catch(f){c=!0}void 0===document.documentElement.style.cssFloat&&(p="styleFloat")}var h={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];null!=o&&(n+=l(r)+":",n+=a(r,o,t)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var i in t)if(t.hasOwnProperty(i)){var s=a(i,t[i],n);if("float"!==i&&"cssFloat"!==i||(i=p),s)o[i]=s;else{var u=c&&r.shorthandPropertyExpansions[i];if(u)for(var l in u)o[l]="";else o[i]=""}}}};i.measureMethods(h,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),t.exports=h},{127:127,156:156,158:158,169:169,176:176,178:178,3:3,86:86}],5:[function(e,t,n){"use strict";function r(){this._callbacks=null,this._contexts=null}var o=e(179),i=e(26),a=e(170);o(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){e.length!==t.length?a(!1):void 0,this._callbacks=null,this._contexts=null;for(var n=0;n8));var L=!1;_.canUseDOM&&(L=N("input")&&(!("documentMode"in document)||document.documentMode>11));var U={get:function(){return O.get.call(this)},set:function(e){A=""+e,O.set.call(this,e)}},F={eventTypes:k,extractEvents:function(e,t,n,o){var i,a,s=t?E.getNodeFromInstance(t):window;if(r(s)?I?i=u:a=l:w(s)?L?i=f:(i=v,a=h):m(s)&&(i=g),i){var c=i(e,t);if(c){var p=x.getPooled(k.change,c,n,o);return p.type="change",b.accumulateTwoPhaseDispatches(p),p}}a&&a(e,s,t)}};t.exports=F},{101:101,112:112,135:135,142:142,143:143,156:156,16:16,17:17,174:174,20:20,44:44}],7:[function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function o(e,t,n){c.insertTreeBefore(e,t,n)}function i(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):g(e,t,n)}function a(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var o=t;;){var i=o.nextSibling;if(g(e,o,r),o===n)break;o=i}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function l(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&g(r,document.createTextNode(n),o):n?(m(o,n),u(r,o,t)):u(r,e,t)}var c=e(8),p=e(12),d=e(81),f=e(86),h=e(126),v=e(147),m=e(148),g=h(function(e,t,n){e.insertBefore(t,n)}),y={dangerouslyReplaceNodeWithMarkup:p.dangerouslyReplaceNodeWithMarkup,replaceDelimitedText:l,processUpdates:function(e,t){for(var n=0;nt||e.hasOverloadedBooleanValue&&t===!1}var i=e(10),a=(e(52),e(86)),s=e(145),u=(e(178),new RegExp("^["+i.ATTRIBUTE_NAME_START_CHAR+"]["+i.ATTRIBUTE_NAME_CHAR+"]*$")),l={},c={},p={createMarkupForID:function(e){return i.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(i.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return i.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(i.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=i.properties.hasOwnProperty(e)?i.properties[e]:null;if(n){if(o(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+s(t)}return i.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else if(o(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseProperty){var s=r.propertyName;r.hasSideEffects&&""+e[s]==""+n||(e[s]=n)}else{var u=r.attributeName,l=r.attributeNamespace;l?e.setAttributeNS(l,u,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?e.setAttribute(u,""):e.setAttribute(u,""+n)}}else i.isCustomAttribute(t)&&p.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseProperty){var o=n.propertyName;n.hasBooleanValue?e[o]=!1:n.hasSideEffects&&""+e[o]==""||(e[o]="")}else e.removeAttribute(n.attributeName)}else i.isCustomAttribute(t)&&e.removeAttribute(t)}};a.measureMethods(p,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),t.exports=p},{10:10,145:145,178:178,52:52,86:86}],12:[function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var o=e(8),i=e(156),a=e(161),s=e(162),u=e(166),l=e(170),c=/^(<[^ \/>]+)/,p="data-danger-index",d={dangerouslyRenderMarkup:function(e){i.canUseDOM?void 0:l(!1);for(var t,n={},o=0;o-1?void 0:a(!1),!l.plugins[n]){t.extractEvents?void 0:a(!1),l.plugins[n]=t;var r=t.eventTypes;for(var i in r)o(r[i],t,i)?void 0:a(!1)}}}function o(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)?a(!1):void 0,l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];i(s,t,n)}return!0}return e.registrationName?(i(e.registrationName,t,n),!0):!1}function i(e,t,n){l.registrationNameModules[e]?a(!1):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=e(170),s=null,u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s?a(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(u[n]?a(!1):void 0,u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=l},{170:170}],19:[function(e,t,n){"use strict";function r(e){return e===y.topMouseUp||e===y.topTouchEnd||e===y.topTouchCancel}function o(e){return e===y.topMouseMove||e===y.topTouchMove}function i(e){return e===y.topMouseDown||e===y.topTouchStart}function a(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=C.getNodeFromInstance(r),t?v.invokeGuardedCallbackWithCatch(o,n,e):v.invokeGuardedCallback(o,n,e),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;oe&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),i.addPoolingTo(r),t.exports=r},{139:139,179:179,26:26}],22:[function(e,t,n){"use strict";var r=e(10),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_SIDE_EFFECTS,s=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,l=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:u,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,coords:0,crossOrigin:0,data:0,dateTime:0,"default":i,defer:i,dir:0,disabled:i,download:l,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,rel:0,required:i,reversed:i,role:0,rows:u,rowSpan:s,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:u,sizes:0,span:u,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:s,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:o|a,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,"typeof":0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{}};t.exports=c},{10:10}],23:[function(e,t,n){"use strict";function r(e){var t=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+e).replace(t,function(e){return n[e]});return"$"+r}function o(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1);return(""+r).replace(t,function(e){return n[e]})}var i={escape:r,unescape:o};t.exports=i},{}],24:[function(e,t,n){"use strict";var r=e(77),o=e(96),i={linkState:function(e){return new r(this.state[e],o.createStateKeySetter(this,e))}};t.exports=i},{77:77,96:96}],25:[function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?l(!1):void 0}function o(e){r(e),null!=e.value||null!=e.onChange?l(!1):void 0}function i(e){r(e),null!=e.checked||null!=e.onChange?l(!1):void 0}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=e(89),u=e(88),l=e(170),c=(e(178),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),p={value:function(e,t,n){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func},d={},f={checkPropTypes:function(e,t,n){for(var r in p){if(p.hasOwnProperty(r))var o=p[r](t,r,e,u.prop);o instanceof Error&&!(o.message in d)&&(d[o.message]=!0,a(n))}},getValue:function(e){return e.valueLink?(o(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(i(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(o(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(i(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=f},{170:170,178:178,88:88,89:89}],26:[function(e,t,n){"use strict";var r=e(170),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},l=function(e){var t=this;e instanceof t?void 0:r(!1),e.destructor(),t.instancePool.length=0||null!=t.is}function p(e){var t=e.type;l(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._nativeNode=null,this._nativeParent=null,this._rootNodeID=null,this._domID=null,this._nativeContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var d=e(179),f=e(1),h=e(4),v=e(8),m=e(9),g=e(10),y=e(11),C=e(16),b=e(17),_=e(18),E=e(28),T=e(35),x=e(41),P=e(43),N=e(44),w=e(51),S=e(53),M=e(54),k=e(58),R=e(80),D=e(86),A=e(128),O=e(170),I=(e(142),e(174)),L=(e(177),e(153),e(178),P),U=b.deleteListener,F=N.getNodeFromInstance,V=E.listenTo,B=_.registrationNameModules,j={string:!0,number:!0},W=I({style:null}),K=I({__html:null}),q={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},H=11,Y={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},z={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},G={listing:!0,pre:!0,textarea:!0},X=d({menuitem:!0},z),Q=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,$={},Z={}.hasOwnProperty,J=1;p.displayName="ReactDOMComponent",p.Mixin={mountComponent:function(e,t,n,o){this._rootNodeID=J++,this._domID=n._idCounter++,this._nativeParent=t,this._nativeContainerInfo=n;var i=this._currentElement.props;switch(this._tag){case"iframe":case"object":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(s,this);break;case"button":i=x.getNativeProps(this,i,t);break;case"input":w.mountWrapper(this,i,t),i=w.getNativeProps(this,i),e.getReactMountReady().enqueue(s,this);break;case"option":S.mountWrapper(this,i,t),i=S.getNativeProps(this,i);break;case"select":M.mountWrapper(this,i,t),i=M.getNativeProps(this,i),e.getReactMountReady().enqueue(s,this);break;case"textarea":k.mountWrapper(this,i,t),i=k.getNativeProps(this,i),e.getReactMountReady().enqueue(s,this)}r(this,i);var u,l;null!=t?(u=t._namespaceURI,l=t._tag):n._tag&&(u=n._namespaceURI,l=n._tag),(null==u||u===m.svg&&"foreignobject"===l)&&(u=m.html),u===m.html&&("svg"===this._tag?u=m.svg:"math"===this._tag&&(u=m.mathml)),this._namespaceURI=u;var c;if(e.useCreateElement){var p,d=n._ownerDocument;if(u===m.html)if("script"===this._tag){var h=d.createElement("div"),g=this._currentElement.type;h.innerHTML="<"+g+">",p=h.removeChild(h.firstChild)}else p=d.createElement(this._currentElement.type);else p=d.createElementNS(u,this._currentElement.type);N.precacheNode(this,p),this._flags|=L.hasCachedChildNodes,this._nativeParent||y.setAttributeForRoot(p),this._updateDOMProperties(null,i,e);var C=v(p);this._createInitialChildren(e,i,o,C),c=C}else{var b=this._createOpenTagMarkupAndPutListeners(e,i),_=this._createContentMarkup(e,i,o);c=!_&&z[this._tag]?b+"/>":b+">"+_+""}switch(this._tag){case"button":case"input":case"select":case"textarea":i.autoFocus&&e.getReactMountReady().enqueue(f.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(a,this)}return c},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(B.hasOwnProperty(r))i&&o(this,r,i,e);else{r===W&&(i&&(i=this._previousStyleCopy=d({},t.style)),i=h.createMarkupForStyles(i,this));var a=null;null!=this._tag&&c(this._tag,t)?q.hasOwnProperty(r)||(a=y.createMarkupForCustomAttribute(r,i)):a=y.createMarkupForProperty(r,i),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._nativeParent||(n+=" "+y.createMarkupForRoot()),n+=" "+y.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=j[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=A(i);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return G[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&v.queueHTML(r,o.__html);else{var i=j[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)v.queueText(r,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u"},receiveComponent:function(){},getNativeNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),t.exports=a},{179:179,44:44,8:8}],48:[function(e,t,n){"use strict";function r(e){return o.createFactory(e)}var o=e(64),i=(e(65),e(175)),a=i({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);t.exports=a},{175:175,64:64,65:65}],49:[function(e,t,n){"use strict";var r={useCreateElement:!0};t.exports=r},{}],50:[function(e,t,n){"use strict";var r=e(7),o=e(44),i=e(86),a={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};i.measureMethods(a,"ReactDOMIDOperations",{dangerouslyProcessChildrenUpdates:"dangerouslyProcessChildrenUpdates"}),t.exports=a},{44:44,7:7,86:86}],51:[function(e,t,n){"use strict";function r(){this._rootNodeID&&d.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=u.executeOnChange(t,e);c.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=l.getNodeFromInstance(this),a=i;a.parentNode;)a=a.parentNode;for(var s=a.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),d=0;dt.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),i=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=l(e,o),u=l(e,i);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=e(156),l=e(138),c=e(139),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:p?o:i,setOffsets:p?a:s};t.exports=d},{138:138,139:139,156:156}],56:[function(e,t,n){"use strict";var r=e(63),o=e(94),i=e(102);r.inject();var a={renderToString:o.renderToString,renderToStaticMarkup:o.renderToStaticMarkup,version:i};t.exports=a},{102:102,63:63,94:94}],57:[function(e,t,n){"use strict";var r=e(179),o=e(7),i=e(8),a=e(44),s=e(86),u=e(128),l=e(170),c=(e(153),function(e){this._currentElement=e,this._stringText=""+e,this._nativeNode=null,this._nativeParent=null,this._domID=null,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});r(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,s=" react-text: "+o+" ",l=" /react-text ";if(this._domID=o,this._nativeParent=t,e.useCreateElement){var c=n._ownerDocument,p=c.createComment(s),d=c.createComment(l),f=i(c.createDocumentFragment());return i.queueChild(f,i(p)),this._stringText&&i.queueChild(f,i(c.createTextNode(this._stringText))),i.queueChild(f,i(d)),a.precacheNode(this,p),this._closingComment=d,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:""+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getNativeNode();o.replaceDelimitedText(r[0],r[1],n)}}},getNativeNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=a.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n?l(!1):void 0,8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._nativeNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,a.uncacheNode(this)}}),s.measureMethods(c.prototype,"ReactDOMTextComponent",{mountComponent:"mountComponent",receiveComponent:"receiveComponent"}),t.exports=c},{128:128,153:153,170:170,179:179,44:44,7:7,8:8,86:86}],58:[function(e,t,n){"use strict";function r(){this._rootNodeID&&d.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=u.executeOnChange(t,e);return c.asap(r,this),n}var i=e(179),a=e(14),s=e(11),u=e(25),l=e(44),c=e(101),p=e(170),d=(e(178),{getNativeProps:function(e,t){null!=t.dangerouslySetInnerHTML?p(!1):void 0;var n=i({},a.getNativeProps(e,t),{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return n},mountWrapper:function(e,t){var n=t.defaultValue,r=t.children;null!=r&&(null!=n?p(!1):void 0,Array.isArray(r)&&(r.length<=1?void 0:p(!1),r=r[0]),n=""+r),null==n&&(n="");var i=u.getValue(t);e._wrapperState={initialValue:""+(null!=i?i:n),listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getValue(t);null!=n&&s.setValueForProperty(l.getNodeFromInstance(e),"value",""+n)}});t.exports=d},{101:101,11:11,14:14,170:170,178:178,179:179,25:25,44:44}],59:[function(e,t,n){"use strict";function r(e,t){"_nativeNode"in e?void 0:u(!1),"_nativeNode"in t?void 0:u(!1);for(var n=0,r=e;r;r=r._nativeParent)n++;for(var o=0,i=t;i;i=i._nativeParent)o++;for(;n-o>0;)e=e._nativeParent,n--;for(;o-n>0;)t=t._nativeParent,o--;for(var a=n;a--;){if(e===t)return e;e=e._nativeParent,t=t._nativeParent}return null}function o(e,t){"_nativeNode"in e?void 0:u(!1),"_nativeNode"in t?void 0:u(!1);for(;t;){if(t===e)return!0;t=t._nativeParent}return!1}function i(e){return"_nativeNode"in e?void 0:u(!1),e._nativeParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._nativeParent;var o;for(o=r.length;o-- >0;)t(r[o],!1,n);for(o=0;o0;)n(u[l],!1,i)}var u=e(170);t.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:i,traverseTwoPhase:a,traverseEnterLeave:s}},{170:170}],60:[function(e,t,n){"use strict";var r,o=(e(10),e(18),e(178),{onCreateMarkupForProperty:function(e,t){r(e)},onSetValueForProperty:function(e,t,n){r(t)},onDeleteValueForProperty:function(e,t){r(t)}});t.exports=o},{10:10,178:178,18:18}],61:[function(e,t,n){"use strict";function r(e,t,n,r,o,i){}var o=e(76),i=(e(178),[]),a={addDevtool:function(e){i.push(e)},removeDevtool:function(e){for(var t=0;t1){for(var f=Array(d),h=0;d>h;h++)f[h]=arguments[h+2];i.children=f}if(e&&e.defaultProps){var v=e.defaultProps;for(r in v)void 0===i[r]&&(i[r]=v[r])}return s(e,u,l,c,p,o.current,i)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceKey=function(e,t){var n=s(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},s.cloneElement=function(e,t,n){var i,u=r({},e.props),l=e.key,c=e.ref,p=e._self,d=e._source,f=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,f=o.current),void 0!==t.key&&(l=""+t.key);var h;e.type&&e.type.defaultProps&&(h=e.type.defaultProps);for(i in t)t.hasOwnProperty(i)&&!a.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==h?u[i]=h[i]:u[i]=t[i])}var v=arguments.length-2;if(1===v)u.children=n;else if(v>1){for(var m=Array(v),g=0;v>g;g++)m[g]=arguments[g+2];u.children=m}return s(e.type,l,c,p,d,f,u)},s.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.exports=s},{125:125,178:178,179:179,39:39}],65:[function(e,t,n){"use strict";function r(){if(p.current){var e=p.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e,t){e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,i("uniqueKey",e,t))}function i(e,t,n){var o=r();if(!o){var i="string"==typeof n?n:n.displayName||n.name;i&&(o=" Check the top-level render call using <"+i+">.")}var a=h[e]||(h[e]={});if(a[o])return null;a[o]=!0;var s={parentOrOwner:o,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==p.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function a(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};t.exports=a},{124:124}],79:[function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===A?e.documentElement:e.firstChild:null}function i(e){return e.getAttribute&&e.getAttribute(k)||""}function a(e,t,n,r,o){var i;if(C.logTopLevelRenders){var a=e._currentElement.props,s=a.type;i="React mount: "+("string"==typeof s?s:s.displayName||s.name),console.time(i)}var u=E.mountComponent(e,n,null,m(e,t),o);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,F._mountImageIntoNode(u,t,e,r,n)}function s(e,t,n,r){var o=x.ReactReconcileTransaction.getPooled(!n&&g.useCreateElement);o.perform(a,null,e,t,o,n,r),x.ReactReconcileTransaction.release(o)}function u(e,t,n){for(E.unmountComponent(e,n),t.nodeType===A&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function l(e){var t=o(e);if(t){var n=v.getInstanceFromNode(t);return!(!n||!n._nativeParent)}}function c(e){var t=o(e),n=t&&v.getInstanceFromNode(t);return n&&!n._nativeParent?n:null}function p(e){var t=c(e);return t?t._nativeContainerInfo._topLevelWrapper:null}var d=e(8),f=e(10),h=e(28),v=(e(39),e(44)),m=e(45),g=e(49),y=e(64),C=e(70),b=(e(75),e(78)),_=e(86),E=e(91),T=e(100),x=e(101),P=e(163),N=e(141),w=e(170),S=e(147),M=e(150),k=(e(178),f.ID_ATTRIBUTE_NAME),R=f.ROOT_ATTRIBUTE_NAME,D=1,A=9,O=11,I={},L=1,U=function(){this.rootID=L++};U.prototype.isReactComponent={},U.prototype.render=function(){return this.props};var F={TopLevelWrapper:U,_instancesByReactRootID:I,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return F.scrollMonitor(n,function(){T.enqueueElementInternal(e,t),r&&T.enqueueCallbackInternal(e,r)}),e},_renderNewRootComponent:function(e,t,n,r){!t||t.nodeType!==D&&t.nodeType!==A&&t.nodeType!==O?w(!1):void 0,h.ensureScrollValueMonitoring();var o=N(e);x.batchedUpdates(s,o,t,n,r);var i=o._instance.rootID;return I[i]=o,o},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?w(!1):void 0,F._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){T.validateCallback(r,"ReactDOM.render"),y.isValidElement(t)?void 0:w(!1);var a=y(U,null,null,null,null,null,t),s=p(n);if(s){var u=s._currentElement,c=u.props;if(M(c,t)){var d=s._renderedComponent.getPublicInstance(),f=r&&function(){r.call(d)};return F._updateRootComponent(s,a,n,f),d}F.unmountComponentAtNode(n)}var h=o(n),v=h&&!!i(h),m=l(n),g=v&&!s&&!m,C=F._renderNewRootComponent(a,n,g,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):P)._renderedComponent.getPublicInstance();return r&&r.call(C),C},render:function(e,t,n){return F._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){!e||e.nodeType!==D&&e.nodeType!==A&&e.nodeType!==O?w(!1):void 0;var t=p(e);return t?(delete I[t._instance.rootID],x.batchedUpdates(u,t,e,!1),!0):(l(e),1===e.nodeType&&e.hasAttribute(R),!1)},_mountImageIntoNode:function(e,t,n,i,a){if(!t||t.nodeType!==D&&t.nodeType!==A&&t.nodeType!==O?w(!1):void 0,i){var s=o(t);if(b.canReuseMarkup(e,s))return void v.precacheNode(n,s);var u=s.getAttribute(b.CHECKSUM_ATTR_NAME);s.removeAttribute(b.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(b.CHECKSUM_ATTR_NAME,u);var c=e,p=r(c,l);" (client) "+c.substring(p-20,p+20)+"\n (server) "+l.substring(p-20,p+20),t.nodeType===A?w(!1):void 0}if(t.nodeType===A?w(!1):void 0,a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);d.insertTreeBefore(t,e,null)}else S(t,e),v.precacheNode(n,t.firstChild)}};_.measureMethods(F,"ReactMount",{_renderNewRootComponent:"_renderNewRootComponent",_mountImageIntoNode:"_mountImageIntoNode"}),t.exports=F},{10:10,100:100,101:101,141:141,147:147,150:150,163:163,170:170,178:178,28:28,39:39,44:44,45:45,49:49,64:64,70:70,75:75,78:78,8:8,86:86,91:91}],80:[function(e,t,n){"use strict";function r(e,t,n){return{type:p.INSERT_MARKUP,content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:p.MOVE_EXISTING,content:null,fromIndex:e._mountIndex,fromNode:d.getNativeNode(e),toIndex:n,afterNode:t}}function i(e,t){return{type:p.REMOVE_NODE,content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:p.SET_MARKUP,content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:p.TEXT_CONTENT,content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){c.processChildrenUpdates(e,t)}var c=e(36),p=e(81),d=(e(39),e(91)),f=e(31),h=e(130),v=e(170),m={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return f.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o){ -var i;return i=h(t),f.updateChildren(e,i,n,r,o),i},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=d.mountComponent(s,t,this,this._nativeContainerInfo,n);s._mountIndex=i++,o.push(u)}return o},updateTextContent:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&v(!1);var r=[s(e)];l(this,r)},updateMarkup:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&v(!1);var r=[a(e)];l(this,r)},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},i=this._reconcilerUpdateChildren(r,e,o,t,n);if(i||r){var a,s=null,c=0,p=0,f=null;for(a in i)if(i.hasOwnProperty(a)){var h=r&&r[a],v=i[a];h===v?(s=u(s,this.moveChild(h,f,p,c)),c=Math.max(h._mountIndex,c),h._mountIndex=p):(h&&(c=Math.max(h._mountIndex,c)),s=u(s,this._mountChildAtIndex(v,f,p,t,n))),p++,f=d.getNativeNode(v)}for(a in o)o.hasOwnProperty(a)&&(s=u(s,this._unmountChild(r[a],o[a])));s&&l(this,s),this._renderedChildren=i}},unmountChildren:function(e){var t=this._renderedChildren;f.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){return e._mountIndex>",x={array:i("array"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),any:a(),arrayOf:s,element:u(),instanceOf:l,node:f(),objectOf:p,oneOf:c,oneOfType:d,shape:h};t.exports=x},{136:136,162:162,64:64,87:87}],90:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=i.getPooled(null),this.useCreateElement=e}var o=e(179),i=e(5),a=e(26),s=e(28),u=e(73),l=e(121),c={initialize:u.getSelectionInformation,close:u.restoreSelection},p={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},f=[c,p,d],h={getTransactionWrappers:function(){return f},getReactMountReady:function(){return this.reactMountReady},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null}};o(r.prototype,l.Mixin,h),a.addPoolingTo(r),t.exports=r},{121:121,179:179,26:26,28:28,5:5,73:73}],91:[function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=e(92),i=(e(75),{mountComponent:function(e,t,n,o,i){var a=e.mountComponent(t,n,o,i);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(r,e),a},getNativeNode:function(e){return e.getNativeNode()},unmountComponent:function(e,t){o.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}});t.exports=i},{75:75,92:92}],92:[function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):i.addComponentAsRefTo(t,e,n)}function o(e,t,n){"function"==typeof e?e(null):i.removeComponentAsRefFrom(t,e,n)}var i=e(85),a={};a.attachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null===e||e===!1,r=null===t||t===!1;return n||r||t._owner!==e._owner||t.ref!==e.ref},a.detachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&o(n,e,t._owner)}},t.exports=a},{85:85}],93:[function(e,t,n){"use strict";var r={isBatchingUpdates:!1,batchedUpdates:function(e){}};t.exports=r},{}],94:[function(e,t,n){"use strict";function r(e,t){var n;try{return d.injection.injectBatchingStrategy(c),n=p.getPooled(t),n.perform(function(){var r=h(e),o=r.mountComponent(n,null,a(),f);return t||(o=l.addChecksumToMarkup(o)),o},null)}finally{p.release(n),d.injection.injectBatchingStrategy(s)}}function o(e){return u.isValidElement(e)?void 0:v(!1),r(e,!1)}function i(e){return u.isValidElement(e)?void 0:v(!1),r(e,!0)}var a=e(45),s=e(62),u=e(64),l=e(78),c=e(93),p=e(95),d=e(101),f=e(163),h=e(141),v=e(170);t.exports={renderToString:o,renderToStaticMarkup:i}},{101:101,141:141,163:163,170:170,45:45,62:62,64:64,78:78,93:93,95:95}],95:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1}var o=e(179),i=e(26),a=e(121),s=[],u={enqueue:function(){}},l={getTransactionWrappers:function(){return s},getReactMountReady:function(){return u},destructor:function(){}};o(r.prototype,a.Mixin,l),i.addPoolingTo(r),t.exports=r},{121:121,179:179,26:26}],96:[function(e,t,n){"use strict";function r(e,t){var n={};return function(r){n[t]=r,e.setState(n)}}var o={createStateSetter:function(e,t){return function(n,r,o,i,a,s){var u=t.call(e,n,r,o,i,a,s);u&&e.setState(u)}},createStateKeySetter:function(e,t){var n=e.__keySetters||(e.__keySetters={});return n[t]||(n[t]=r(e,t))}};o.Mixin={createStateSetter:function(e){return o.createStateSetter(this,e)},createStateKeySetter:function(e){return o.createStateKeySetter(this,e)}},t.exports=o},{}],97:[function(e,t,n){"use strict";var r=e(130),o={getChildMapping:function(e){return e?r(e):e},mergeChildMappings:function(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},o=[];for(var i in e)t.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var u in t){if(r.hasOwnProperty(u))for(a=0;an;n++){var r=y[n],o=r._pendingCallbacks;r._pendingCallbacks=null;var i;if(f.logTopLevelRenders){var s=r;r._currentElement.props===r._renderedComponent._currentElement&&(s=r._renderedComponent),i="React update: "+s.getName(),console.time(i)}if(v.performUpdateIfNecessary(r,e.reconcileTransaction),i&&console.timeEnd(i),o)for(var u=0;ur;){for(var s=Math.min(r+4096,a);s>r;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=o,n%=o}for(;i>r;r++)n+=t+=e.charCodeAt(r);return t%=o,n%=o,t|n<<16}var o=65521;t.exports=r},{}],125:[function(e,t,n){"use strict";var r=!1;t.exports=r},{}],126:[function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};t.exports=r},{}],127:[function(e,t,n){"use strict";function r(e,t,n){var r=null==t||"boolean"==typeof t||""===t;if(r)return"";var o=isNaN(t);return o||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var o=e(3),i=(e(178),o.isUnitlessNumber);t.exports=r},{178:178,3:3}],128:[function(e,t,n){"use strict";function r(e){return i[e]}function o(e){return(""+e).replace(a,r)}var i={"&":"&",">":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;t.exports=o},{}],129:[function(e,t,n){"use strict";function r(e){if(null==e)return null;if(1===e.nodeType)return e;var t=i.get(e);return t?(t=a(t),t?o.getNodeFromInstance(t):null):void s(("function"==typeof e.render,!1))}var o=(e(39),e(44)),i=e(74),a=e(137),s=e(170);e(178);t.exports=r},{137:137,170:170,178:178,39:39,44:44,74:74}],130:[function(e,t,n){"use strict";function r(e,t,n){var r=e,o=void 0===r[n];o&&null!=t&&(r[n]=t)}function o(e){if(null==e)return e;var t={};return i(e,r,t),t}var i=(e(23),e(151));e(178);t.exports=o},{151:151,178:178,23:23}],131:[function(e,t,n){"use strict";var r=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=r},{}],132:[function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=r},{}],133:[function(e,t,n){"use strict";function r(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var o=e(132),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=r},{132:132}],134:[function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return r?!!n[r]:!1}function o(e){return r}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=o},{}],135:[function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}t.exports=r},{}],136:[function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[i]);return"function"==typeof t?t:void 0}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";t.exports=r},{}],137:[function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.NATIVE?e._renderedComponent:t===o.EMPTY?null:void 0}var o=e(83);t.exports=r},{83:83}],138:[function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function i(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,t>=i&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}t.exports=i},{}],139:[function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=e(156),i=null;t.exports=r},{156:156}],140:[function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(s[e])return s[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var i=e(156),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};i.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),t.exports=o},{156:156}],141:[function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e){var t;if(null===e||e===!1)t=s.create(o);else if("object"==typeof e){var n=e;!n||"function"!=typeof n.type&&"string"!=typeof n.type?l(!1):void 0,t="string"==typeof n.type?u.createInternalComponent(n):r(n.type)?new n.type(n):new c(n)}else"string"==typeof e||"number"==typeof e?t=u.createInstanceForText(e):l(!1);return t._mountIndex=0,t._mountImage=null,t}var i=e(179),a=e(38),s=e(66),u=e(82),l=e(170),c=(e(178),function(e){this.construct(e)});i(c.prototype,a.Mixin,{_instantiateReactComponent:o}),t.exports=o},{170:170,178:178,179:179,38:38,66:66,82:82}],142:[function(e,t,n){"use strict";function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=e(156);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=r},{156:156}],143:[function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&o[e.type]||"textarea"===t)}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=r},{}],144:[function(e,t,n){"use strict";function r(e){return o.isValidElement(e)?void 0:i(!1),e}var o=e(64),i=e(170);t.exports=r},{170:170,64:64}],145:[function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=e(128);t.exports=r},{128:128}],146:[function(e,t,n){"use strict";var r=e(79);t.exports=r.renderSubtreeIntoContainer},{79:79}],147:[function(e,t,n){"use strict";var r=e(156),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=e(126),s=a(function(e,t){e.innerHTML=t});if(r.canUseDOM){var u=document.createElement("div");u.innerHTML=" ",""===u.innerHTML&&(s=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),u=null}t.exports=s},{126:126,156:156}],148:[function(e,t,n){"use strict";var r=e(156),o=e(128),i=e(147),a=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){i(e,o(t))})),t.exports=a},{128:128,147:147,156:156}],149:[function(e,t,n){"use strict";function r(e,t,n){return!o(e.props,t)||!o(e.state,n)}var o=e(177);t.exports=r},{177:177}],150:[function(e,t,n){"use strict";function r(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}t.exports=r},{}],151:[function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function o(e,t,n,i){var d=typeof e;if("undefined"!==d&&"boolean"!==d||(e=null),null===e||"string"===d||"number"===d||a.isValidElement(e))return n(i,e,""===t?c+r(e,0):t),1;var f,h,v=0,m=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g-1},matchesSelector:function(e,t){var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||function(t){return r(e,t)};return n.call(e,t)}};t.exports=i},{170:170}],155:[function(e,t,n){"use strict";var r=e(162),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};t.exports=o},{162:162}],156:[function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=o},{}],157:[function(e,t,n){"use strict";function r(e){return e.replace(o,function(e,t){return t.toUpperCase()})}var o=/-(.)/g;t.exports=r},{}],158:[function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=e(157),i=/^-ms-/;t.exports=r},{157:157}],159:[function(e,t,n){"use strict";function r(e,t){return e&&t?e===t?!0:o(e)?!1:o(t)?r(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var o=e(172);t.exports=r},{172:172}],160:[function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?a(!1):void 0,"number"!=typeof t?a(!1):void 0,0===t||t-1 in e?void 0:a(!1),"function"==typeof e.callee?a(!1):void 0,e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),o=0;t>o;o++)r[o]=e[o];return r}function o(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function i(e){return o(e)?Array.isArray(e)?e.slice():r(e):[e]}var a=e(170);t.exports=i},{170:170}],161:[function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function o(e,t){var n=l;l?void 0:u(!1);var o=r(e),i=o&&s(o);if(i){n.innerHTML=i[1]+e+i[2];for(var c=i[0];c--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t?void 0:u(!1),a(p).forEach(t));for(var d=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return d}var i=e(156),a=e(160),s=e(166),u=e(170),l=i.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=o},{156:156,160:160,166:166,170:170}],162:[function(e,t,n){"use strict";function r(e){return function(){return e}}function o(){}o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],163:[function(e,t,n){"use strict";var r={};t.exports=r},{}],164:[function(e,t,n){"use strict";function r(e){try{e.focus()}catch(t){}}t.exports=r},{}],165:[function(e,t,n){"use strict";function r(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=r},{}],166:[function(e,t,n){"use strict";function r(e){return a?void 0:i(!1),d.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||("*"===e?a.innerHTML="":a.innerHTML="<"+e+">",s[e]=!a.firstChild),s[e]?d[e]:null}var o=e(156),i=e(170),a=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'"],l=[1,"","
    "],c=[3,"","
    "],p=[1,'',""],d={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c},f=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];f.forEach(function(e){d[e]=p,s[e]=!0}),t.exports=r},{156:156,170:170}],167:[function(e,t,n){"use strict";function r(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=r},{}],168:[function(e,t,n){"use strict";function r(e){return e.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;t.exports=r},{}],169:[function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=e(168),i=/^ms-/;t.exports=r},{168:168}],170:[function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}t.exports=r},{}],171:[function(e,t,n){"use strict";function r(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=r},{}],172:[function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=e(171);t.exports=r},{171:171}],173:[function(e,t,n){"use strict";var r=e(170),o=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)?void 0:r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};t.exports=o},{170:170}],174:[function(e,t,n){"use strict";var r=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=r},{}],175:[function(e,t,n){"use strict";function r(e,t,n){if(!e)return null;var r={};for(var i in e)o.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],176:[function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=r},{}],177:[function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a8&&11>=T),P=32,w=String.fromCharCode(P),S=f.topLevelTypes,M={beforeInput:{phasedRegistrationNames:{bubbled:C({onBeforeInput:null}),captured:C({onBeforeInputCapture:null})},dependencies:[S.topCompositionEnd,S.topKeyPress,S.topTextInput,S.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:C({onCompositionEnd:null}),captured:C({onCompositionEndCapture:null})},dependencies:[S.topBlur,S.topCompositionEnd,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:C({onCompositionStart:null}),captured:C({onCompositionStartCapture:null})},dependencies:[S.topBlur,S.topCompositionStart,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:C({onCompositionUpdate:null}),captured:C({onCompositionUpdateCapture:null})},dependencies:[S.topBlur,S.topCompositionUpdate,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]}},k=!1,R=null,D={eventTypes:M,extractEvents:function(e,t,n,r){return[l(e,t,n,r),d(e,t,n,r)]}};t.exports=D},{108:108,112:112,154:154,16:16,172:172,20:20,21:21}],3:[function(e,t,n){"use strict";function r(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var o={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},i=["Webkit","ms","Moz","O"];Object.keys(o).forEach(function(e){i.forEach(function(t){o[r(t,e)]=o[e]})});var a={background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}},s={isUnitlessNumber:o,shorthandPropertyExpansions:a};t.exports=s},{}],4:[function(e,t,n){"use strict";var r=e(3),o=e(154),i=(e(75),e(156),e(125)),a=e(167),s=e(174),u=(e(178),s(function(e){return a(e)})),l=!1,c="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(d){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];null!=o&&(n+=u(r)+":",n+=i(r,o,t)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=i(a,t[a],n);if("float"!==a&&"cssFloat"!==a||(a=c),s)o[a]=s;else{var u=l&&r.shorthandPropertyExpansions[a];if(u)for(var p in u)o[p]="";else o[a]=""}}}};t.exports=f},{125:125,154:154,156:156,167:167,174:174,178:178,3:3,75:75}],5:[function(e,t,n){"use strict";function r(){this._callbacks=null,this._contexts=null}var o=e(179),i=e(26),a=e(168);o(r.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){e.length!==t.length?a(!1):void 0,this._callbacks=null,this._contexts=null;for(var n=0;n8));var L=!1;_.canUseDOM&&(L=P("input")&&(!("documentMode"in document)||document.documentMode>11));var U={get:function(){return O.get.call(this)},set:function(e){A=""+e,O.set.call(this,e)}},F={eventTypes:k,extractEvents:function(e,t,n,o){var i,a,s=t?E.getNodeFromInstance(t):window;if(r(s)?I?i=u:a=l:w(s)?L?i=f:(i=v,a=h):m(s)&&(i=g),i){var c=i(e,t);if(c){var p=x.getPooled(k.change,c,n,o);return p.type="change",b.accumulateTwoPhaseDispatches(p),p}}a&&a(e,s,t)}};t.exports=F},{110:110,133:133,140:140,141:141,154:154,16:16,17:17,172:172,20:20,44:44,99:99}],7:[function(e,t,n){"use strict";function r(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firstChild}function o(e,t,n){c.insertTreeBefore(e,t,n)}function i(e,t,n){Array.isArray(t)?s(e,t[0],t[1],n):m(e,t,n)}function a(e,t){if(Array.isArray(t)){var n=t[1];t=t[0],u(e,t,n),e.removeChild(n)}e.removeChild(t)}function s(e,t,n,r){for(var o=t;;){var i=o.nextSibling;if(m(e,o,r),o===n)break;o=i}}function u(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChild(r)}}function l(e,t,n){var r=e.parentNode,o=e.nextSibling;o===t?n&&m(r,document.createTextNode(n),o):n?(v(o,n),u(r,o,t)):u(r,e,t)}var c=e(8),p=e(12),d=e(80),f=(e(44),e(75),e(124)),h=e(145),v=e(146),m=f(function(e,t,n){e.insertBefore(t,n)}),g=p.dangerouslyReplaceNodeWithMarkup,y={dangerouslyReplaceNodeWithMarkup:g,replaceDelimitedText:l,processUpdates:function(e,t){for(var n=0;nt||e.hasOverloadedBooleanValue&&t===!1}var i=e(10),a=(e(44),e(52),e(75),e(143)),s=(e(178),new RegExp("^["+i.ATTRIBUTE_NAME_START_CHAR+"]["+i.ATTRIBUTE_NAME_CHAR+"]*$")),u={},l={},c={createMarkupForID:function(e){return i.ID_ATTRIBUTE_NAME+"="+a(e)},setAttributeForID:function(e,t){e.setAttribute(i.ID_ATTRIBUTE_NAME,t)},createMarkupForRoot:function(){return i.ROOT_ATTRIBUTE_NAME+'=""'},setAttributeForRoot:function(e){e.setAttribute(i.ROOT_ATTRIBUTE_NAME,"")},createMarkupForProperty:function(e,t){var n=i.properties.hasOwnProperty(e)?i.properties[e]:null;if(n){if(o(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+a(t)}return i.isCustomAttribute(e)?null==t?"":e+"="+a(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+a(t):""},setValueForProperty:function(e,t,n){var r=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else{if(o(r,n))return void this.deleteValueForProperty(e,t);if(r.mustUseProperty){var s=r.propertyName;r.hasSideEffects&&""+e[s]==""+n||(e[s]=n)}else{var u=r.attributeName,l=r.attributeNamespace;l?e.setAttributeNS(l,u,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?e.setAttribute(u,""):e.setAttribute(u,""+n)}}}else if(i.isCustomAttribute(t))return void c.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseProperty){var o=n.propertyName;n.hasBooleanValue?e[o]=!1:n.hasSideEffects&&""+e[o]==""||(e[o]="")}else e.removeAttribute(n.attributeName)}else i.isCustomAttribute(t)&&e.removeAttribute(t)}};t.exports=c},{10:10,143:143,178:178,44:44,52:52,75:75}],12:[function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var o=e(8),i=e(154),a=e(159),s=e(160),u=e(164),l=e(168),c=/^(<[^ \/>]+)/,p="data-danger-index",d={dangerouslyRenderMarkup:function(e){i.canUseDOM?void 0:l(!1);for(var t,n={},o=0;o-1?void 0:a(!1),!l.plugins[n]){t.extractEvents?void 0:a(!1),l.plugins[n]=t;var r=t.eventTypes;for(var i in r)o(r[i],t,i)?void 0:a(!1)}}}function o(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)?a(!1):void 0,l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];i(s,t,n)}return!0}return e.registrationName?(i(e.registrationName,t,n),!0):!1}function i(e,t,n){l.registrationNameModules[e]?a(!1):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=e(168),s=null,u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){s?a(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(u[n]?a(!1):void 0,u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=l},{168:168}],19:[function(e,t,n){"use strict";function r(e){return e===y.topMouseUp||e===y.topTouchEnd||e===y.topTouchCancel}function o(e){return e===y.topMouseMove||e===y.topTouchMove}function i(e){return e===y.topMouseDown||e===y.topTouchStart}function a(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=C.getNodeFromInstance(r),t?v.invokeGuardedCallbackWithCatch(o,n,e):v.invokeGuardedCallback(o,n,e),e.currentTarget=null}function s(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;oe&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),i.addPoolingTo(r),t.exports=r},{137:137,179:179,26:26}],22:[function(e,t,n){"use strict";var r=e(10),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_SIDE_EFFECTS,s=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,l=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:u,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,coords:0,crossOrigin:0,data:0,dateTime:0,"default":i,defer:i,dir:0,disabled:i,download:l,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,rel:0,required:i,reversed:i,role:0,rows:u,rowSpan:s,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:u,sizes:0,span:u,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:s,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:o|a,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,"typeof":0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{}};t.exports=c},{10:10}],23:[function(e,t,n){"use strict";function r(e){var t=/[=:]/g,n={"=":"=0",":":"=2"},r=(""+e).replace(t,function(e){return n[e]});return"$"+r}function o(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"},r="."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1);return(""+r).replace(t,function(e){return n[e]})}var i={escape:r,unescape:o};t.exports=i},{}],24:[function(e,t,n){"use strict";var r=e(76),o=e(94),i={linkState:function(e){return new r(this.state[e],o.createStateKeySetter(this,e))}};t.exports=i},{76:76,94:94}],25:[function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?l(!1):void 0}function o(e){r(e),null!=e.value||null!=e.onChange?l(!1):void 0}function i(e){r(e),null!=e.checked||null!=e.onChange?l(!1):void 0}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=e(87),u=e(86),l=e(168),c=(e(178),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),p={value:function(e,t,n){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func},d={},f={checkPropTypes:function(e,t,n){for(var r in p){if(p.hasOwnProperty(r))var o=p[r](t,r,e,u.prop);o instanceof Error&&!(o.message in d)&&(d[o.message]=!0,a(n))}},getValue:function(e){return e.valueLink?(o(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(i(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(o(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(i(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};t.exports=f},{168:168,178:178,86:86,87:87}],26:[function(e,t,n){"use strict";var r=e(168),o=function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)},i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},u=function(e,t,n,r,o){var i=this;if(i.instancePool.length){var a=i.instancePool.pop();return i.call(a,e,t,n,r,o),a}return new i(e,t,n,r,o)},l=function(e){var t=this;e instanceof t?void 0:r(!1),e.destructor(),t.instancePool.length=0||null!=t.is}function p(e){var t=e.type;l(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._nativeNode=null,this._nativeParent=null,this._rootNodeID=null,this._domID=null,this._nativeContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var d=e(179),f=e(1),h=e(4),v=e(8),m=e(9),g=e(10),y=e(11),C=e(16),b=e(17),_=e(18),E=e(28),T=e(35),x=e(41),N=e(43),P=e(44),w=e(51),S=e(53),M=e(54),k=e(58),R=(e(75),e(79)),D=e(93),A=(e(160),e(126)),O=e(168),I=(e(140),e(172)),L=(e(177),e(151),e(178),N),U=b.deleteListener,F=P.getNodeFromInstance,V=E.listenTo,B=_.registrationNameModules,j={string:!0,number:!0},W=I({style:null}),K=I({__html:null}),q={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},H=11,Y={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},z={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},G={listing:!0,pre:!0,textarea:!0},X=d({menuitem:!0},z),Q=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,$={},Z={}.hasOwnProperty,J=1;p.displayName="ReactDOMComponent",p.Mixin={mountComponent:function(e,t,n,o){this._rootNodeID=J++,this._domID=n._idCounter++,this._nativeParent=t,this._nativeContainerInfo=n;var i=this._currentElement.props;switch(this._tag){case"iframe":case"object":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(s,this);break;case"button":i=x.getNativeProps(this,i,t);break;case"input":w.mountWrapper(this,i,t),i=w.getNativeProps(this,i),e.getReactMountReady().enqueue(s,this);break;case"option":S.mountWrapper(this,i,t),i=S.getNativeProps(this,i);break;case"select":M.mountWrapper(this,i,t),i=M.getNativeProps(this,i),e.getReactMountReady().enqueue(s,this);break;case"textarea":k.mountWrapper(this,i,t),i=k.getNativeProps(this,i),e.getReactMountReady().enqueue(s,this)}r(this,i);var u,l;null!=t?(u=t._namespaceURI,l=t._tag):n._tag&&(u=n._namespaceURI,l=n._tag),(null==u||u===m.svg&&"foreignobject"===l)&&(u=m.html),u===m.html&&("svg"===this._tag?u=m.svg:"math"===this._tag&&(u=m.mathml)),this._namespaceURI=u;var c;if(e.useCreateElement){var p,d=n._ownerDocument;if(u===m.html)if("script"===this._tag){var h=d.createElement("div"),g=this._currentElement.type;h.innerHTML="<"+g+">",p=h.removeChild(h.firstChild)}else p=d.createElement(this._currentElement.type,i.is||null);else p=d.createElementNS(u,this._currentElement.type);P.precacheNode(this,p),this._flags|=L.hasCachedChildNodes,this._nativeParent||y.setAttributeForRoot(p),this._updateDOMProperties(null,i,e);var C=v(p);this._createInitialChildren(e,i,o,C),c=C}else{var b=this._createOpenTagMarkupAndPutListeners(e,i),_=this._createContentMarkup(e,i,o);c=!_&&z[this._tag]?b+"/>":b+">"+_+""}switch(this._tag){case"button":case"input":case"select":case"textarea":i.autoFocus&&e.getReactMountReady().enqueue(f.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(a,this)}return c},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(B.hasOwnProperty(r))i&&o(this,r,i,e);else{r===W&&(i&&(i=this._previousStyleCopy=d({},t.style)),i=h.createMarkupForStyles(i,this));var a=null;null!=this._tag&&c(this._tag,t)?q.hasOwnProperty(r)||(a=y.createMarkupForCustomAttribute(r,i)):a=y.createMarkupForProperty(r,i),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._nativeParent||(n+=" "+y.createMarkupForRoot()),n+=" "+y.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=j[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=A(i);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return G[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&v.queueHTML(r,o.__html);else{var i=j[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)v.queueText(r,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u"},receiveComponent:function(){},getNativeNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),t.exports=a},{179:179,44:44,8:8}],48:[function(e,t,n){"use strict";function r(e){return o.createFactory(e)}var o=e(64),i=(e(65),e(173)),a=i({a:"a",abbr:"abbr",address:"address",area:"area",article:"article",aside:"aside",audio:"audio",b:"b",base:"base",bdi:"bdi",bdo:"bdo",big:"big",blockquote:"blockquote",body:"body",br:"br",button:"button",canvas:"canvas",caption:"caption",cite:"cite",code:"code",col:"col",colgroup:"colgroup",data:"data",datalist:"datalist",dd:"dd",del:"del",details:"details",dfn:"dfn",dialog:"dialog",div:"div",dl:"dl",dt:"dt",em:"em",embed:"embed",fieldset:"fieldset",figcaption:"figcaption",figure:"figure",footer:"footer",form:"form",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",head:"head",header:"header",hgroup:"hgroup",hr:"hr",html:"html",i:"i",iframe:"iframe",img:"img",input:"input",ins:"ins",kbd:"kbd",keygen:"keygen",label:"label",legend:"legend",li:"li",link:"link",main:"main",map:"map",mark:"mark",menu:"menu",menuitem:"menuitem",meta:"meta",meter:"meter",nav:"nav",noscript:"noscript",object:"object",ol:"ol",optgroup:"optgroup",option:"option",output:"output",p:"p",param:"param",picture:"picture",pre:"pre",progress:"progress",q:"q",rp:"rp",rt:"rt",ruby:"ruby",s:"s",samp:"samp",script:"script",section:"section",select:"select",small:"small",source:"source",span:"span",strong:"strong",style:"style",sub:"sub",summary:"summary",sup:"sup",table:"table",tbody:"tbody",td:"td",textarea:"textarea",tfoot:"tfoot",th:"th",thead:"thead",time:"time",title:"title",tr:"tr",track:"track",u:"u",ul:"ul","var":"var",video:"video",wbr:"wbr",circle:"circle",clipPath:"clipPath",defs:"defs",ellipse:"ellipse",g:"g",image:"image",line:"line",linearGradient:"linearGradient",mask:"mask",path:"path",pattern:"pattern",polygon:"polygon",polyline:"polyline",radialGradient:"radialGradient",rect:"rect",stop:"stop",svg:"svg",text:"text",tspan:"tspan"},r);t.exports=a},{173:173,64:64,65:65}],49:[function(e,t,n){"use strict";var r={useCreateElement:!0};t.exports=r},{}],50:[function(e,t,n){"use strict";var r=e(7),o=e(44),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};t.exports=i},{44:44,7:7}],51:[function(e,t,n){"use strict";function r(){this._rootNodeID&&d.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=u.executeOnChange(t,e);c.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=l.getNodeFromInstance(this),a=i;a.parentNode;)a=a.parentNode;for(var s=a.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),d=0;dt.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),i=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=l(e,o),u=l(e,i);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=e(154),l=e(136),c=e(137),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:p?o:i,setOffsets:p?a:s};t.exports=d},{136:136,137:137,154:154}],56:[function(e,t,n){"use strict";var r=e(63),o=e(92),i=e(100);r.inject();var a={renderToString:o.renderToString,renderToStaticMarkup:o.renderToStaticMarkup,version:i};t.exports=a},{100:100,63:63,92:92}],57:[function(e,t,n){"use strict";var r=e(179),o=e(7),i=e(8),a=e(44),s=(e(75),e(126)),u=e(168),l=(e(151),function(e){this._currentElement=e,this._stringText=""+e,this._nativeNode=null,this._nativeParent=null,this._domID=null,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});r(l.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,u=" react-text: "+o+" ",l=" /react-text ";if(this._domID=o,this._nativeParent=t,e.useCreateElement){var c=n._ownerDocument,p=c.createComment(u),d=c.createComment(l),f=i(c.createDocumentFragment());return i.queueChild(f,i(p)),this._stringText&&i.queueChild(f,i(c.createTextNode(this._stringText))),i.queueChild(f,i(d)),a.precacheNode(this,p),this._closingComment=d,f}var h=s(this._stringText);return e.renderToStaticMarkup?h:""+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getNativeNode();o.replaceDelimitedText(r[0],r[1],n)}}},getNativeNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=a.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n?u(!1):void 0,8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._nativeNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,a.uncacheNode(this)}}),t.exports=l},{126:126,151:151,168:168,179:179,44:44,7:7,75:75,8:8}],58:[function(e,t,n){"use strict";function r(){this._rootNodeID&&d.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=u.executeOnChange(t,e);return c.asap(r,this),n}var i=e(179),a=e(14),s=e(11),u=e(25),l=e(44),c=e(99),p=e(168),d=(e(178),{getNativeProps:function(e,t){null!=t.dangerouslySetInnerHTML?p(!1):void 0;var n=i({},a.getNativeProps(e,t),{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return n},mountWrapper:function(e,t){var n=t.defaultValue,r=t.children;null!=r&&(null!=n?p(!1):void 0,Array.isArray(r)&&(r.length<=1?void 0:p(!1),r=r[0]),n=""+r),null==n&&(n="");var i=u.getValue(t);e._wrapperState={initialValue:""+(null!=i?i:n),listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getValue(t);null!=n&&s.setValueForProperty(l.getNodeFromInstance(e),"value",""+n)}});t.exports=d},{11:11,14:14,168:168,178:178,179:179,25:25,44:44,99:99}],59:[function(e,t,n){"use strict";function r(e,t){"_nativeNode"in e?void 0:u(!1),"_nativeNode"in t?void 0:u(!1);for(var n=0,r=e;r;r=r._nativeParent)n++;for(var o=0,i=t;i;i=i._nativeParent)o++;for(;n-o>0;)e=e._nativeParent,n--;for(;o-n>0;)t=t._nativeParent,o--;for(var a=n;a--;){if(e===t)return e;e=e._nativeParent,t=t._nativeParent}return null}function o(e,t){"_nativeNode"in e?void 0:u(!1),"_nativeNode"in t?void 0:u(!1);for(;t;){if(t===e)return!0;t=t._nativeParent}return!1}function i(e){return"_nativeNode"in e?void 0:u(!1),e._nativeParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._nativeParent;var o;for(o=r.length;o-- >0;)t(r[o],!1,n);for(o=0;o0;)n(u[l],!1,i)}var u=e(168);t.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:i,traverseTwoPhase:a,traverseEnterLeave:s}},{168:168}],60:[function(e,t,n){"use strict";var r,o=(e(10),e(18),e(178),{onCreateMarkupForProperty:function(e,t){r(e)},onSetValueForProperty:function(e,t,n){r(t)},onDeleteValueForProperty:function(e,t){r(t)}});t.exports=o},{10:10,178:178,18:18}],61:[function(e,t,n){"use strict";function r(e,t,n,r,o,i){}function o(e){}var i=(e(154),e(176),e(178),[]),a={addDevtool:function(e){i.push(e)},removeDevtool:function(e){for(var t=0;t1){for(var f=Array(d),h=0;d>h;h++)f[h]=arguments[h+2];i.children=f}if(e&&e.defaultProps){var v=e.defaultProps;for(r in v)void 0===i[r]&&(i[r]=v[r])}return s(e,u,l,c,p,o.current,i)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceKey=function(e,t){var n=s(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},s.cloneElement=function(e,t,n){var i,u=r({},e.props),l=e.key,c=e.ref,p=e._self,d=e._source,f=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,f=o.current),void 0!==t.key&&(l=""+t.key);var h;e.type&&e.type.defaultProps&&(h=e.type.defaultProps);for(i in t)t.hasOwnProperty(i)&&!a.hasOwnProperty(i)&&(void 0===t[i]&&void 0!==h?u[i]=h[i]:u[i]=t[i])}var v=arguments.length-2;if(1===v)u.children=n;else if(v>1){for(var m=Array(v),g=0;v>g;g++)m[g]=arguments[g+2];u.children=m}return s(e.type,l,c,p,d,f,u)},s.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.exports=s},{123:123,178:178,179:179,39:39}],65:[function(e,t,n){"use strict";function r(){if(p.current){var e=p.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e,t){e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,i("uniqueKey",e,t))}function i(e,t,n){var o=r();if(!o){var i="string"==typeof n?n:n.displayName||n.name;i&&(o=" Check the top-level render call using <"+i+">.")}var a=h[e]||(h[e]={});if(a[o])return null;a[o]=!0;var s={parentOrOwner:o,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==p.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function a(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};t.exports=a},{122:122}],78:[function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===D?e.documentElement:e.firstChild:null}function i(e){return e.getAttribute&&e.getAttribute(M)||""}function a(e,t,n,r,o){var i;if(C.logTopLevelRenders){var a=e._currentElement.props,s=a.type;i="React mount: "+("string"==typeof s?s:s.displayName||s.name),console.time(i)}var u=_.mountComponent(e,n,null,m(e,t),o);i&&console.timeEnd(i),e._renderedComponent._topLevelWrapper=e,U._mountImageIntoNode(u,t,e,r,n)}function s(e,t,n,r){var o=T.ReactReconcileTransaction.getPooled(!n&&g.useCreateElement);o.perform(a,null,e,t,o,n,r),T.ReactReconcileTransaction.release(o)}function u(e,t,n){for(_.unmountComponent(e,n),t.nodeType===D&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function l(e){var t=o(e);if(t){var n=v.getInstanceFromNode(t);return!(!n||!n._nativeParent)}}function c(e){var t=o(e),n=t&&v.getInstanceFromNode(t);return n&&!n._nativeParent?n:null}function p(e){var t=c(e);return t?t._nativeContainerInfo._topLevelWrapper:null}var d=e(8),f=e(10),h=e(28),v=(e(39),e(44)),m=e(45),g=e(49),y=e(64),C=e(70),b=(e(75),e(77)),_=e(89),E=e(98),T=e(99),x=e(161),N=e(139),P=e(168),w=e(145),S=e(148),M=(e(178),f.ID_ATTRIBUTE_NAME),k=f.ROOT_ATTRIBUTE_NAME,R=1,D=9,A=11,O={},I=1,L=function(){this.rootID=I++};L.prototype.isReactComponent={},L.prototype.render=function(){return this.props};var U={TopLevelWrapper:L,_instancesByReactRootID:O,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return U.scrollMonitor(n,function(){E.enqueueElementInternal(e,t),r&&E.enqueueCallbackInternal(e,r)}),e},_renderNewRootComponent:function(e,t,n,r){!t||t.nodeType!==R&&t.nodeType!==D&&t.nodeType!==A?P(!1):void 0,h.ensureScrollValueMonitoring();var o=N(e);T.batchedUpdates(s,o,t,n,r);var i=o._instance.rootID;return O[i]=o,o},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?P(!1):void 0,U._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){E.validateCallback(r,"ReactDOM.render"),y.isValidElement(t)?void 0:P(!1);var a=y(L,null,null,null,null,null,t),s=p(n);if(s){var u=s._currentElement,c=u.props;if(S(c,t)){var d=s._renderedComponent.getPublicInstance(),f=r&&function(){r.call(d)};return U._updateRootComponent(s,a,n,f),d}U.unmountComponentAtNode(n)}var h=o(n),v=h&&!!i(h),m=l(n),g=v&&!s&&!m,C=U._renderNewRootComponent(a,n,g,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):x)._renderedComponent.getPublicInstance();return r&&r.call(C),C},render:function(e,t,n){return U._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){!e||e.nodeType!==R&&e.nodeType!==D&&e.nodeType!==A?P(!1):void 0;var t=p(e);return t?(delete O[t._instance.rootID],T.batchedUpdates(u,t,e,!1),!0):(l(e),1===e.nodeType&&e.hasAttribute(k),!1)},_mountImageIntoNode:function(e,t,n,i,a){if(!t||t.nodeType!==R&&t.nodeType!==D&&t.nodeType!==A?P(!1):void 0,i){var s=o(t);if(b.canReuseMarkup(e,s))return void v.precacheNode(n,s);var u=s.getAttribute(b.CHECKSUM_ATTR_NAME);s.removeAttribute(b.CHECKSUM_ATTR_NAME);var l=s.outerHTML;s.setAttribute(b.CHECKSUM_ATTR_NAME,u);var c=e,p=r(c,l);" (client) "+c.substring(p-20,p+20)+"\n (server) "+l.substring(p-20,p+20),t.nodeType===D?P(!1):void 0}if(t.nodeType===D?P(!1):void 0,a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);d.insertTreeBefore(t,e,null)}else w(t,e),v.precacheNode(n,t.firstChild)}};t.exports=U},{10:10,139:139,145:145,148:148,161:161,168:168,178:178,28:28,39:39,44:44,45:45,49:49,64:64,70:70,75:75,77:77,8:8,89:89,98:98,99:99}],79:[function(e,t,n){"use strict";function r(e,t,n){return{type:p.INSERT_MARKUP,content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:p.MOVE_EXISTING,content:null,fromIndex:e._mountIndex,fromNode:d.getNativeNode(e),toIndex:n,afterNode:t}}function i(e,t){return{type:p.REMOVE_NODE,content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:p.SET_MARKUP,content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:p.TEXT_CONTENT,content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){c.processChildrenUpdates(e,t)}var c=e(36),p=(e(75),e(80)),d=(e(39),e(89)),f=e(31),h=(e(160),e(128)),v=e(168),m={Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return f.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o){var i;return i=h(t),f.updateChildren(e,i,n,r,o),i},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=d.mountComponent(s,t,this,this._nativeContainerInfo,n);s._mountIndex=i++,o.push(u)}return o; +},updateTextContent:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&v(!1);var r=[s(e)];l(this,r)},updateMarkup:function(e){var t=this._renderedChildren;f.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&v(!1);var r=[a(e)];l(this,r)},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},i=this._reconcilerUpdateChildren(r,e,o,t,n);if(i||r){var a,s=null,c=0,p=0,f=null;for(a in i)if(i.hasOwnProperty(a)){var h=r&&r[a],v=i[a];h===v?(s=u(s,this.moveChild(h,f,p,c)),c=Math.max(h._mountIndex,c),h._mountIndex=p):(h&&(c=Math.max(h._mountIndex,c)),s=u(s,this._mountChildAtIndex(v,f,p,t,n))),p++,f=d.getNativeNode(v)}for(a in o)o.hasOwnProperty(a)&&(s=u(s,this._unmountChild(r[a],o[a])));s&&l(this,s),this._renderedChildren=i}},unmountChildren:function(e){var t=this._renderedChildren;f.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){return e._mountIndex>",x={array:i("array"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),any:a(),arrayOf:s,element:u(),instanceOf:l,node:f(),objectOf:p,oneOf:c,oneOfType:d,shape:h};t.exports=x},{134:134,160:160,64:64,85:85}],88:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=i.getPooled(null),this.useCreateElement=e}var o=e(179),i=e(5),a=e(26),s=e(28),u=e(73),l=e(119),c={initialize:u.getSelectionInformation,close:u.restoreSelection},p={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},d={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},f=[c,p,d],h={getTransactionWrappers:function(){return f},getReactMountReady:function(){return this.reactMountReady},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){i.release(this.reactMountReady),this.reactMountReady=null}};o(r.prototype,l.Mixin,h),a.addPoolingTo(r),t.exports=r},{119:119,179:179,26:26,28:28,5:5,73:73}],89:[function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=e(90),i=(e(75),e(168)),a={mountComponent:function(e,t,n,o,i){var a=e.mountComponent(t,n,o,i);return e._currentElement&&null!=e._currentElement.ref&&t.getReactMountReady().enqueue(r,e),a},getNativeNode:function(e){return e.getNativeNode()},unmountComponent:function(e,t){o.detachRefs(e,e._currentElement),e.unmountComponent(t)},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t,n){return e._updateBatchNumber!==n?void(null!=e._updateBatchNumber&&e._updateBatchNumber!==n+1?i(!1):void 0):void e.performUpdateIfNecessary(t)}};t.exports=a},{168:168,75:75,90:90}],90:[function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):i.addComponentAsRefTo(t,e,n)}function o(e,t,n){"function"==typeof e?e(null):i.removeComponentAsRefFrom(t,e,n)}var i=e(84),a={};a.attachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null===e||e===!1,r=null===t||t===!1;return n||r||t._owner!==e._owner||t.ref!==e.ref},a.detachRefs=function(e,t){if(null!==t&&t!==!1){var n=t.ref;null!=n&&o(n,e,t._owner)}},t.exports=a},{84:84}],91:[function(e,t,n){"use strict";var r={isBatchingUpdates:!1,batchedUpdates:function(e){}};t.exports=r},{}],92:[function(e,t,n){"use strict";function r(e,t){var n;try{return f.injection.injectBatchingStrategy(p),n=d.getPooled(t),n.perform(function(){var r=v(e),o=c.mountComponent(r,n,null,a(),h);return t||(o=l.addChecksumToMarkup(o)),o},null)}finally{d.release(n),f.injection.injectBatchingStrategy(s)}}function o(e){return u.isValidElement(e)?void 0:m(!1),r(e,!1)}function i(e){return u.isValidElement(e)?void 0:m(!1),r(e,!0)}var a=e(45),s=e(62),u=e(64),l=(e(75),e(77)),c=e(89),p=e(91),d=e(93),f=e(99),h=e(161),v=e(139),m=e(168);t.exports={renderToString:o,renderToStaticMarkup:i}},{139:139,161:161,168:168,45:45,62:62,64:64,75:75,77:77,89:89,91:91,93:93,99:99}],93:[function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1}var o=e(179),i=e(26),a=e(119),s=[],u={enqueue:function(){}},l={getTransactionWrappers:function(){return s},getReactMountReady:function(){return u},destructor:function(){},checkpoint:function(){},rollback:function(){}};o(r.prototype,a.Mixin,l),i.addPoolingTo(r),t.exports=r},{119:119,179:179,26:26}],94:[function(e,t,n){"use strict";function r(e,t){var n={};return function(r){n[t]=r,e.setState(n)}}var o={createStateSetter:function(e,t){return function(n,r,o,i,a,s){var u=t.call(e,n,r,o,i,a,s);u&&e.setState(u)}},createStateKeySetter:function(e,t){var n=e.__keySetters||(e.__keySetters={});return n[t]||(n[t]=r(e,t))}};o.Mixin={createStateSetter:function(e){return o.createStateSetter(this,e)},createStateKeySetter:function(e){return o.createStateKeySetter(this,e)}},t.exports=o},{}],95:[function(e,t,n){"use strict";var r=e(128),o={getChildMapping:function(e){return e?r(e):e},mergeChildMappings:function(e,t){function n(n){return t.hasOwnProperty(n)?t[n]:e[n]}e=e||{},t=t||{};var r={},o=[];for(var i in e)t.hasOwnProperty(i)?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var u in t){if(r.hasOwnProperty(u))for(a=0;an;n++){var r=g[n],o=r._pendingCallbacks;r._pendingCallbacks=null;var i;if(f.logTopLevelRenders){var s=r;r._currentElement.props===r._renderedComponent._currentElement&&(s=r._renderedComponent),i="React update: "+s.getName(),console.time(i)}if(h.performUpdateIfNecessary(r,e.reconcileTransaction,y),i&&console.timeEnd(i),o)for(var u=0;ur;){for(var s=Math.min(r+4096,a);s>r;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=o,n%=o}for(;i>r;r++)n+=t+=e.charCodeAt(r);return t%=o,n%=o,t|n<<16}var o=65521;t.exports=r},{}],123:[function(e,t,n){"use strict";var r=!1;t.exports=r},{}],124:[function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};t.exports=r},{}],125:[function(e,t,n){"use strict";function r(e,t,n){var r=null==t||"boolean"==typeof t||""===t;if(r)return"";var o=isNaN(t);return o||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var o=e(3),i=(e(178),o.isUnitlessNumber);t.exports=r},{178:178,3:3}],126:[function(e,t,n){"use strict";function r(e){return i[e]}function o(e){return(""+e).replace(a,r)}var i={"&":"&",">":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;t.exports=o},{}],127:[function(e,t,n){"use strict";function r(e){if(null==e)return null;if(1===e.nodeType)return e;var t=i.get(e);return t?(t=a(t),t?o.getNodeFromInstance(t):null):void s(("function"==typeof e.render,!1))}var o=(e(39),e(44)),i=e(74),a=e(135),s=e(168);e(178);t.exports=r},{135:135,168:168,178:178,39:39,44:44,74:74}],128:[function(e,t,n){"use strict";function r(e,t,n){var r=e,o=void 0===r[n];o&&null!=t&&(r[n]=t)}function o(e){if(null==e)return e;var t={};return i(e,r,t),t}var i=(e(23),e(149));e(178);t.exports=o},{149:149,178:178,23:23}],129:[function(e,t,n){"use strict";var r=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=r},{}],130:[function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=r},{}],131:[function(e,t,n){"use strict";function r(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var o=e(130),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=r},{130:130}],132:[function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return r?!!n[r]:!1}function o(e){return r}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=o},{}],133:[function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}t.exports=r},{}],134:[function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[i]);return"function"==typeof t?t:void 0}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";t.exports=r},{}],135:[function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.NATIVE?e._renderedComponent:t===o.EMPTY?null:void 0}var o=e(82);t.exports=r},{82:82}],136:[function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function i(e,t){for(var n=r(e),i=0,a=0;n;){if(3===n.nodeType){if(a=i+n.textContent.length,t>=i&&a>=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}t.exports=i},{}],137:[function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=e(154),i=null;t.exports=r},{154:154}],138:[function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(s[e])return s[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var i=e(154),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};i.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),t.exports=o},{154:154}],139:[function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e){var t,n=null===e||e===!1;if(n)t=s.create(o);else if("object"==typeof e){var i=e;!i||"function"!=typeof i.type&&"string"!=typeof i.type?l(!1):void 0,t="string"==typeof i.type?u.createInternalComponent(i):r(i.type)?new i.type(i):new c(i)}else"string"==typeof e||"number"==typeof e?t=u.createInstanceForText(e):l(!1);return t._mountIndex=0,t._mountImage=null,t}var i=e(179),a=e(38),s=e(66),u=e(81),l=(e(75),e(168)),c=(e(178),function(e){this.construct(e)});i(c.prototype,a.Mixin,{_instantiateReactComponent:o});t.exports=o},{168:168,178:178,179:179,38:38,66:66,75:75,81:81}],140:[function(e,t,n){"use strict";function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=e(154);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=r},{154:154}],141:[function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&o[e.type]||"textarea"===t)}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=r},{}],142:[function(e,t,n){"use strict";function r(e){return o.isValidElement(e)?void 0:i(!1),e}var o=e(64),i=e(168);t.exports=r},{168:168,64:64}],143:[function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=e(126);t.exports=r},{126:126}],144:[function(e,t,n){"use strict";var r=e(78);t.exports=r.renderSubtreeIntoContainer},{78:78}],145:[function(e,t,n){"use strict";var r=e(154),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=e(124),s=a(function(e,t){e.innerHTML=t});if(r.canUseDOM){var u=document.createElement("div");u.innerHTML=" ",""===u.innerHTML&&(s=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),u=null}t.exports=s},{124:124,154:154}],146:[function(e,t,n){"use strict";var r=e(154),o=e(126),i=e(145),a=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){i(e,o(t))})),t.exports=a},{126:126,145:145,154:154}],147:[function(e,t,n){"use strict";function r(e,t,n){return!o(e.props,t)||!o(e.state,n)}var o=e(177);t.exports=r},{177:177}],148:[function(e,t,n){"use strict";function r(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}t.exports=r},{}],149:[function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function o(e,t,n,i){var d=typeof e;if("undefined"!==d&&"boolean"!==d||(e=null),null===e||"string"===d||"number"===d||a.isValidElement(e))return n(i,e,""===t?c+r(e,0):t),1;var f,h,v=0,m=""===t?c:t+p;if(Array.isArray(e))for(var g=0;g-1},matchesSelector:function(e,t){var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||function(t){return r(e,t)};return n.call(e,t)}};t.exports=i},{168:168}],153:[function(e,t,n){"use strict";var r=e(160),o={listen:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!1),{remove:function(){e.removeEventListener(t,n,!1)}}):e.attachEvent?(e.attachEvent("on"+t,n),{remove:function(){e.detachEvent("on"+t,n)}}):void 0},capture:function(e,t,n){return e.addEventListener?(e.addEventListener(t,n,!0),{remove:function(){e.removeEventListener(t,n,!0)}}):{remove:r}},registerDefault:function(){}};t.exports=o},{160:160}],154:[function(e,t,n){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=o},{}],155:[function(e,t,n){"use strict";function r(e){return e.replace(o,function(e,t){return t.toUpperCase()})}var o=/-(.)/g;t.exports=r},{}],156:[function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=e(155),i=/^-ms-/;t.exports=r},{155:155}],157:[function(e,t,n){"use strict";function r(e,t){return e&&t?e===t?!0:o(e)?!1:o(t)?r(e,t.parentNode):e.contains?e.contains(t):e.compareDocumentPosition?!!(16&e.compareDocumentPosition(t)):!1:!1}var o=e(170);t.exports=r},{170:170}],158:[function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?a(!1):void 0,"number"!=typeof t?a(!1):void 0,0===t||t-1 in e?void 0:a(!1),"function"==typeof e.callee?a(!1):void 0,e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),o=0;t>o;o++)r[o]=e[o];return r}function o(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function i(e){return o(e)?Array.isArray(e)?e.slice():r(e):[e]}var a=e(168);t.exports=i},{168:168}],159:[function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function o(e,t){var n=l;l?void 0:u(!1);var o=r(e),i=o&&s(o);if(i){n.innerHTML=i[1]+e+i[2];for(var c=i[0];c--;)n=n.lastChild}else n.innerHTML=e;var p=n.getElementsByTagName("script");p.length&&(t?void 0:u(!1),a(p).forEach(t));for(var d=Array.from(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return d}var i=e(154),a=e(158),s=e(164),u=e(168),l=i.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;t.exports=o},{154:154,158:158,164:164,168:168}],160:[function(e,t,n){"use strict";function r(e){return function(){return e}}function o(){}o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],161:[function(e,t,n){"use strict";var r={};t.exports=r},{}],162:[function(e,t,n){"use strict";function r(e){try{e.focus()}catch(t){}}t.exports=r},{}],163:[function(e,t,n){"use strict";function r(){if("undefined"==typeof document)return null;try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=r},{}],164:[function(e,t,n){"use strict";function r(e){return a?void 0:i(!1),d.hasOwnProperty(e)||(e="*"),s.hasOwnProperty(e)||("*"===e?a.innerHTML="":a.innerHTML="<"+e+">",s[e]=!a.firstChild),s[e]?d[e]:null}var o=e(154),i=e(168),a=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'"],l=[1,"","
    "],c=[3,"","
    "],p=[1,'',""],d={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c},f=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];f.forEach(function(e){d[e]=p,s[e]=!0}),t.exports=r},{154:154,168:168}],165:[function(e,t,n){"use strict";function r(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=r},{}],166:[function(e,t,n){"use strict";function r(e){return e.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;t.exports=r},{}],167:[function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=e(166),i=/^ms-/;t.exports=r},{166:166}],168:[function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}t.exports=r},{}],169:[function(e,t,n){"use strict";function r(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=r},{}],170:[function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=e(169);t.exports=r},{169:169}],171:[function(e,t,n){"use strict";var r=e(168),o=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)?void 0:r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};t.exports=o},{168:168}],172:[function(e,t,n){"use strict";var r=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=r},{}],173:[function(e,t,n){"use strict";function r(e,t,n){if(!e)return null;var r={};for(var i in e)o.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],174:[function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=r},{}],175:[function(e,t,n){"use strict";var r,o=e(154);o.canUseDOM&&(r=window.performance||window.msPerformance||window.webkitPerformance),t.exports=r||{}},{154:154}],176:[function(e,t,n){"use strict";var r,o=e(175);r=o.now?function(){return o.now()}:function(){return Date.now()},t.exports=r},{175:175}],177:[function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;an;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(i){return!1}}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=o()?Object.assign:function(e,t){for(var n,o,s=r(e),u=1;u plugins (like Flash Player) will read + // nodes immediately upon insertion into the DOM, so + // must also be populated prior to insertion into the DOM. + if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) { insertTreeChildren(tree); parentNode.insertBefore(tree.node, referenceNode); } else { @@ -1452,12 +1494,17 @@ function queueText(tree, text) { } } +function toString() { + return this.node.nodeName; +} + function DOMLazyTree(node) { return { node: node, children: [], html: null, - text: null + text: null, + toString: toString }; } @@ -1468,7 +1515,7 @@ DOMLazyTree.queueHTML = queueHTML; DOMLazyTree.queueText = queueText; module.exports = DOMLazyTree; -},{"129":129,"151":151}],9:[function(_dereq_,module,exports){ +},{"129":129,"151":151,"9":9}],9:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -1718,8 +1765,9 @@ module.exports = DOMProperty; 'use strict'; var DOMProperty = _dereq_(10); -var ReactDOMInstrumentation = _dereq_(52); -var ReactPerf = _dereq_(88); +var ReactDOMComponentTree = _dereq_(45); +var ReactDOMInstrumentation = _dereq_(53); +var ReactInstrumentation = _dereq_(76); var quoteAttributeValueForBrowser = _dereq_(148); var warning = _dereq_(183); @@ -1827,9 +1875,6 @@ var DOMPropertyOperations = { * @param {*} value */ setValueForProperty: function (node, name, value) { - if ("development" !== 'production') { - ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value); - } var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; if (propertyInfo) { var mutationMethod = propertyInfo.mutationMethod; @@ -1837,6 +1882,7 @@ var DOMPropertyOperations = { mutationMethod(node, value); } else if (shouldIgnoreValue(propertyInfo, value)) { this.deleteValueForProperty(node, name); + return; } else if (propertyInfo.mustUseProperty) { var propName = propertyInfo.propertyName; // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the @@ -1861,6 +1907,14 @@ var DOMPropertyOperations = { } } else if (DOMProperty.isCustomAttribute(name)) { DOMPropertyOperations.setValueForAttribute(node, name, value); + return; + } + + if ("development" !== 'production') { + ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value); + var payload = {}; + payload[name] = value; + ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload); } }, @@ -1873,6 +1927,12 @@ var DOMPropertyOperations = { } else { node.setAttribute(name, '' + value); } + + if ("development" !== 'production') { + var payload = {}; + payload[name] = value; + ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload); + } }, /** @@ -1882,9 +1942,6 @@ var DOMPropertyOperations = { * @param {string} name */ deleteValueForProperty: function (node, name) { - if ("development" !== 'production') { - ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name); - } var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; if (propertyInfo) { var mutationMethod = propertyInfo.mutationMethod; @@ -1906,18 +1963,17 @@ var DOMPropertyOperations = { } else if (DOMProperty.isCustomAttribute(name)) { node.removeAttribute(name); } + + if ("development" !== 'production') { + ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name); + ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name); + } } }; -ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', { - setValueForProperty: 'setValueForProperty', - setValueForAttribute: 'setValueForAttribute', - deleteValueForProperty: 'deleteValueForProperty' -}); - module.exports = DOMPropertyOperations; -},{"10":10,"148":148,"183":183,"52":52,"88":88}],12:[function(_dereq_,module,exports){ +},{"10":10,"148":148,"183":183,"45":45,"53":53,"76":76}],12:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -2157,7 +2213,7 @@ module.exports = DisabledInputUtils; var EventConstants = _dereq_(16); var EventPropagators = _dereq_(20); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var SyntheticMouseEvent = _dereq_(119); var keyOf = _dereq_(177); @@ -2247,7 +2303,7 @@ var EnterLeaveEventPlugin = { }; module.exports = EnterLeaveEventPlugin; -},{"119":119,"16":16,"177":177,"20":20,"44":44}],16:[function(_dereq_,module,exports){ +},{"119":119,"16":16,"177":177,"20":20,"45":45}],16:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -2361,7 +2417,7 @@ module.exports = EventConstants; var EventPluginRegistry = _dereq_(18); var EventPluginUtils = _dereq_(19); -var ReactErrorUtils = _dereq_(69); +var ReactErrorUtils = _dereq_(68); var accumulateInto = _dereq_(126); var forEachAccumulated = _dereq_(134); @@ -2581,7 +2637,7 @@ var EventPluginHub = { }; module.exports = EventPluginHub; -},{"126":126,"134":134,"173":173,"18":18,"19":19,"69":69}],18:[function(_dereq_,module,exports){ +},{"126":126,"134":134,"173":173,"18":18,"19":19,"68":68}],18:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -2838,7 +2894,7 @@ module.exports = EventPluginRegistry; 'use strict'; var EventConstants = _dereq_(16); -var ReactErrorUtils = _dereq_(69); +var ReactErrorUtils = _dereq_(68); var invariant = _dereq_(173); var warning = _dereq_(183); @@ -3051,7 +3107,7 @@ var EventPluginUtils = { }; module.exports = EventPluginUtils; -},{"16":16,"173":173,"183":183,"69":69}],20:[function(_dereq_,module,exports){ +},{"16":16,"173":173,"183":183,"68":68}],20:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -3568,11 +3624,12 @@ module.exports = KeyEscapeUtils; 'use strict'; -var ReactLink = _dereq_(79); +var ReactLink = _dereq_(78); var ReactStateSetters = _dereq_(98); /** * A simple mixin around ReactLink.forState(). + * See https://facebook.github.io/react/docs/two-way-binding-helpers.html */ var LinkedStateMixin = { /** @@ -3590,7 +3647,7 @@ var LinkedStateMixin = { }; module.exports = LinkedStateMixin; -},{"79":79,"98":98}],25:[function(_dereq_,module,exports){ +},{"78":78,"98":98}],25:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -3863,9 +3920,9 @@ var _assign = _dereq_(184); var ReactChildren = _dereq_(32); var ReactComponent = _dereq_(34); var ReactClass = _dereq_(33); -var ReactDOMFactories = _dereq_(48); -var ReactElement = _dereq_(66); -var ReactElementValidator = _dereq_(67); +var ReactDOMFactories = _dereq_(49); +var ReactElement = _dereq_(65); +var ReactElementValidator = _dereq_(66); var ReactPropTypes = _dereq_(91); var ReactVersion = _dereq_(105); @@ -3932,7 +3989,7 @@ var React = { }; module.exports = React; -},{"105":105,"147":147,"183":183,"184":184,"32":32,"33":33,"34":34,"48":48,"66":66,"67":67,"91":91}],28:[function(_dereq_,module,exports){ +},{"105":105,"147":147,"183":183,"184":184,"32":32,"33":33,"34":34,"49":49,"65":65,"66":66,"91":91}],28:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -3950,7 +4007,7 @@ var _assign = _dereq_(184); var EventConstants = _dereq_(16); var EventPluginRegistry = _dereq_(18); -var ReactEventEmitterMixin = _dereq_(70); +var ReactEventEmitterMixin = _dereq_(69); var ViewportMetrics = _dereq_(125); var getVendorPrefixedEventName = _dereq_(143); @@ -4250,7 +4307,7 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { }); module.exports = ReactBrowserEventEmitter; -},{"125":125,"143":143,"145":145,"16":16,"18":18,"184":184,"70":70}],29:[function(_dereq_,module,exports){ +},{"125":125,"143":143,"145":145,"16":16,"18":18,"184":184,"69":69}],29:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4290,6 +4347,11 @@ function createTransitionTimeoutPropValidator(transitionType) { }; } +/** + * An easy way to perform CSS transitions and animations when a React component + * enters or leaves the DOM. + * See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup + */ var ReactCSSTransitionGroup = React.createClass({ displayName: 'ReactCSSTransitionGroup', @@ -4348,7 +4410,7 @@ module.exports = ReactCSSTransitionGroup; 'use strict'; var React = _dereq_(27); -var ReactDOM = _dereq_(40); +var ReactDOM = _dereq_(41); var CSSCore = _dereq_(157); var ReactTransitionEvents = _dereq_(101); @@ -4494,7 +4556,7 @@ var ReactCSSTransitionGroupChild = React.createClass({ }); module.exports = ReactCSSTransitionGroupChild; -},{"101":101,"147":147,"157":157,"27":27,"40":40}],31:[function(_dereq_,module,exports){ +},{"101":101,"147":147,"157":157,"27":27,"41":41}],31:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -4635,7 +4697,7 @@ module.exports = ReactChildReconciler; 'use strict'; var PooledClass = _dereq_(26); -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var emptyFunction = _dereq_(165); var traverseAllChildren = _dereq_(154); @@ -4678,6 +4740,8 @@ function forEachSingleChild(bookKeeping, child, name) { /** * Iterates through children that are typically specified as `props.children`. * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach + * * The provided forEachFunc(child, index) will be called for each * leaf child. * @@ -4753,7 +4817,9 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { /** * Maps children that are typically specified as `props.children`. * - * The provided mapFunction(child, index) will be called for each + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map + * + * The provided mapFunction(child, key, index) will be called for each * leaf child. * * @param {?*} children Children tree container. @@ -4778,6 +4844,8 @@ function forEachSingleChildDummy(traverseContext, child, name) { * Count the number of children that are typically specified as * `props.children`. * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count + * * @param {?*} children Children tree container. * @return {number} The number of children. */ @@ -4788,6 +4856,8 @@ function countChildren(children, context) { /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray */ function toArray(children) { var result = []; @@ -4804,7 +4874,7 @@ var ReactChildren = { }; module.exports = ReactChildren; -},{"154":154,"165":165,"26":26,"66":66}],33:[function(_dereq_,module,exports){ +},{"154":154,"165":165,"26":26,"65":65}],33:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4821,7 +4891,7 @@ module.exports = ReactChildren; var _assign = _dereq_(184); var ReactComponent = _dereq_(34); -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var ReactPropTypeLocations = _dereq_(90); var ReactPropTypeLocationNames = _dereq_(89); var ReactNoopUpdateQueue = _dereq_(86); @@ -5434,6 +5504,7 @@ var ReactClass = { /** * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass * * @param {object} spec Class specification (which must define `render`). * @return {function} Component constructor function. @@ -5528,7 +5599,7 @@ var ReactClass = { }; module.exports = ReactClass; -},{"166":166,"173":173,"176":176,"177":177,"183":183,"184":184,"34":34,"66":66,"86":86,"89":89,"90":90}],34:[function(_dereq_,module,exports){ +},{"166":166,"173":173,"176":176,"177":177,"183":183,"184":184,"34":34,"65":65,"86":86,"89":89,"90":90}],34:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -5543,7 +5614,7 @@ module.exports = ReactClass; 'use strict'; var ReactNoopUpdateQueue = _dereq_(86); -var ReactInstrumentation = _dereq_(77); +var ReactInstrumentation = _dereq_(76); var canDefineProperty = _dereq_(128); var emptyObject = _dereq_(166); @@ -5650,7 +5721,7 @@ if ("development" !== 'production') { } module.exports = ReactComponent; -},{"128":128,"166":166,"173":173,"183":183,"77":77,"86":86}],35:[function(_dereq_,module,exports){ +},{"128":128,"166":166,"173":173,"183":183,"76":76,"86":86}],35:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -5665,8 +5736,7 @@ module.exports = ReactComponent; 'use strict'; var DOMChildrenOperations = _dereq_(7); -var ReactDOMIDOperations = _dereq_(50); -var ReactPerf = _dereq_(88); +var ReactDOMIDOperations = _dereq_(51); /** * Abstracts away all functionality of the reconciler that requires knowledge of @@ -5690,12 +5760,8 @@ var ReactComponentBrowserEnvironment = { }; -ReactPerf.measureMethods(ReactComponentBrowserEnvironment, 'ReactComponentBrowserEnvironment', { - replaceNodeWithMarkup: 'replaceNodeWithMarkup' -}); - module.exports = ReactComponentBrowserEnvironment; -},{"50":50,"7":7,"88":88}],36:[function(_dereq_,module,exports){ +},{"51":51,"7":7}],36:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -5748,6 +5814,152 @@ var ReactComponentEnvironment = { module.exports = ReactComponentEnvironment; },{"173":173}],37:[function(_dereq_,module,exports){ +/** + * Copyright 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponentTreeDevtool + */ + +'use strict'; + +var invariant = _dereq_(173); + +var tree = {}; +var rootIDs = []; + +function updateTree(id, update) { + if (!tree[id]) { + tree[id] = { + parentID: null, + ownerID: null, + text: null, + childIDs: [], + displayName: 'Unknown', + isMounted: false, + updateCount: 0 + }; + } + update(tree[id]); +} + +function purgeDeep(id) { + var item = tree[id]; + if (item) { + var childIDs = item.childIDs; + + delete tree[id]; + childIDs.forEach(purgeDeep); + } +} + +var ReactComponentTreeDevtool = { + onSetDisplayName: function (id, displayName) { + updateTree(id, function (item) { + return item.displayName = displayName; + }); + }, + onSetChildren: function (id, nextChildIDs) { + updateTree(id, function (item) { + var prevChildIDs = item.childIDs; + item.childIDs = nextChildIDs; + + nextChildIDs.forEach(function (nextChildID) { + var nextChild = tree[nextChildID]; + !nextChild ? "development" !== 'production' ? invariant(false, 'Expected devtool events to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0; + !(nextChild.displayName != null) ? "development" !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0; + !(nextChild.childIDs != null || nextChild.text != null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0; + !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0; + + if (prevChildIDs.indexOf(nextChildID) === -1) { + nextChild.parentID = id; + } + }); + }); + }, + onSetOwner: function (id, ownerID) { + updateTree(id, function (item) { + return item.ownerID = ownerID; + }); + }, + onSetText: function (id, text) { + updateTree(id, function (item) { + return item.text = text; + }); + }, + onMountComponent: function (id) { + updateTree(id, function (item) { + return item.isMounted = true; + }); + }, + onMountRootComponent: function (id) { + rootIDs.push(id); + }, + onUpdateComponent: function (id) { + updateTree(id, function (item) { + return item.updateCount++; + }); + }, + onUnmountComponent: function (id) { + updateTree(id, function (item) { + return item.isMounted = false; + }); + rootIDs = rootIDs.filter(function (rootID) { + return rootID !== id; + }); + }, + purgeUnmountedComponents: function () { + if (ReactComponentTreeDevtool._preventPurging) { + // Should only be used for testing. + return; + } + + Object.keys(tree).filter(function (id) { + return !tree[id].isMounted; + }).forEach(purgeDeep); + }, + isMounted: function (id) { + var item = tree[id]; + return item ? item.isMounted : false; + }, + getChildIDs: function (id) { + var item = tree[id]; + return item ? item.childIDs : []; + }, + getDisplayName: function (id) { + var item = tree[id]; + return item ? item.displayName : 'Unknown'; + }, + getOwnerID: function (id) { + var item = tree[id]; + return item ? item.ownerID : null; + }, + getParentID: function (id) { + var item = tree[id]; + return item ? item.parentID : null; + }, + getText: function (id) { + var item = tree[id]; + return item ? item.text : null; + }, + getUpdateCount: function (id) { + var item = tree[id]; + return item ? item.updateCount : 0; + }, + getRootIDs: function () { + return rootIDs; + }, + getRegisteredIDs: function () { + return Object.keys(tree); + } +}; + +module.exports = ReactComponentTreeDevtool; +},{"173":173}],38:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -5786,6 +5998,8 @@ var shallowCompare = _dereq_(152); * complex data structures this mixin may have false-negatives for deeper * differences. Only mixin to components which have simple props and state, or * use `forceUpdate()` when you know deep data structures have changed. + * + * See https://facebook.github.io/react/docs/pure-render-mixin.html */ var ReactComponentWithPureRenderMixin = { shouldComponentUpdate: function (nextProps, nextState) { @@ -5794,7 +6008,7 @@ var ReactComponentWithPureRenderMixin = { }; module.exports = ReactComponentWithPureRenderMixin; -},{"152":152}],38:[function(_dereq_,module,exports){ +},{"152":152}],39:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -5811,13 +6025,12 @@ module.exports = ReactComponentWithPureRenderMixin; var _assign = _dereq_(184); var ReactComponentEnvironment = _dereq_(36); -var ReactCurrentOwner = _dereq_(39); -var ReactElement = _dereq_(66); -var ReactErrorUtils = _dereq_(69); -var ReactInstanceMap = _dereq_(76); -var ReactInstrumentation = _dereq_(77); +var ReactCurrentOwner = _dereq_(40); +var ReactElement = _dereq_(65); +var ReactErrorUtils = _dereq_(68); +var ReactInstanceMap = _dereq_(75); +var ReactInstrumentation = _dereq_(76); var ReactNodeTypes = _dereq_(85); -var ReactPerf = _dereq_(88); var ReactPropTypeLocations = _dereq_(90); var ReactPropTypeLocationNames = _dereq_(89); var ReactReconciler = _dereq_(93); @@ -5853,6 +6066,28 @@ function warnIfInvalidElement(Component, element) { } } +function invokeComponentDidMountWithTimer() { + var publicInstance = this._instance; + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount'); + } + publicInstance.componentDidMount(); + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount'); + } +} + +function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) { + var publicInstance = this._instance; + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate'); + } + publicInstance.componentDidUpdate(prevProps, prevState, prevContext); + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate'); + } +} + function shouldConstruct(Component) { return Component.prototype && Component.prototype.isReactComponent; } @@ -5912,6 +6147,7 @@ var ReactCompositeComponentMixin = { this._nativeContainerInfo = null; // See ReactUpdateQueue + this._updateBatchNumber = null; this._pendingElement = null; this._pendingStateQueue = null; this._pendingReplaceState = false; @@ -6020,7 +6256,11 @@ var ReactCompositeComponentMixin = { } if (inst.componentDidMount) { - transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); + if ("development" !== 'production') { + transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this); + } else { + transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); + } } return markup; @@ -6041,11 +6281,35 @@ var ReactCompositeComponentMixin = { _constructComponentWithoutOwner: function (publicProps, publicContext) { var Component = this._currentElement.type; + var instanceOrElement; if (shouldConstruct(Component)) { - return new Component(publicProps, publicContext, ReactUpdateQueue); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor'); + } + } + instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor'); + } + } } else { - return Component(publicProps, publicContext, ReactUpdateQueue); + // This can still be an instance in case of factory components + // but we'll count this as time spent rendering as the more common case. + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render'); + } + } + instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render'); + } + } } + return instanceOrElement; }, performInitialMountWithErrorHandling: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) { @@ -6075,7 +6339,17 @@ var ReactCompositeComponentMixin = { performInitialMount: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) { var inst = this._instance; if (inst.componentWillMount) { + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount'); + } + } inst.componentWillMount(); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount'); + } + } // When mounting, calls to `setState` by `componentWillMount` will set // `this._pendingStateQueue` without triggering a re-render. if (this._pendingStateQueue) { @@ -6093,6 +6367,12 @@ var ReactCompositeComponentMixin = { var markup = ReactReconciler.mountComponent(this._renderedComponent, transaction, nativeParent, nativeContainerInfo, this._processChildContext(context)); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []); + } + } + return markup; }, @@ -6114,12 +6394,22 @@ var ReactCompositeComponentMixin = { if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) { inst._calledComponentWillUnmount = true; + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount'); + } + } if (safely) { var name = this.getName() + '.componentWillUnmount()'; ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst)); } else { inst.componentWillUnmount(); } + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount'); + } + } } if (this._renderedComponent) { @@ -6302,10 +6592,10 @@ var ReactCompositeComponentMixin = { performUpdateIfNecessary: function (transaction) { if (this._pendingElement != null) { ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context); - } - - if (this._pendingStateQueue !== null || this._pendingForceUpdate) { + } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) { this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); + } else { + this._updateBatchNumber = null; } }, @@ -6352,17 +6642,41 @@ var ReactCompositeComponentMixin = { // _pendingStateQueue which will ensure that any state updates gets // immediately reconciled instead of waiting for the next batch. if (willReceive && inst.componentWillReceiveProps) { + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps'); + } + } inst.componentWillReceiveProps(nextProps, nextContext); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps'); + } + } } var nextState = this._processPendingState(nextProps, nextContext); + var shouldUpdate = true; - var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext); + if (!this._pendingForceUpdate && inst.shouldComponentUpdate) { + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate'); + } + } + shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate'); + } + } + } if ("development" !== 'production') { "development" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0; } + this._updateBatchNumber = null; if (shouldUpdate) { this._pendingForceUpdate = false; // Will set `this.props`, `this.state` and `this.context`. @@ -6428,7 +6742,17 @@ var ReactCompositeComponentMixin = { } if (inst.componentWillUpdate) { + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate'); + } + } inst.componentWillUpdate(nextProps, nextState, nextContext); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate'); + } + } } this._currentElement = nextElement; @@ -6440,7 +6764,11 @@ var ReactCompositeComponentMixin = { this._updateRenderedComponent(transaction, unmaskedContext); if (hasComponentDidUpdate) { - transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); + if ("development" !== 'production') { + transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this); + } else { + transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); + } } }, @@ -6462,8 +6790,16 @@ var ReactCompositeComponentMixin = { this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement); this._renderedComponent = this._instantiateReactComponent(nextRenderedElement); + var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context)); - this._replaceNodeWithMarkup(oldNativeNode, nextMarkup); + + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []); + } + } + + this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance); } }, @@ -6472,8 +6808,8 @@ var ReactCompositeComponentMixin = { * * @protected */ - _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup) { - ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup); + _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) { + ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance); }, /** @@ -6481,7 +6817,19 @@ var ReactCompositeComponentMixin = { */ _renderValidatedComponentWithoutOwnerOrContext: function () { var inst = this._instance; + + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render'); + } + } var renderedComponent = inst.render(); + if ("development" !== 'production') { + if (this._debugID !== 0) { + ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render'); + } + } + if ("development" !== 'production') { // We allow auto-mocks to proceed as if they're returning null. if (renderedComponent === undefined && inst.render._isMockFunction) { @@ -6508,6 +6856,7 @@ var ReactCompositeComponentMixin = { !( // TODO: An `isValidNode` function would probably be more appropriate renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? "development" !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0; + return renderedComponent; }, @@ -6576,12 +6925,6 @@ var ReactCompositeComponentMixin = { }; -ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', { - mountComponent: 'mountComponent', - updateComponent: 'updateComponent', - _renderValidatedComponent: '_renderValidatedComponent' -}); - var ReactCompositeComponent = { Mixin: ReactCompositeComponentMixin @@ -6589,7 +6932,7 @@ var ReactCompositeComponent = { }; module.exports = ReactCompositeComponent; -},{"103":103,"153":153,"166":166,"173":173,"183":183,"184":184,"36":36,"39":39,"66":66,"69":69,"76":76,"77":77,"85":85,"88":88,"89":89,"90":90,"93":93}],39:[function(_dereq_,module,exports){ +},{"103":103,"153":153,"166":166,"173":173,"183":183,"184":184,"36":36,"40":40,"65":65,"68":68,"75":75,"76":76,"85":85,"89":89,"90":90,"93":93}],40:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -6621,7 +6964,7 @@ var ReactCurrentOwner = { }; module.exports = ReactCurrentOwner; -},{}],40:[function(_dereq_,module,exports){ +},{}],41:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -6637,10 +6980,9 @@ module.exports = ReactCurrentOwner; 'use strict'; -var ReactDOMComponentTree = _dereq_(44); -var ReactDefaultInjection = _dereq_(63); -var ReactMount = _dereq_(81); -var ReactPerf = _dereq_(88); +var ReactDOMComponentTree = _dereq_(45); +var ReactDefaultInjection = _dereq_(64); +var ReactMount = _dereq_(80); var ReactReconciler = _dereq_(93); var ReactUpdates = _dereq_(104); var ReactVersion = _dereq_(105); @@ -6652,11 +6994,9 @@ var warning = _dereq_(183); ReactDefaultInjection.inject(); -var render = ReactPerf.measure('React', 'render', ReactMount.render); - var React = { findDOMNode: findDOMNode, - render: render, + render: ReactMount.render, unmountComponentAtNode: ReactMount.unmountComponentAtNode, version: ReactVersion, @@ -6726,7 +7066,7 @@ if ("development" !== 'production') { } module.exports = React; -},{"104":104,"105":105,"132":132,"140":140,"149":149,"159":159,"183":183,"44":44,"63":63,"81":81,"88":88,"93":93}],41:[function(_dereq_,module,exports){ +},{"104":104,"105":105,"132":132,"140":140,"149":149,"159":159,"183":183,"45":45,"64":64,"80":80,"93":93}],42:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -6751,7 +7091,7 @@ var ReactDOMButton = { }; module.exports = ReactDOMButton; -},{"14":14}],42:[function(_dereq_,module,exports){ +},{"14":14}],43:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -6780,16 +7120,18 @@ var EventPluginHub = _dereq_(17); var EventPluginRegistry = _dereq_(18); var ReactBrowserEventEmitter = _dereq_(28); var ReactComponentBrowserEnvironment = _dereq_(35); -var ReactDOMButton = _dereq_(41); -var ReactDOMComponentFlags = _dereq_(43); -var ReactDOMComponentTree = _dereq_(44); -var ReactDOMInput = _dereq_(51); -var ReactDOMOption = _dereq_(53); -var ReactDOMSelect = _dereq_(54); -var ReactDOMTextarea = _dereq_(58); -var ReactMultiChild = _dereq_(82); -var ReactPerf = _dereq_(88); +var ReactDOMButton = _dereq_(42); +var ReactDOMComponentFlags = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); +var ReactDOMInput = _dereq_(52); +var ReactDOMOption = _dereq_(54); +var ReactDOMSelect = _dereq_(55); +var ReactDOMTextarea = _dereq_(59); +var ReactInstrumentation = _dereq_(76); +var ReactMultiChild = _dereq_(81); +var ReactServerRenderingTransaction = _dereq_(97); +var emptyFunction = _dereq_(165); var escapeTextContentForBrowser = _dereq_(131); var invariant = _dereq_(173); var isEventSupported = _dereq_(145); @@ -6908,6 +7250,9 @@ function assertValidProps(component, props) { } function enqueuePutListener(inst, registrationName, listener, transaction) { + if (transaction instanceof ReactServerRenderingTransaction) { + return; + } if ("development" !== 'production') { // IE8 has no API for event capturing and the `onScroll` event doesn't // bubble. @@ -6916,10 +7261,6 @@ function enqueuePutListener(inst, registrationName, listener, transaction) { var containerInfo = inst._nativeContainerInfo; var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument; - if (!doc) { - // Server rendering. - return; - } listenTo(registrationName, doc); transaction.getReactMountReady().enqueue(putListener, { inst: inst, @@ -6938,6 +7279,19 @@ function optionPostMount() { ReactDOMOption.postMountWrapper(inst); } +var setContentChildForInstrumentation = emptyFunction; +if ("development" !== 'production') { + setContentChildForInstrumentation = function (contentToUse) { + var debugID = this._debugID; + var contentDebugID = debugID + '#text'; + this._contentDebugID = contentDebugID; + ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text'); + ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse); + ReactInstrumentation.debugTool.onMountComponent(contentDebugID); + ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]); + }; +} + // There are so many media events, it makes sense to just // maintain a list rather than create a `trapBubbledEvent` for each var mediaEvents = { @@ -7098,6 +7452,7 @@ function ReactDOMComponent(element) { this._flags = 0; if ("development" !== 'production') { this._ancestorInfo = null; + this._contentDebugID = null; } } @@ -7213,7 +7568,7 @@ ReactDOMComponent.Mixin = { div.innerHTML = '<' + type + '>'; el = div.removeChild(div.firstChild); } else { - el = ownerDocument.createElement(this._currentElement.type); + el = ownerDocument.createElement(this._currentElement.type, props.is || null); } } else { el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type); @@ -7343,6 +7698,9 @@ ReactDOMComponent.Mixin = { if (contentToUse != null) { // TODO: Validate that text is allowed as a child of this node ret = escapeTextContentForBrowser(contentToUse); + if ("development" !== 'production') { + setContentChildForInstrumentation.call(this, contentToUse); + } } else if (childrenToUse != null) { var mountImages = this.mountChildren(childrenToUse, transaction, context); ret = mountImages.join(''); @@ -7377,6 +7735,9 @@ ReactDOMComponent.Mixin = { var childrenToUse = contentToUse != null ? null : props.children; if (contentToUse != null) { // TODO: Validate that text is allowed as a child of this node + if ("development" !== 'production') { + setContentChildForInstrumentation.call(this, contentToUse); + } DOMLazyTree.queueText(lazyTree, contentToUse); } else if (childrenToUse != null) { var mountImages = this.mountChildren(childrenToUse, transaction, context); @@ -7585,17 +7946,34 @@ ReactDOMComponent.Mixin = { this.updateChildren(null, transaction, context); } else if (lastHasContentOrHtml && !nextHasContentOrHtml) { this.updateTextContent(''); + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, []); + } } if (nextContent != null) { if (lastContent !== nextContent) { this.updateTextContent('' + nextContent); + if ("development" !== 'production') { + this._contentDebugID = this._debugID + '#text'; + setContentChildForInstrumentation.call(this, nextContent); + } } } else if (nextHtml != null) { if (lastHtml !== nextHtml) { this.updateMarkup('' + nextHtml); } + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, []); + } } else if (nextChildren != null) { + if ("development" !== 'production') { + if (this._contentDebugID) { + ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID); + this._contentDebugID = null; + } + } + this.updateChildren(nextChildren, transaction, context); } }, @@ -7645,6 +8023,13 @@ ReactDOMComponent.Mixin = { this._rootNodeID = null; this._domID = null; this._wrapperState = null; + + if ("development" !== 'production') { + if (this._contentDebugID) { + ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID); + this._contentDebugID = null; + } + } }, getPublicInstance: function () { @@ -7653,15 +8038,10 @@ ReactDOMComponent.Mixin = { }; -ReactPerf.measureMethods(ReactDOMComponent.Mixin, 'ReactDOMComponent', { - mountComponent: 'mountComponent', - receiveComponent: 'receiveComponent' -}); - _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin); module.exports = ReactDOMComponent; -},{"1":1,"10":10,"11":11,"131":131,"145":145,"156":156,"16":16,"17":17,"173":173,"177":177,"18":18,"182":182,"183":183,"184":184,"28":28,"35":35,"4":4,"41":41,"43":43,"44":44,"51":51,"53":53,"54":54,"58":58,"8":8,"82":82,"88":88,"9":9}],43:[function(_dereq_,module,exports){ +},{"1":1,"10":10,"11":11,"131":131,"145":145,"156":156,"16":16,"165":165,"17":17,"173":173,"177":177,"18":18,"182":182,"183":183,"184":184,"28":28,"35":35,"4":4,"42":42,"44":44,"45":45,"52":52,"54":54,"55":55,"59":59,"76":76,"8":8,"81":81,"9":9,"97":97}],44:[function(_dereq_,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -7680,7 +8060,7 @@ var ReactDOMComponentFlags = { }; module.exports = ReactDOMComponentFlags; -},{}],44:[function(_dereq_,module,exports){ +},{}],45:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -7695,7 +8075,7 @@ module.exports = ReactDOMComponentFlags; 'use strict'; var DOMProperty = _dereq_(10); -var ReactDOMComponentFlags = _dereq_(43); +var ReactDOMComponentFlags = _dereq_(44); var invariant = _dereq_(173); @@ -7867,7 +8247,7 @@ var ReactDOMComponentTree = { }; module.exports = ReactDOMComponentTree; -},{"10":10,"173":173,"43":43}],45:[function(_dereq_,module,exports){ +},{"10":10,"173":173,"44":44}],46:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -7901,7 +8281,7 @@ function ReactDOMContainerInfo(topLevelWrapper, node) { } module.exports = ReactDOMContainerInfo; -},{"156":156}],46:[function(_dereq_,module,exports){ +},{"156":156}],47:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -7915,7 +8295,7 @@ module.exports = ReactDOMContainerInfo; 'use strict'; -var ReactDOMUnknownPropertyDevtool = _dereq_(60); +var ReactDOMUnknownPropertyDevtool = _dereq_(61); var warning = _dereq_(183); @@ -7963,7 +8343,7 @@ var ReactDOMDebugTool = { ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool); module.exports = ReactDOMDebugTool; -},{"183":183,"60":60}],47:[function(_dereq_,module,exports){ +},{"183":183,"61":61}],48:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -7980,7 +8360,7 @@ module.exports = ReactDOMDebugTool; var _assign = _dereq_(184); var DOMLazyTree = _dereq_(8); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var ReactDOMEmptyComponent = function (instantiate) { // ReactCompositeComponent uses this: @@ -8024,7 +8404,7 @@ _assign(ReactDOMEmptyComponent.prototype, { }); module.exports = ReactDOMEmptyComponent; -},{"184":184,"44":44,"8":8}],48:[function(_dereq_,module,exports){ +},{"184":184,"45":45,"8":8}],49:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8038,8 +8418,8 @@ module.exports = ReactDOMEmptyComponent; 'use strict'; -var ReactElement = _dereq_(66); -var ReactElementValidator = _dereq_(67); +var ReactElement = _dereq_(65); +var ReactElementValidator = _dereq_(66); var mapObject = _dereq_(178); @@ -8201,7 +8581,7 @@ var ReactDOMFactories = mapObject({ }, createDOMFactory); module.exports = ReactDOMFactories; -},{"178":178,"66":66,"67":67}],49:[function(_dereq_,module,exports){ +},{"178":178,"65":65,"66":66}],50:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8220,7 +8600,7 @@ var ReactDOMFeatureFlags = { }; module.exports = ReactDOMFeatureFlags; -},{}],50:[function(_dereq_,module,exports){ +},{}],51:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8235,8 +8615,7 @@ module.exports = ReactDOMFeatureFlags; 'use strict'; var DOMChildrenOperations = _dereq_(7); -var ReactDOMComponentTree = _dereq_(44); -var ReactPerf = _dereq_(88); +var ReactDOMComponentTree = _dereq_(45); /** * Operations used to process updates to DOM nodes. @@ -8255,12 +8634,8 @@ var ReactDOMIDOperations = { } }; -ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', { - dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates' -}); - module.exports = ReactDOMIDOperations; -},{"44":44,"7":7,"88":88}],51:[function(_dereq_,module,exports){ +},{"45":45,"7":7}],52:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8279,7 +8654,7 @@ var _assign = _dereq_(184); var DisabledInputUtils = _dereq_(14); var DOMPropertyOperations = _dereq_(11); var LinkedValueUtils = _dereq_(25); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var ReactUpdates = _dereq_(104); var invariant = _dereq_(173); @@ -8348,6 +8723,8 @@ var ReactDOMInput = { if ("development" !== 'production') { LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner); + var owner = inst._currentElement._owner; + if (props.valueLink !== undefined && !didWarnValueLink) { "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0; didWarnValueLink = true; @@ -8357,11 +8734,11 @@ var ReactDOMInput = { didWarnCheckedLink = true; } if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { - "development" !== 'production' ? warning(false, 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; + "development" !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; didWarnCheckedDefaultChecked = true; } if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - "development" !== 'production' ? warning(false, 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; + "development" !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; didWarnValueDefaultValue = true; } warnIfValueIsNull(props); @@ -8392,7 +8769,7 @@ var ReactDOMInput = { var owner = inst._currentElement._owner; if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) { - "development" !== 'production' ? warning(false, '%s is changing a uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; + "development" !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0; didWarnUncontrolledToControlled = true; } if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) { @@ -8465,7 +8842,7 @@ function _handleChange(event) { } module.exports = ReactDOMInput; -},{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"44":44}],52:[function(_dereq_,module,exports){ +},{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"45":45}],53:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8479,10 +8856,10 @@ module.exports = ReactDOMInput; 'use strict'; -var ReactDOMDebugTool = _dereq_(46); +var ReactDOMDebugTool = _dereq_(47); module.exports = { debugTool: ReactDOMDebugTool }; -},{"46":46}],53:[function(_dereq_,module,exports){ +},{"47":47}],54:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8499,8 +8876,8 @@ module.exports = { debugTool: ReactDOMDebugTool }; var _assign = _dereq_(184); var ReactChildren = _dereq_(32); -var ReactDOMComponentTree = _dereq_(44); -var ReactDOMSelect = _dereq_(54); +var ReactDOMComponentTree = _dereq_(45); +var ReactDOMSelect = _dereq_(55); var warning = _dereq_(183); @@ -8592,7 +8969,7 @@ var ReactDOMOption = { }; module.exports = ReactDOMOption; -},{"183":183,"184":184,"32":32,"44":44,"54":54}],54:[function(_dereq_,module,exports){ +},{"183":183,"184":184,"32":32,"45":45,"55":55}],55:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8610,7 +8987,7 @@ var _assign = _dereq_(184); var DisabledInputUtils = _dereq_(14); var LinkedValueUtils = _dereq_(25); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var ReactUpdates = _dereq_(104); var warning = _dereq_(183); @@ -8806,7 +9183,7 @@ function _handleChange(event) { } module.exports = ReactDOMSelect; -},{"104":104,"14":14,"183":183,"184":184,"25":25,"44":44}],55:[function(_dereq_,module,exports){ +},{"104":104,"14":14,"183":183,"184":184,"25":25,"45":45}],56:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9019,7 +9396,7 @@ var ReactDOMSelection = { }; module.exports = ReactDOMSelection; -},{"141":141,"142":142,"159":159}],56:[function(_dereq_,module,exports){ +},{"141":141,"142":142,"159":159}],57:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9033,7 +9410,7 @@ module.exports = ReactDOMSelection; 'use strict'; -var ReactDefaultInjection = _dereq_(63); +var ReactDefaultInjection = _dereq_(64); var ReactServerRendering = _dereq_(96); var ReactVersion = _dereq_(105); @@ -9046,7 +9423,7 @@ var ReactDOMServer = { }; module.exports = ReactDOMServer; -},{"105":105,"63":63,"96":96}],57:[function(_dereq_,module,exports){ +},{"105":105,"64":64,"96":96}],58:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9064,8 +9441,8 @@ var _assign = _dereq_(184); var DOMChildrenOperations = _dereq_(7); var DOMLazyTree = _dereq_(8); -var ReactDOMComponentTree = _dereq_(44); -var ReactPerf = _dereq_(88); +var ReactDOMComponentTree = _dereq_(45); +var ReactInstrumentation = _dereq_(76); var escapeTextContentForBrowser = _dereq_(131); var invariant = _dereq_(173); @@ -9113,6 +9490,8 @@ _assign(ReactDOMTextComponent.prototype, { */ mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) { if ("development" !== 'production') { + ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText); + var parentInfo; if (nativeParent != null) { parentInfo = nativeParent._ancestorInfo; @@ -9176,6 +9555,10 @@ _assign(ReactDOMTextComponent.prototype, { this._stringText = nextStringText; var commentNodes = this.getNativeNode(); DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText); + + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText); + } } } }, @@ -9210,13 +9593,8 @@ _assign(ReactDOMTextComponent.prototype, { }); -ReactPerf.measureMethods(ReactDOMTextComponent.prototype, 'ReactDOMTextComponent', { - mountComponent: 'mountComponent', - receiveComponent: 'receiveComponent' -}); - module.exports = ReactDOMTextComponent; -},{"131":131,"156":156,"173":173,"184":184,"44":44,"7":7,"8":8,"88":88}],58:[function(_dereq_,module,exports){ +},{"131":131,"156":156,"173":173,"184":184,"45":45,"7":7,"76":76,"8":8}],59:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9235,7 +9613,7 @@ var _assign = _dereq_(184); var DisabledInputUtils = _dereq_(14); var DOMPropertyOperations = _dereq_(11); var LinkedValueUtils = _dereq_(25); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var ReactUpdates = _dereq_(104); var invariant = _dereq_(173); @@ -9359,7 +9737,7 @@ function _handleChange(event) { } module.exports = ReactDOMTextarea; -},{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"44":44}],59:[function(_dereq_,module,exports){ +},{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"45":45}],60:[function(_dereq_,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -9494,7 +9872,7 @@ module.exports = { traverseTwoPhase: traverseTwoPhase, traverseEnterLeave: traverseEnterLeave }; -},{"173":173}],60:[function(_dereq_,module,exports){ +},{"173":173}],61:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9559,7 +9937,7 @@ var ReactDOMUnknownPropertyDevtool = { }; module.exports = ReactDOMUnknownPropertyDevtool; -},{"10":10,"18":18,"183":183}],61:[function(_dereq_,module,exports){ +},{"10":10,"18":18,"183":183}],62:[function(_dereq_,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -9573,7 +9951,9 @@ module.exports = ReactDOMUnknownPropertyDevtool; 'use strict'; -var ReactInvalidSetStateWarningDevTool = _dereq_(78); +var ExecutionEnvironment = _dereq_(159); + +var performanceNow = _dereq_(181); var warning = _dereq_(183); var eventHandlers = []; @@ -9594,6 +9974,70 @@ function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) { } } +var isProfiling = false; +var flushHistory = []; +var currentFlushNesting = 0; +var currentFlushMeasurements = null; +var currentFlushStartTime = null; +var currentTimerDebugID = null; +var currentTimerStartTime = null; +var currentTimerType = null; + +function clearHistory() { + ReactComponentTreeDevtool.purgeUnmountedComponents(); + ReactNativeOperationHistoryDevtool.clearHistory(); +} + +function getTreeSnapshot(registeredIDs) { + return registeredIDs.reduce(function (tree, id) { + var ownerID = ReactComponentTreeDevtool.getOwnerID(id); + var parentID = ReactComponentTreeDevtool.getParentID(id); + tree[id] = { + displayName: ReactComponentTreeDevtool.getDisplayName(id), + text: ReactComponentTreeDevtool.getText(id), + updateCount: ReactComponentTreeDevtool.getUpdateCount(id), + childIDs: ReactComponentTreeDevtool.getChildIDs(id), + // Text nodes don't have owners but this is close enough. + ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID), + parentID: parentID + }; + return tree; + }, {}); +} + +function resetMeasurements() { + if ("development" !== 'production') { + var previousStartTime = currentFlushStartTime; + var previousMeasurements = currentFlushMeasurements || []; + var previousOperations = ReactNativeOperationHistoryDevtool.getHistory(); + + if (!isProfiling || currentFlushNesting === 0) { + currentFlushStartTime = null; + currentFlushMeasurements = null; + clearHistory(); + return; + } + + if (previousMeasurements.length || previousOperations.length) { + var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs(); + flushHistory.push({ + duration: performanceNow() - previousStartTime, + measurements: previousMeasurements || [], + operations: previousOperations || [], + treeSnapshot: getTreeSnapshot(registeredIDs) + }); + } + + clearHistory(); + currentFlushStartTime = performanceNow(); + currentFlushMeasurements = []; + } +} + +function checkDebugID(debugID) { + "development" !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0; +} + var ReactDebugTool = { addDevtool: function (devtool) { eventHandlers.push(devtool); @@ -9606,33 +10050,145 @@ var ReactDebugTool = { } } }, + beginProfiling: function () { + if ("development" !== 'production') { + if (isProfiling) { + return; + } + + isProfiling = true; + flushHistory.length = 0; + resetMeasurements(); + } + }, + endProfiling: function () { + if ("development" !== 'production') { + if (!isProfiling) { + return; + } + + isProfiling = false; + resetMeasurements(); + } + }, + getFlushHistory: function () { + if ("development" !== 'production') { + return flushHistory; + } + }, + onBeginFlush: function () { + if ("development" !== 'production') { + currentFlushNesting++; + resetMeasurements(); + } + emitEvent('onBeginFlush'); + }, + onEndFlush: function () { + if ("development" !== 'production') { + resetMeasurements(); + currentFlushNesting--; + } + emitEvent('onEndFlush'); + }, + onBeginLifeCycleTimer: function (debugID, timerType) { + checkDebugID(debugID); + emitEvent('onBeginLifeCycleTimer', debugID, timerType); + if ("development" !== 'production') { + if (isProfiling && currentFlushNesting > 0) { + "development" !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; + currentTimerStartTime = performanceNow(); + currentTimerDebugID = debugID; + currentTimerType = timerType; + } + } + }, + onEndLifeCycleTimer: function (debugID, timerType) { + checkDebugID(debugID); + if ("development" !== 'production') { + if (isProfiling && currentFlushNesting > 0) { + "development" !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; + currentFlushMeasurements.push({ + timerType: timerType, + instanceID: debugID, + duration: performanceNow() - currentTimerStartTime + }); + currentTimerStartTime = null; + currentTimerDebugID = null; + currentTimerType = null; + } + } + emitEvent('onEndLifeCycleTimer', debugID, timerType); + }, + onBeginReconcilerTimer: function (debugID, timerType) { + checkDebugID(debugID); + emitEvent('onBeginReconcilerTimer', debugID, timerType); + }, + onEndReconcilerTimer: function (debugID, timerType) { + checkDebugID(debugID); + emitEvent('onEndReconcilerTimer', debugID, timerType); + }, onBeginProcessingChildContext: function () { emitEvent('onBeginProcessingChildContext'); }, onEndProcessingChildContext: function () { emitEvent('onEndProcessingChildContext'); }, + onNativeOperation: function (debugID, type, payload) { + checkDebugID(debugID); + emitEvent('onNativeOperation', debugID, type, payload); + }, onSetState: function () { emitEvent('onSetState'); }, - onMountRootComponent: function (internalInstance) { - emitEvent('onMountRootComponent', internalInstance); + onSetDisplayName: function (debugID, displayName) { + checkDebugID(debugID); + emitEvent('onSetDisplayName', debugID, displayName); }, - onMountComponent: function (internalInstance) { - emitEvent('onMountComponent', internalInstance); + onSetChildren: function (debugID, childDebugIDs) { + checkDebugID(debugID); + emitEvent('onSetChildren', debugID, childDebugIDs); }, - onUpdateComponent: function (internalInstance) { - emitEvent('onUpdateComponent', internalInstance); + onSetOwner: function (debugID, ownerDebugID) { + checkDebugID(debugID); + emitEvent('onSetOwner', debugID, ownerDebugID); }, - onUnmountComponent: function (internalInstance) { - emitEvent('onUnmountComponent', internalInstance); + onSetText: function (debugID, text) { + checkDebugID(debugID); + emitEvent('onSetText', debugID, text); + }, + onMountRootComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onMountRootComponent', debugID); + }, + onMountComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onMountComponent', debugID); + }, + onUpdateComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onUpdateComponent', debugID); + }, + onUnmountComponent: function (debugID) { + checkDebugID(debugID); + emitEvent('onUnmountComponent', debugID); } }; -ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool); +if ("development" !== 'production') { + var ReactInvalidSetStateWarningDevTool = _dereq_(77); + var ReactNativeOperationHistoryDevtool = _dereq_(84); + var ReactComponentTreeDevtool = _dereq_(37); + ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool); + ReactDebugTool.addDevtool(ReactComponentTreeDevtool); + ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool); + var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; + if (/[?&]react_perf\b/.test(url)) { + ReactDebugTool.beginProfiling(); + } +} module.exports = ReactDebugTool; -},{"183":183,"78":78}],62:[function(_dereq_,module,exports){ +},{"159":159,"181":181,"183":183,"37":37,"77":77,"84":84}],63:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9701,7 +10257,7 @@ var ReactDefaultBatchingStrategy = { }; module.exports = ReactDefaultBatchingStrategy; -},{"104":104,"124":124,"165":165,"184":184}],63:[function(_dereq_,module,exports){ +},{"104":104,"124":124,"165":165,"184":184}],64:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -9719,17 +10275,16 @@ var BeforeInputEventPlugin = _dereq_(2); var ChangeEventPlugin = _dereq_(6); var DefaultEventPluginOrder = _dereq_(13); var EnterLeaveEventPlugin = _dereq_(15); -var ExecutionEnvironment = _dereq_(159); var HTMLDOMPropertyConfig = _dereq_(22); var ReactComponentBrowserEnvironment = _dereq_(35); -var ReactDOMComponent = _dereq_(42); -var ReactDOMComponentTree = _dereq_(44); -var ReactDOMEmptyComponent = _dereq_(47); -var ReactDOMTreeTraversal = _dereq_(59); -var ReactDOMTextComponent = _dereq_(57); -var ReactDefaultBatchingStrategy = _dereq_(62); -var ReactEventListener = _dereq_(71); -var ReactInjection = _dereq_(74); +var ReactDOMComponent = _dereq_(43); +var ReactDOMComponentTree = _dereq_(45); +var ReactDOMEmptyComponent = _dereq_(48); +var ReactDOMTreeTraversal = _dereq_(60); +var ReactDOMTextComponent = _dereq_(58); +var ReactDefaultBatchingStrategy = _dereq_(63); +var ReactEventListener = _dereq_(70); +var ReactInjection = _dereq_(73); var ReactReconcileTransaction = _dereq_(92); var SVGDOMPropertyConfig = _dereq_(108); var SelectEventPlugin = _dereq_(109); @@ -9782,548 +10337,12 @@ function inject() { ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy); ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); - - if ("development" !== 'production') { - var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; - if (/[?&]react_perf\b/.test(url)) { - var ReactDefaultPerf = _dereq_(64); - ReactDefaultPerf.start(); - } - } } module.exports = { inject: inject }; -},{"108":108,"109":109,"110":110,"13":13,"15":15,"159":159,"2":2,"22":22,"35":35,"42":42,"44":44,"47":47,"57":57,"59":59,"6":6,"62":62,"64":64,"71":71,"74":74,"92":92}],64:[function(_dereq_,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactDefaultPerf - */ - -'use strict'; - -var DOMProperty = _dereq_(10); -var ReactDOMComponentTree = _dereq_(44); -var ReactDefaultPerfAnalysis = _dereq_(65); -var ReactMount = _dereq_(81); -var ReactPerf = _dereq_(88); - -var performanceNow = _dereq_(181); -var warning = _dereq_(183); - -function roundFloat(val) { - return Math.floor(val * 100) / 100; -} - -function addValue(obj, key, val) { - obj[key] = (obj[key] || 0) + val; -} - -// Composite/text components don't have any built-in ID: we have to make our own -var compositeIDMap; -var compositeIDCounter = 17000; -function getIDOfComposite(inst) { - if (!compositeIDMap) { - compositeIDMap = new WeakMap(); - } - if (compositeIDMap.has(inst)) { - return compositeIDMap.get(inst); - } else { - var id = compositeIDCounter++; - compositeIDMap.set(inst, id); - return id; - } -} - -function getID(inst) { - if (inst.hasOwnProperty('_rootNodeID')) { - return inst._rootNodeID; - } else { - return getIDOfComposite(inst); - } -} - -function stripComplexValues(key, value) { - if (typeof value !== 'object' || Array.isArray(value) || value == null) { - return value; - } - var prototype = Object.getPrototypeOf(value); - if (!prototype || prototype === Object.prototype) { - return value; - } - return ''; -} - -// This implementation of ReactPerf is going away some time mid 15.x. -// While we plan to keep most of the API, the actual format of measurements -// will change dramatically. To signal this, we wrap them into an opaque-ish -// object to discourage reaching into it until the API stabilizes. -function wrapLegacyMeasurements(measurements) { - return { __unstable_this_format_will_change: measurements }; -} -function unwrapLegacyMeasurements(measurements) { - return measurements && measurements.__unstable_this_format_will_change || measurements; -} - -var warnedAboutPrintDOM = false; -var warnedAboutGetMeasurementsSummaryMap = false; - -var ReactDefaultPerf = { - _allMeasurements: [], // last item in the list is the current one - _mountStack: [0], - _compositeStack: [], - _injected: false, - - start: function () { - if (!ReactDefaultPerf._injected) { - ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure); - } - - ReactDefaultPerf._allMeasurements.length = 0; - ReactPerf.enableMeasure = true; - }, - - stop: function () { - ReactPerf.enableMeasure = false; - }, - - getLastMeasurements: function () { - return wrapLegacyMeasurements(ReactDefaultPerf._allMeasurements); - }, - - printExclusive: function (measurements) { - measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements); - var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements); - console.table(summary.map(function (item) { - return { - 'Component class name': item.componentName, - 'Total inclusive time (ms)': roundFloat(item.inclusive), - 'Exclusive mount time (ms)': roundFloat(item.exclusive), - 'Exclusive render time (ms)': roundFloat(item.render), - 'Mount time per instance (ms)': roundFloat(item.exclusive / item.count), - 'Render time per instance (ms)': roundFloat(item.render / item.count), - 'Instances': item.count - }; - })); - // TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct - // number. - }, - - printInclusive: function (measurements) { - measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements); - var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements); - console.table(summary.map(function (item) { - return { - 'Owner > component': item.componentName, - 'Inclusive time (ms)': roundFloat(item.time), - 'Instances': item.count - }; - })); - console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'); - }, - - getMeasurementsSummaryMap: function (measurements) { - "development" !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0; - warnedAboutGetMeasurementsSummaryMap = true; - return ReactDefaultPerf.getWasted(measurements); - }, - - getWasted: function (measurements) { - measurements = unwrapLegacyMeasurements(measurements); - var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true); - return summary.map(function (item) { - return { - 'Owner > component': item.componentName, - 'Wasted time (ms)': item.time, - 'Instances': item.count - }; - }); - }, - - printWasted: function (measurements) { - measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements); - console.table(ReactDefaultPerf.getWasted(measurements)); - console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'); - }, - - printDOM: function (measurements) { - "development" !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0; - warnedAboutPrintDOM = true; - return ReactDefaultPerf.printOperations(measurements); - }, - - printOperations: function (measurements) { - measurements = unwrapLegacyMeasurements(measurements || ReactDefaultPerf._allMeasurements); - var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements); - console.table(summary.map(function (item) { - var result = {}; - result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id; - result.type = item.type; - result.args = JSON.stringify(item.args, stripComplexValues); - return result; - })); - console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms'); - }, - - _recordWrite: function (id, fnName, totalTime, args) { - // TODO: totalTime isn't that useful since it doesn't count paints/reflows - var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1]; - var writes = entry.writes; - writes[id] = writes[id] || []; - writes[id].push({ - type: fnName, - time: totalTime, - args: args - }); - }, - - measure: function (moduleName, fnName, func) { - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var totalTime; - var rv; - var start; - - var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1]; - - if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') { - // A "measurement" is a set of metrics recorded for each flush. We want - // to group the metrics for a given flush together so we can look at the - // components that rendered and the DOM operations that actually - // happened to determine the amount of "wasted work" performed. - ReactDefaultPerf._allMeasurements.push(entry = { - exclusive: {}, - inclusive: {}, - render: {}, - counts: {}, - writes: {}, - displayNames: {}, - hierarchy: {}, - totalTime: 0, - created: {} - }); - start = performanceNow(); - rv = func.apply(this, args); - entry.totalTime = performanceNow() - start; - return rv; - } else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations' || moduleName === 'ReactComponentBrowserEnvironment') { - start = performanceNow(); - rv = func.apply(this, args); - totalTime = performanceNow() - start; - - if (fnName === '_mountImageIntoNode') { - ReactDefaultPerf._recordWrite('', fnName, totalTime, args[0]); - } else if (fnName === 'dangerouslyProcessChildrenUpdates') { - // special format - args[1].forEach(function (update) { - var writeArgs = {}; - if (update.fromIndex !== null) { - writeArgs.fromIndex = update.fromIndex; - } - if (update.toIndex !== null) { - writeArgs.toIndex = update.toIndex; - } - if (update.content !== null) { - writeArgs.content = update.content; - } - ReactDefaultPerf._recordWrite(args[0]._rootNodeID, update.type, totalTime, writeArgs); - }); - } else { - // basic format - var id = args[0]; - if (moduleName === 'EventPluginHub') { - id = id._rootNodeID; - } else if (fnName === 'replaceNodeWithMarkup') { - // Old node is already unmounted; can't get its instance - id = ReactDOMComponentTree.getInstanceFromNode(args[1].node)._rootNodeID; - } else if (fnName === 'replaceDelimitedText') { - id = getID(ReactDOMComponentTree.getInstanceFromNode(args[0])); - } else if (typeof id === 'object') { - id = getID(ReactDOMComponentTree.getInstanceFromNode(args[0])); - } - ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1)); - } - return rv; - } else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()? - fnName === '_renderValidatedComponent')) { - - if (this._currentElement.type === ReactMount.TopLevelWrapper) { - return func.apply(this, args); - } - - var rootNodeID = getIDOfComposite(this); - var isRender = fnName === '_renderValidatedComponent'; - var isMount = fnName === 'mountComponent'; - - var mountStack = ReactDefaultPerf._mountStack; - - if (isRender) { - addValue(entry.counts, rootNodeID, 1); - } else if (isMount) { - entry.created[rootNodeID] = true; - mountStack.push(0); - } - - ReactDefaultPerf._compositeStack.push(rootNodeID); - - start = performanceNow(); - rv = func.apply(this, args); - totalTime = performanceNow() - start; - - ReactDefaultPerf._compositeStack.pop(); - - if (isRender) { - addValue(entry.render, rootNodeID, totalTime); - } else if (isMount) { - var subMountTime = mountStack.pop(); - mountStack[mountStack.length - 1] += totalTime; - addValue(entry.exclusive, rootNodeID, totalTime - subMountTime); - addValue(entry.inclusive, rootNodeID, totalTime); - } else { - addValue(entry.inclusive, rootNodeID, totalTime); - } - - entry.displayNames[rootNodeID] = { - current: this.getName(), - owner: this._currentElement._owner ? this._currentElement._owner.getName() : '' - }; - - return rv; - } else if ((moduleName === 'ReactDOMComponent' || moduleName === 'ReactDOMTextComponent') && (fnName === 'mountComponent' || fnName === 'receiveComponent')) { - - rv = func.apply(this, args); - entry.hierarchy[getID(this)] = ReactDefaultPerf._compositeStack.slice(); - return rv; - } else { - return func.apply(this, args); - } - }; - } -}; - -module.exports = ReactDefaultPerf; -},{"10":10,"181":181,"183":183,"44":44,"65":65,"81":81,"88":88}],65:[function(_dereq_,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule ReactDefaultPerfAnalysis - */ - -'use strict'; - -// Don't try to save users less than 1.2ms (a number I made up) - -var _assign = _dereq_(184); - -var DONT_CARE_THRESHOLD = 1.2; -var DOM_OPERATION_TYPES = { - '_mountImageIntoNode': 'set innerHTML', - INSERT_MARKUP: 'set innerHTML', - MOVE_EXISTING: 'move', - REMOVE_NODE: 'remove', - SET_MARKUP: 'set innerHTML', - TEXT_CONTENT: 'set textContent', - 'setValueForProperty': 'update attribute', - 'setValueForAttribute': 'update attribute', - 'deleteValueForProperty': 'remove attribute', - 'setValueForStyles': 'update styles', - 'replaceNodeWithMarkup': 'replace', - 'replaceDelimitedText': 'replace' -}; - -function getTotalTime(measurements) { - // TODO: return number of DOM ops? could be misleading. - // TODO: measure dropped frames after reconcile? - // TODO: log total time of each reconcile and the top-level component - // class that triggered it. - var totalTime = 0; - for (var i = 0; i < measurements.length; i++) { - var measurement = measurements[i]; - totalTime += measurement.totalTime; - } - return totalTime; -} - -function getDOMSummary(measurements) { - var items = []; - measurements.forEach(function (measurement) { - Object.keys(measurement.writes).forEach(function (id) { - measurement.writes[id].forEach(function (write) { - items.push({ - id: id, - type: DOM_OPERATION_TYPES[write.type] || write.type, - args: write.args - }); - }); - }); - }); - return items; -} - -function getExclusiveSummary(measurements) { - var candidates = {}; - var displayName; - - for (var i = 0; i < measurements.length; i++) { - var measurement = measurements[i]; - var allIDs = _assign({}, measurement.exclusive, measurement.inclusive); - - for (var id in allIDs) { - displayName = measurement.displayNames[id].current; - - candidates[displayName] = candidates[displayName] || { - componentName: displayName, - inclusive: 0, - exclusive: 0, - render: 0, - count: 0 - }; - if (measurement.render[id]) { - candidates[displayName].render += measurement.render[id]; - } - if (measurement.exclusive[id]) { - candidates[displayName].exclusive += measurement.exclusive[id]; - } - if (measurement.inclusive[id]) { - candidates[displayName].inclusive += measurement.inclusive[id]; - } - if (measurement.counts[id]) { - candidates[displayName].count += measurement.counts[id]; - } - } - } - - // Now make a sorted array with the results. - var arr = []; - for (displayName in candidates) { - if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) { - arr.push(candidates[displayName]); - } - } - - arr.sort(function (a, b) { - return b.exclusive - a.exclusive; - }); - - return arr; -} - -function getInclusiveSummary(measurements, onlyClean) { - var candidates = {}; - var inclusiveKey; - - for (var i = 0; i < measurements.length; i++) { - var measurement = measurements[i]; - var allIDs = _assign({}, measurement.exclusive, measurement.inclusive); - var cleanComponents; - - if (onlyClean) { - cleanComponents = getUnchangedComponents(measurement); - } - - for (var id in allIDs) { - if (onlyClean && !cleanComponents[id]) { - continue; - } - - var displayName = measurement.displayNames[id]; - - // Inclusive time is not useful for many components without knowing where - // they are instantiated. So we aggregate inclusive time with both the - // owner and current displayName as the key. - inclusiveKey = displayName.owner + ' > ' + displayName.current; - - candidates[inclusiveKey] = candidates[inclusiveKey] || { - componentName: inclusiveKey, - time: 0, - count: 0 - }; - - if (measurement.inclusive[id]) { - candidates[inclusiveKey].time += measurement.inclusive[id]; - } - if (measurement.counts[id]) { - candidates[inclusiveKey].count += measurement.counts[id]; - } - } - } - - // Now make a sorted array with the results. - var arr = []; - for (inclusiveKey in candidates) { - if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) { - arr.push(candidates[inclusiveKey]); - } - } - - arr.sort(function (a, b) { - return b.time - a.time; - }); - - return arr; -} - -function getUnchangedComponents(measurement) { - // For a given reconcile, look at which components did not actually - // render anything to the DOM and return a mapping of their ID to - // the amount of time it took to render the entire subtree. - var cleanComponents = {}; - var writes = measurement.writes; - var hierarchy = measurement.hierarchy; - var dirtyComposites = {}; - Object.keys(writes).forEach(function (id) { - writes[id].forEach(function (write) { - // Root mounting (innerHTML set) is recorded with an ID of '' - if (id !== '' && hierarchy.hasOwnProperty(id)) { - hierarchy[id].forEach(function (c) { - return dirtyComposites[c] = true; - }); - } - }); - }); - var allIDs = _assign({}, measurement.exclusive, measurement.inclusive); - - for (var id in allIDs) { - var isDirty = false; - // See if any of the DOM operations applied to this component's subtree. - if (dirtyComposites[id]) { - isDirty = true; - } - // check if component newly created - if (measurement.created[id]) { - isDirty = true; - } - if (!isDirty && measurement.counts[id] > 0) { - cleanComponents[id] = true; - } - } - return cleanComponents; -} - -var ReactDefaultPerfAnalysis = { - getExclusiveSummary: getExclusiveSummary, - getInclusiveSummary: getInclusiveSummary, - getDOMSummary: getDOMSummary, - getTotalTime: getTotalTime -}; - -module.exports = ReactDefaultPerfAnalysis; -},{"184":184}],66:[function(_dereq_,module,exports){ +},{"108":108,"109":109,"110":110,"13":13,"15":15,"2":2,"22":22,"35":35,"43":43,"45":45,"48":48,"58":58,"6":6,"60":60,"63":63,"70":70,"73":73,"92":92}],65:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -10339,7 +10358,7 @@ module.exports = ReactDefaultPerfAnalysis; var _assign = _dereq_(184); -var ReactCurrentOwner = _dereq_(39); +var ReactCurrentOwner = _dereq_(40); var warning = _dereq_(183); var canDefineProperty = _dereq_(128); @@ -10439,6 +10458,10 @@ var ReactElement = function (type, key, ref, self, source, owner, props) { return element; }; +/** + * Create and return a new ReactElement of the given type. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement + */ ReactElement.createElement = function (type, config, children) { var propName; @@ -10452,6 +10475,11 @@ ReactElement.createElement = function (type, config, children) { if (config != null) { if ("development" !== 'production') { + "development" !== 'production' ? warning( + /* eslint-disable no-proto */ + config.__proto__ == null || config.__proto__ === Object.prototype, + /* eslint-enable no-proto */ + 'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0; ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref; key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key; } else { @@ -10523,6 +10551,10 @@ ReactElement.createElement = function (type, config, children) { return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); }; +/** + * Return a function that produces ReactElements of a given type. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory + */ ReactElement.createFactory = function (type) { var factory = ReactElement.createElement.bind(null, type); // Expose the type on the factory and the prototype so that it can be @@ -10540,6 +10572,10 @@ ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { return newElement; }; +/** + * Clone and return a new ReactElement using element as the starting point. + * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement + */ ReactElement.cloneElement = function (element, config, children) { var propName; @@ -10560,6 +10596,13 @@ ReactElement.cloneElement = function (element, config, children) { var owner = element._owner; if (config != null) { + if ("development" !== 'production') { + "development" !== 'production' ? warning( + /* eslint-disable no-proto */ + config.__proto__ == null || config.__proto__ === Object.prototype, + /* eslint-enable no-proto */ + 'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0; + } if (config.ref !== undefined) { // Silently steal the ref from the parent. ref = config.ref; @@ -10602,6 +10645,8 @@ ReactElement.cloneElement = function (element, config, children) { }; /** + * Verifies the object is a ReactElement. + * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement * @param {?object} object * @return {boolean} True if `object` is a valid component. * @final @@ -10611,7 +10656,7 @@ ReactElement.isValidElement = function (object) { }; module.exports = ReactElement; -},{"128":128,"183":183,"184":184,"39":39}],67:[function(_dereq_,module,exports){ +},{"128":128,"183":183,"184":184,"40":40}],66:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -10632,10 +10677,10 @@ module.exports = ReactElement; 'use strict'; -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var ReactPropTypeLocations = _dereq_(90); var ReactPropTypeLocationNames = _dereq_(89); -var ReactCurrentOwner = _dereq_(39); +var ReactCurrentOwner = _dereq_(40); var canDefineProperty = _dereq_(128); var getIteratorFn = _dereq_(139); @@ -10893,7 +10938,7 @@ var ReactElementValidator = { }; module.exports = ReactElementValidator; -},{"128":128,"139":139,"173":173,"183":183,"39":39,"66":66,"89":89,"90":90}],68:[function(_dereq_,module,exports){ +},{"128":128,"139":139,"173":173,"183":183,"40":40,"65":65,"89":89,"90":90}],67:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -10924,7 +10969,7 @@ var ReactEmptyComponent = { ReactEmptyComponent.injection = ReactEmptyComponentInjection; module.exports = ReactEmptyComponent; -},{}],69:[function(_dereq_,module,exports){ +},{}],68:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11001,7 +11046,7 @@ if ("development" !== 'production') { } module.exports = ReactErrorUtils; -},{}],70:[function(_dereq_,module,exports){ +},{}],69:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11035,7 +11080,7 @@ var ReactEventEmitterMixin = { }; module.exports = ReactEventEmitterMixin; -},{"17":17}],71:[function(_dereq_,module,exports){ +},{"17":17}],70:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11054,7 +11099,7 @@ var _assign = _dereq_(184); var EventListener = _dereq_(158); var ExecutionEnvironment = _dereq_(159); var PooledClass = _dereq_(26); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var ReactUpdates = _dereq_(104); var getEventTarget = _dereq_(138); @@ -11193,7 +11238,7 @@ var ReactEventListener = { }; module.exports = ReactEventListener; -},{"104":104,"138":138,"158":158,"159":159,"170":170,"184":184,"26":26,"44":44}],72:[function(_dereq_,module,exports){ +},{"104":104,"138":138,"158":158,"159":159,"170":170,"184":184,"26":26,"45":45}],71:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11215,7 +11260,7 @@ var ReactFeatureFlags = { }; module.exports = ReactFeatureFlags; -},{}],73:[function(_dereq_,module,exports){ +},{}],72:[function(_dereq_,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -11230,7 +11275,7 @@ module.exports = ReactFeatureFlags; 'use strict'; var ReactChildren = _dereq_(32); -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var emptyFunction = _dereq_(165); var invariant = _dereq_(173); @@ -11249,8 +11294,11 @@ var numericPropertyRegex = /^\d+$/; var warnedAboutNumeric = false; var ReactFragment = { - // Wrap a keyed object in an opaque proxy that warns you if you access any - // of its properties. + /** + * Wrap a keyed object in an opaque proxy that warns you if you access any + * of its properties. + * See https://facebook.github.io/react/docs/create-fragment.html + */ create: function (object) { if (typeof object !== 'object' || !object || Array.isArray(object)) { "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0; @@ -11280,7 +11328,7 @@ var ReactFragment = { }; module.exports = ReactFragment; -},{"165":165,"173":173,"183":183,"32":32,"66":66}],74:[function(_dereq_,module,exports){ +},{"165":165,"173":173,"183":183,"32":32,"65":65}],73:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11299,10 +11347,9 @@ var EventPluginHub = _dereq_(17); var EventPluginUtils = _dereq_(19); var ReactComponentEnvironment = _dereq_(36); var ReactClass = _dereq_(33); -var ReactEmptyComponent = _dereq_(68); +var ReactEmptyComponent = _dereq_(67); var ReactBrowserEventEmitter = _dereq_(28); -var ReactNativeComponent = _dereq_(84); -var ReactPerf = _dereq_(88); +var ReactNativeComponent = _dereq_(83); var ReactUpdates = _dereq_(104); var ReactInjection = { @@ -11314,12 +11361,11 @@ var ReactInjection = { EventPluginUtils: EventPluginUtils.injection, EventEmitter: ReactBrowserEventEmitter.injection, NativeComponent: ReactNativeComponent.injection, - Perf: ReactPerf.injection, Updates: ReactUpdates.injection }; module.exports = ReactInjection; -},{"10":10,"104":104,"17":17,"19":19,"28":28,"33":33,"36":36,"68":68,"84":84,"88":88}],75:[function(_dereq_,module,exports){ +},{"10":10,"104":104,"17":17,"19":19,"28":28,"33":33,"36":36,"67":67,"83":83}],74:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11333,7 +11379,7 @@ module.exports = ReactInjection; 'use strict'; -var ReactDOMSelection = _dereq_(55); +var ReactDOMSelection = _dereq_(56); var containsNode = _dereq_(162); var focusNode = _dereq_(167); @@ -11444,7 +11490,7 @@ var ReactInputSelection = { }; module.exports = ReactInputSelection; -},{"162":162,"167":167,"168":168,"55":55}],76:[function(_dereq_,module,exports){ +},{"162":162,"167":167,"168":168,"56":56}],75:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11493,7 +11539,7 @@ var ReactInstanceMap = { }; module.exports = ReactInstanceMap; -},{}],77:[function(_dereq_,module,exports){ +},{}],76:[function(_dereq_,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -11507,10 +11553,10 @@ module.exports = ReactInstanceMap; 'use strict'; -var ReactDebugTool = _dereq_(61); +var ReactDebugTool = _dereq_(62); module.exports = { debugTool: ReactDebugTool }; -},{"61":61}],78:[function(_dereq_,module,exports){ +},{"62":62}],77:[function(_dereq_,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -11547,7 +11593,7 @@ var ReactInvalidSetStateWarningDevTool = { }; module.exports = ReactInvalidSetStateWarningDevTool; -},{"183":183}],79:[function(_dereq_,module,exports){ +},{"183":183}],78:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11587,6 +11633,9 @@ module.exports = ReactInvalidSetStateWarningDevTool; var React = _dereq_(27); /** + * Deprecated: An an easy way to express two-way binding with React. + * See https://facebook.github.io/react/docs/two-way-binding-helpers.html + * * @param {*} value current value of the link * @param {function} requestChange callback to request a change */ @@ -11616,7 +11665,7 @@ ReactLink.PropTypes = { }; module.exports = ReactLink; -},{"27":27}],80:[function(_dereq_,module,exports){ +},{"27":27}],79:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11667,7 +11716,7 @@ var ReactMarkupChecksum = { }; module.exports = ReactMarkupChecksum; -},{"127":127}],81:[function(_dereq_,module,exports){ +},{"127":127}],80:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11684,15 +11733,14 @@ module.exports = ReactMarkupChecksum; var DOMLazyTree = _dereq_(8); var DOMProperty = _dereq_(10); var ReactBrowserEventEmitter = _dereq_(28); -var ReactCurrentOwner = _dereq_(39); -var ReactDOMComponentTree = _dereq_(44); -var ReactDOMContainerInfo = _dereq_(45); -var ReactDOMFeatureFlags = _dereq_(49); -var ReactElement = _dereq_(66); -var ReactFeatureFlags = _dereq_(72); -var ReactInstrumentation = _dereq_(77); -var ReactMarkupChecksum = _dereq_(80); -var ReactPerf = _dereq_(88); +var ReactCurrentOwner = _dereq_(40); +var ReactDOMComponentTree = _dereq_(45); +var ReactDOMContainerInfo = _dereq_(46); +var ReactDOMFeatureFlags = _dereq_(50); +var ReactElement = _dereq_(65); +var ReactFeatureFlags = _dereq_(71); +var ReactInstrumentation = _dereq_(76); +var ReactMarkupChecksum = _dereq_(79); var ReactReconciler = _dereq_(93); var ReactUpdateQueue = _dereq_(103); var ReactUpdates = _dereq_(104); @@ -11930,6 +11978,10 @@ var ReactMount = { * @return {ReactComponent} nextComponent */ _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onBeginFlush(); + } + // Various parts of our code (such as ReactCompositeComponent's // _renderValidatedComponent) assume that calls to render aren't nested; // verify that that's the case. @@ -11940,6 +11992,12 @@ var ReactMount = { ReactBrowserEventEmitter.ensureScrollValueMonitoring(); var componentInstance = instantiateReactComponent(nextElement); + if ("development" !== 'production') { + // Mute future events from the top level wrapper. + // It is an implementation detail that devtools should not know about. + componentInstance._debugID = 0; + } + // The initial render is synchronous but any updates that happen during // rendering, in componentWillMount or componentDidMount, will be batched // according to the current batching strategy. @@ -11950,7 +12008,9 @@ var ReactMount = { instancesByReactRootID[wrapperID] = componentInstance; if ("development" !== 'production') { - ReactInstrumentation.debugTool.onMountRootComponent(componentInstance); + // The instance here is TopLevelWrapper so we report mount for its child. + ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID); + ReactInstrumentation.debugTool.onEndFlush(); } return componentInstance; @@ -12030,6 +12090,7 @@ var ReactMount = { /** * Renders a React component into the DOM in the supplied `container`. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render * * If the React component was previously rendered into `container`, this will * perform an update on it and only mutate the DOM as necessary to reflect the @@ -12046,6 +12107,7 @@ var ReactMount = { /** * Unmounts and destroys the React component rendered in the `container`. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode * * @param {DOMElement} container DOM element containing a React component. * @return {boolean} True if a component was found in and unmounted from @@ -12137,16 +12199,18 @@ var ReactMount = { setInnerHTML(container, markup); ReactDOMComponentTree.precacheNode(instance, container.firstChild); } + + if ("development" !== 'production') { + var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild); + if (nativeNode._debugID !== 0) { + ReactInstrumentation.debugTool.onNativeOperation(nativeNode._debugID, 'mount', markup.toString()); + } + } } }; -ReactPerf.measureMethods(ReactMount, 'ReactMount', { - _renderNewRootComponent: '_renderNewRootComponent', - _mountImageIntoNode: '_mountImageIntoNode' -}); - module.exports = ReactMount; -},{"10":10,"103":103,"104":104,"144":144,"150":150,"153":153,"166":166,"173":173,"183":183,"28":28,"39":39,"44":44,"45":45,"49":49,"66":66,"72":72,"77":77,"8":8,"80":80,"88":88,"93":93}],82:[function(_dereq_,module,exports){ +},{"10":10,"103":103,"104":104,"144":144,"150":150,"153":153,"166":166,"173":173,"183":183,"28":28,"40":40,"45":45,"46":46,"50":50,"65":65,"71":71,"76":76,"79":79,"8":8,"93":93}],81:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -12161,12 +12225,14 @@ module.exports = ReactMount; 'use strict'; var ReactComponentEnvironment = _dereq_(36); -var ReactMultiChildUpdateTypes = _dereq_(83); +var ReactInstrumentation = _dereq_(76); +var ReactMultiChildUpdateTypes = _dereq_(82); -var ReactCurrentOwner = _dereq_(39); +var ReactCurrentOwner = _dereq_(40); var ReactReconciler = _dereq_(93); var ReactChildReconciler = _dereq_(31); +var emptyFunction = _dereq_(165); var flattenChildren = _dereq_(133); var invariant = _dereq_(173); @@ -12283,6 +12349,15 @@ function processQueue(inst, updateQueue) { ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue); } +var setChildrenForInstrumentation = emptyFunction; +if ("development" !== 'production') { + setChildrenForInstrumentation = function (children) { + ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) { + return children[key]._debugID; + }) : []); + }; +} + /** * ReactMultiChild are capable of reconciling multiple children. * @@ -12344,6 +12419,7 @@ var ReactMultiChild = { mountChildren: function (nestedChildren, transaction, context) { var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); this._renderedChildren = children; + var mountImages = []; var index = 0; for (var name in children) { @@ -12354,6 +12430,11 @@ var ReactMultiChild = { mountImages.push(mountImage); } } + + if ("development" !== 'production') { + setChildrenForInstrumentation.call(this, children); + } + return mountImages; }, @@ -12460,6 +12541,10 @@ var ReactMultiChild = { processQueue(this, updates); } this._renderedChildren = nextChildren; + + if ("development" !== 'production') { + setChildrenForInstrumentation.call(this, nextChildren); + } }, /** @@ -12549,7 +12634,7 @@ var ReactMultiChild = { }; module.exports = ReactMultiChild; -},{"133":133,"173":173,"31":31,"36":36,"39":39,"83":83,"93":93}],83:[function(_dereq_,module,exports){ +},{"133":133,"165":165,"173":173,"31":31,"36":36,"40":40,"76":76,"82":82,"93":93}],82:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -12582,7 +12667,7 @@ var ReactMultiChildUpdateTypes = keyMirror({ }); module.exports = ReactMultiChildUpdateTypes; -},{"176":176}],84:[function(_dereq_,module,exports){ +},{"176":176}],83:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -12678,7 +12763,45 @@ var ReactNativeComponent = { }; module.exports = ReactNativeComponent; -},{"173":173,"184":184}],85:[function(_dereq_,module,exports){ +},{"173":173,"184":184}],84:[function(_dereq_,module,exports){ +/** + * Copyright 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactNativeOperationHistoryDevtool + */ + +'use strict'; + +var history = []; + +var ReactNativeOperationHistoryDevtool = { + onNativeOperation: function (debugID, type, payload) { + history.push({ + instanceID: debugID, + type: type, + payload: payload + }); + }, + clearHistory: function () { + if (ReactNativeOperationHistoryDevtool._preventClearing) { + // Should only be used for tests. + return; + } + + history = []; + }, + getHistory: function () { + return history; + } +}; + +module.exports = ReactNativeOperationHistoryDevtool; +},{}],85:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -12692,7 +12815,7 @@ module.exports = ReactNativeComponent; 'use strict'; -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var invariant = _dereq_(173); @@ -12716,7 +12839,7 @@ var ReactNodeTypes = { }; module.exports = ReactNodeTypes; -},{"173":173,"66":66}],86:[function(_dereq_,module,exports){ +},{"173":173,"65":65}],86:[function(_dereq_,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -12907,7 +13030,7 @@ var ReactOwner = { module.exports = ReactOwner; },{"173":173}],88:[function(_dereq_,module,exports){ /** - * Copyright 2013-present, Facebook, Inc. + * Copyright 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the @@ -12919,90 +13042,412 @@ module.exports = ReactOwner; 'use strict'; -/** - * ReactPerf is a general AOP system designed to measure performance. This - * module only has the hooks: see ReactDefaultPerf for the analysis tool. - */ +var _assign = _dereq_(184); -var ReactPerf = { - /** - * Boolean to enable/disable measurement. Set to false by default to prevent - * accidental logging and perf loss. - */ - enableMeasure: false, +var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - /** - * Holds onto the measure function in use. By default, don't measure - * anything, but we'll override this if we inject a measure function. - */ - storedMeasure: _noMeasure, +var ReactDebugTool = _dereq_(62); +var warning = _dereq_(183); - /** - * @param {object} object - * @param {string} objectName - * @param {object} methodNames - */ - measureMethods: function (object, objectName, methodNames) { - if ("development" !== 'production') { - for (var key in methodNames) { - if (!methodNames.hasOwnProperty(key)) { - continue; - } - object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]); - } - } - }, +function roundFloat(val) { + var base = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1]; - /** - * Use this to wrap methods you want to measure. Zero overhead in production. - * - * @param {string} objName - * @param {string} fnName - * @param {function} func - * @return {function} - */ - measure: function (objName, fnName, func) { - if ("development" !== 'production') { - var measuredFunc = null; - var wrapper = function () { - if (ReactPerf.enableMeasure) { - if (!measuredFunc) { - measuredFunc = ReactPerf.storedMeasure(objName, fnName, func); - } - return measuredFunc.apply(this, arguments); - } - return func.apply(this, arguments); - }; - wrapper.displayName = objName + '_' + fnName; - return wrapper; - } - return func; - }, - - injection: { - /** - * @param {function} measure - */ - injectMeasure: function (measure) { - ReactPerf.storedMeasure = measure; - } - } -}; - -/** - * Simply passes through the measured function, without measuring it. - * - * @param {string} objName - * @param {string} fnName - * @param {function} func - * @return {function} - */ -function _noMeasure(objName, fnName, func) { - return func; + var n = Math.pow(10, base); + return Math.floor(val * n) / n; } -module.exports = ReactPerf; -},{}],89:[function(_dereq_,module,exports){ +function getFlushHistory() { + return ReactDebugTool.getFlushHistory(); +} + +function getExclusive() { + var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0]; + + var aggregatedStats = {}; + var affectedIDs = {}; + + function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) { + var displayName = treeSnapshot[instanceID].displayName; + + var key = displayName; + var stats = aggregatedStats[key]; + if (!stats) { + affectedIDs[key] = {}; + stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + counts: {}, + durations: {}, + totalDuration: 0 + }; + } + if (!stats.durations[timerType]) { + stats.durations[timerType] = 0; + } + if (!stats.counts[timerType]) { + stats.counts[timerType] = 0; + } + affectedIDs[key][instanceID] = true; + applyUpdate(stats); + } + + flushHistory.forEach(function (flush) { + var measurements = flush.measurements; + var treeSnapshot = flush.treeSnapshot; + + measurements.forEach(function (measurement) { + var duration = measurement.duration; + var instanceID = measurement.instanceID; + var timerType = measurement.timerType; + + updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) { + stats.totalDuration += duration; + stats.durations[timerType] += duration; + stats.counts[timerType]++; + }); + }); + }); + + return Object.keys(aggregatedStats).map(function (key) { + return _extends({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function (a, b) { + return b.totalDuration - a.totalDuration; + }); +} + +function getInclusive() { + var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0]; + + var aggregatedStats = {}; + var affectedIDs = {}; + + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc = treeSnapshot[instanceID]; + var displayName = _treeSnapshot$instanc.displayName; + var ownerID = _treeSnapshot$instanc.ownerID; + + var owner = treeSnapshot[ownerID]; + var key = (owner ? owner.displayName + ' > ' : '') + displayName; + var stats = aggregatedStats[key]; + if (!stats) { + affectedIDs[key] = {}; + stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }; + } + affectedIDs[key][instanceID] = true; + applyUpdate(stats); + } + + var isCompositeByID = {}; + flushHistory.forEach(function (flush) { + var measurements = flush.measurements; + + measurements.forEach(function (measurement) { + var instanceID = measurement.instanceID; + var timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + isCompositeByID[instanceID] = true; + }); + }); + + flushHistory.forEach(function (flush) { + var measurements = flush.measurements; + var treeSnapshot = flush.treeSnapshot; + + measurements.forEach(function (measurement) { + var duration = measurement.duration; + var instanceID = measurement.instanceID; + var timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + updateAggregatedStats(treeSnapshot, instanceID, function (stats) { + stats.renderCount++; + }); + var nextParentID = instanceID; + while (nextParentID) { + // As we traverse parents, only count inclusive time towards composites. + // We know something is a composite if its render() was called. + if (isCompositeByID[nextParentID]) { + updateAggregatedStats(treeSnapshot, nextParentID, function (stats) { + stats.inclusiveRenderDuration += duration; + }); + } + nextParentID = treeSnapshot[nextParentID].parentID; + } + }); + }); + + return Object.keys(aggregatedStats).map(function (key) { + return _extends({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function (a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; + }); +} + +function getWasted() { + var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0]; + + var aggregatedStats = {}; + var affectedIDs = {}; + + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc2 = treeSnapshot[instanceID]; + var displayName = _treeSnapshot$instanc2.displayName; + var ownerID = _treeSnapshot$instanc2.ownerID; + + var owner = treeSnapshot[ownerID]; + var key = (owner ? owner.displayName + ' > ' : '') + displayName; + var stats = aggregatedStats[key]; + if (!stats) { + affectedIDs[key] = {}; + stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }; + } + affectedIDs[key][instanceID] = true; + applyUpdate(stats); + } + + flushHistory.forEach(function (flush) { + var measurements = flush.measurements; + var treeSnapshot = flush.treeSnapshot; + var operations = flush.operations; + + var isDefinitelyNotWastedByID = {}; + + // Find native components associated with an operation in this batch. + // Mark all components in their parent tree as definitely not wasted. + operations.forEach(function (operation) { + var instanceID = operation.instanceID; + + var nextParentID = instanceID; + while (nextParentID) { + isDefinitelyNotWastedByID[nextParentID] = true; + nextParentID = treeSnapshot[nextParentID].parentID; + } + }); + + // Find composite components that rendered in this batch. + // These are potential candidates for being wasted renders. + var renderedCompositeIDs = {}; + measurements.forEach(function (measurement) { + var instanceID = measurement.instanceID; + var timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + renderedCompositeIDs[instanceID] = true; + }); + + measurements.forEach(function (measurement) { + var duration = measurement.duration; + var instanceID = measurement.instanceID; + var timerType = measurement.timerType; + + if (timerType !== 'render') { + return; + } + + // If there was a DOM update below this component, or it has just been + // mounted, its render() is not considered wasted. + var updateCount = treeSnapshot[instanceID].updateCount; + + if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) { + return; + } + + // We consider this render() wasted. + updateAggregatedStats(treeSnapshot, instanceID, function (stats) { + stats.renderCount++; + }); + + var nextParentID = instanceID; + while (nextParentID) { + // Any parents rendered during this batch are considered wasted + // unless we previously marked them as dirty. + var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID]; + if (isWasted) { + updateAggregatedStats(treeSnapshot, nextParentID, function (stats) { + stats.inclusiveRenderDuration += duration; + }); + } + nextParentID = treeSnapshot[nextParentID].parentID; + } + }); + }); + + return Object.keys(aggregatedStats).map(function (key) { + return _extends({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function (a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; + }); +} + +function getOperations() { + var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0]; + + var stats = []; + flushHistory.forEach(function (flush, flushIndex) { + var operations = flush.operations; + var treeSnapshot = flush.treeSnapshot; + + operations.forEach(function (operation) { + var instanceID = operation.instanceID; + var type = operation.type; + var payload = operation.payload; + var _treeSnapshot$instanc3 = treeSnapshot[instanceID]; + var displayName = _treeSnapshot$instanc3.displayName; + var ownerID = _treeSnapshot$instanc3.ownerID; + + var owner = treeSnapshot[ownerID]; + var key = (owner ? owner.displayName + ' > ' : '') + displayName; + + stats.push({ + flushIndex: flushIndex, + instanceID: instanceID, + key: key, + type: type, + ownerID: ownerID, + payload: payload + }); + }); + }); + return stats; +} + +function printExclusive(flushHistory) { + var stats = getExclusive(flushHistory); + var table = stats.map(function (item) { + var key = item.key; + var instanceCount = item.instanceCount; + var totalDuration = item.totalDuration; + + var renderCount = item.counts.render || 0; + var renderDuration = item.durations.render || 0; + return { + 'Component': key, + 'Total time (ms)': roundFloat(totalDuration), + 'Instance count': instanceCount, + 'Total render time (ms)': roundFloat(renderDuration), + 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined, + 'Render count': renderCount, + 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration) + }; + }); + console.table(table); +} + +function printInclusive(flushHistory) { + var stats = getInclusive(flushHistory); + var table = stats.map(function (item) { + var key = item.key; + var instanceCount = item.instanceCount; + var inclusiveRenderDuration = item.inclusiveRenderDuration; + var renderCount = item.renderCount; + + return { + 'Owner > Component': key, + 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration), + 'Instance count': instanceCount, + 'Render count': renderCount + }; + }); + console.table(table); +} + +function printWasted(flushHistory) { + var stats = getWasted(flushHistory); + var table = stats.map(function (item) { + var key = item.key; + var instanceCount = item.instanceCount; + var inclusiveRenderDuration = item.inclusiveRenderDuration; + var renderCount = item.renderCount; + + return { + 'Owner > Component': key, + 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration), + 'Instance count': instanceCount, + 'Render count': renderCount + }; + }); + console.table(table); +} + +function printOperations(flushHistory) { + var stats = getOperations(flushHistory); + var table = stats.map(function (stat) { + return { + 'Owner > Node': stat.key, + 'Operation': stat.type, + 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload, + 'Flush index': stat.flushIndex, + 'Owner Component ID': stat.ownerID, + 'DOM Component ID': stat.instanceID + }; + }); + console.table(table); +} + +var warnedAboutPrintDOM = false; +function printDOM(measurements) { + "development" !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0; + warnedAboutPrintDOM = true; + return printOperations(measurements); +} + +var warnedAboutGetMeasurementsSummaryMap = false; +function getMeasurementsSummaryMap(measurements) { + "development" !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0; + warnedAboutGetMeasurementsSummaryMap = true; + return getWasted(measurements); +} + +function start() { + ReactDebugTool.beginProfiling(); +} + +function stop() { + ReactDebugTool.endProfiling(); +} + +var ReactPerfAnalysis = { + getLastMeasurements: getFlushHistory, + getExclusive: getExclusive, + getInclusive: getInclusive, + getWasted: getWasted, + getOperations: getOperations, + printExclusive: printExclusive, + printInclusive: printInclusive, + printWasted: printWasted, + printOperations: printOperations, + start: start, + stop: stop, + // Deprecated: + printDOM: printDOM, + getMeasurementsSummaryMap: getMeasurementsSummaryMap +}; + +module.exports = ReactPerfAnalysis; +},{"183":183,"184":184,"62":62}],89:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13064,7 +13509,7 @@ module.exports = ReactPropTypeLocations; 'use strict'; -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var ReactPropTypeLocationNames = _dereq_(89); var emptyFunction = _dereq_(165); @@ -13431,7 +13876,7 @@ function getClassName(propValue) { } module.exports = ReactPropTypes; -},{"139":139,"165":165,"66":66,"89":89}],92:[function(_dereq_,module,exports){ +},{"139":139,"165":165,"65":65,"89":89}],92:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13450,7 +13895,7 @@ var _assign = _dereq_(184); var CallbackQueue = _dereq_(5); var PooledClass = _dereq_(26); var ReactBrowserEventEmitter = _dereq_(28); -var ReactInputSelection = _dereq_(75); +var ReactInputSelection = _dereq_(74); var Transaction = _dereq_(124); /** @@ -13594,7 +14039,7 @@ _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin); PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; -},{"124":124,"184":184,"26":26,"28":28,"5":5,"75":75}],93:[function(_dereq_,module,exports){ +},{"124":124,"184":184,"26":26,"28":28,"5":5,"74":74}],93:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13609,7 +14054,9 @@ module.exports = ReactReconcileTransaction; 'use strict'; var ReactRef = _dereq_(94); -var ReactInstrumentation = _dereq_(77); +var ReactInstrumentation = _dereq_(76); + +var invariant = _dereq_(173); /** * Helper to call ReactRef.attachRefs with this composite component, split out @@ -13633,12 +14080,20 @@ var ReactReconciler = { * @internal */ mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) { + if ("development" !== 'production') { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent'); + } + } var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context); if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { transaction.getReactMountReady().enqueue(attachRefs, internalInstance); } if ("development" !== 'production') { - ReactInstrumentation.debugTool.onMountComponent(internalInstance); + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent'); + ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID); + } } return markup; }, @@ -13658,10 +14113,18 @@ var ReactReconciler = { * @internal */ unmountComponent: function (internalInstance, safely) { + if ("development" !== 'production') { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent'); + } + } ReactRef.detachRefs(internalInstance, internalInstance._currentElement); internalInstance.unmountComponent(safely); if ("development" !== 'production') { - ReactInstrumentation.debugTool.onUnmountComponent(internalInstance); + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent'); + ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); + } } }, @@ -13691,6 +14154,12 @@ var ReactReconciler = { return; } + if ("development" !== 'production') { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent'); + } + } + var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement); if (refsChanged) { @@ -13704,7 +14173,10 @@ var ReactReconciler = { } if ("development" !== 'production') { - ReactInstrumentation.debugTool.onUpdateComponent(internalInstance); + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent'); + ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + } } }, @@ -13715,17 +14187,31 @@ var ReactReconciler = { * @param {ReactReconcileTransaction} transaction * @internal */ - performUpdateIfNecessary: function (internalInstance, transaction) { + performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) { + if (internalInstance._updateBatchNumber !== updateBatchNumber) { + // The component's enqueued batch number should always be the current + // batch or the following one. + !(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? "development" !== 'production' ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0; + return; + } + if ("development" !== 'production') { + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary'); + } + } internalInstance.performUpdateIfNecessary(transaction); if ("development" !== 'production') { - ReactInstrumentation.debugTool.onUpdateComponent(internalInstance); + if (internalInstance._debugID !== 0) { + ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary'); + ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + } } } }; module.exports = ReactReconciler; -},{"77":77,"94":94}],94:[function(_dereq_,module,exports){ +},{"173":173,"76":76,"94":94}],94:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13840,10 +14326,12 @@ module.exports = ReactServerBatchingStrategy; */ 'use strict'; -var ReactDOMContainerInfo = _dereq_(45); -var ReactDefaultBatchingStrategy = _dereq_(62); -var ReactElement = _dereq_(66); -var ReactMarkupChecksum = _dereq_(80); +var ReactDOMContainerInfo = _dereq_(46); +var ReactDefaultBatchingStrategy = _dereq_(63); +var ReactElement = _dereq_(65); +var ReactInstrumentation = _dereq_(76); +var ReactMarkupChecksum = _dereq_(79); +var ReactReconciler = _dereq_(93); var ReactServerBatchingStrategy = _dereq_(95); var ReactServerRenderingTransaction = _dereq_(97); var ReactUpdates = _dereq_(104); @@ -13864,8 +14352,15 @@ function renderToStringImpl(element, makeStaticMarkup) { transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup); return transaction.perform(function () { + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onBeginFlush(); + } var componentInstance = instantiateReactComponent(element); - var markup = componentInstance.mountComponent(transaction, null, ReactDOMContainerInfo(), emptyObject); + var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject); + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID); + ReactInstrumentation.debugTool.onEndFlush(); + } if (!makeStaticMarkup) { markup = ReactMarkupChecksum.addChecksumToMarkup(markup); } @@ -13879,11 +14374,21 @@ function renderToStringImpl(element, makeStaticMarkup) { } } +/** + * Render a ReactElement to its initial HTML. This should only be used on the + * server. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring + */ function renderToString(element) { !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : void 0; return renderToStringImpl(element, false); } +/** + * Similar to renderToString, except this doesn't create extra DOM attributes + * such as data-react-id that React uses internally. + * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup + */ function renderToStaticMarkup(element) { !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : void 0; return renderToStringImpl(element, true); @@ -13893,7 +14398,7 @@ module.exports = { renderToString: renderToString, renderToStaticMarkup: renderToStaticMarkup }; -},{"104":104,"144":144,"166":166,"173":173,"45":45,"62":62,"66":66,"80":80,"95":95,"97":97}],97:[function(_dereq_,module,exports){ +},{"104":104,"144":144,"166":166,"173":173,"46":46,"63":63,"65":65,"76":76,"79":79,"93":93,"95":95,"97":97}],97:[function(_dereq_,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -13955,7 +14460,11 @@ var Mixin = { * `PooledClass` looks for this, and will invoke this before allowing this * instance to be reused. */ - destructor: function () {} + destructor: function () {}, + + checkpoint: function () {}, + + rollback: function () {} }; _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin); @@ -14089,13 +14598,13 @@ var EventPluginHub = _dereq_(17); var EventPluginRegistry = _dereq_(18); var EventPropagators = _dereq_(20); var React = _dereq_(27); -var ReactDefaultInjection = _dereq_(63); -var ReactDOM = _dereq_(40); -var ReactDOMComponentTree = _dereq_(44); -var ReactElement = _dereq_(66); +var ReactDefaultInjection = _dereq_(64); +var ReactDOM = _dereq_(41); +var ReactDOMComponentTree = _dereq_(45); +var ReactElement = _dereq_(65); var ReactBrowserEventEmitter = _dereq_(28); -var ReactCompositeComponent = _dereq_(38); -var ReactInstanceMap = _dereq_(76); +var ReactCompositeComponent = _dereq_(39); +var ReactInstanceMap = _dereq_(75); var ReactUpdates = _dereq_(104); var SyntheticEvent = _dereq_(115); @@ -14134,6 +14643,10 @@ function findAllInRenderedTreeInternal(inst, test) { } /** + * Utilities for making it easy to test React components. + * + * See https://facebook.github.io/react/docs/test-utils.html + * * Todo: Support the entire DOM.scry query syntax. For now, these simple * utilities will suffice for testing purposes. * @lends ReactTestUtils @@ -14378,9 +14891,12 @@ ReactShallowRenderer.prototype.getMountedInstance = function () { return this._instance ? this._instance._instance : null; }; +var nextDebugID = 1; + var NoopInternalComponent = function (element) { this._renderedOutput = element; this._currentElement = element; + this._debugID = nextDebugID++; }; NoopInternalComponent.prototype = { @@ -14404,6 +14920,7 @@ NoopInternalComponent.prototype = { }; var ShallowComponentWrapper = function (element) { + this._debugID = nextDebugID++; this.construct(element); }; _assign(ShallowComponentWrapper.prototype, ReactCompositeComponent.Mixin, { @@ -14568,7 +15085,7 @@ Object.keys(topLevelTypes).forEach(function (eventType) { }); module.exports = ReactTestUtils; -},{"104":104,"115":115,"132":132,"16":16,"166":166,"17":17,"173":173,"18":18,"184":184,"20":20,"27":27,"28":28,"38":38,"40":40,"44":44,"63":63,"66":66,"76":76}],100:[function(_dereq_,module,exports){ +},{"104":104,"115":115,"132":132,"16":16,"166":166,"17":17,"173":173,"18":18,"184":184,"20":20,"27":27,"28":28,"39":39,"41":41,"45":45,"64":64,"65":65,"75":75}],100:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -14761,6 +15278,11 @@ var ReactTransitionChildMapping = _dereq_(100); var emptyFunction = _dereq_(165); +/** + * A basis for animatins. When children are declaratively added or removed, + * special lifecycle hooks are called. + * See https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup + */ var ReactTransitionGroup = React.createClass({ displayName: 'ReactTransitionGroup', @@ -14961,8 +15483,8 @@ module.exports = ReactTransitionGroup; 'use strict'; -var ReactCurrentOwner = _dereq_(39); -var ReactInstanceMap = _dereq_(76); +var ReactCurrentOwner = _dereq_(40); +var ReactInstanceMap = _dereq_(75); var ReactUpdates = _dereq_(104); var invariant = _dereq_(173); @@ -15163,7 +15685,7 @@ var ReactUpdateQueue = { }; module.exports = ReactUpdateQueue; -},{"104":104,"173":173,"183":183,"39":39,"76":76}],104:[function(_dereq_,module,exports){ +},{"104":104,"173":173,"183":183,"40":40,"75":75}],104:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15181,14 +15703,15 @@ var _assign = _dereq_(184); var CallbackQueue = _dereq_(5); var PooledClass = _dereq_(26); -var ReactFeatureFlags = _dereq_(72); -var ReactPerf = _dereq_(88); +var ReactFeatureFlags = _dereq_(71); +var ReactInstrumentation = _dereq_(76); var ReactReconciler = _dereq_(93); var Transaction = _dereq_(124); var invariant = _dereq_(173); var dirtyComponents = []; +var updateBatchNumber = 0; var asapCallbackQueue = CallbackQueue.getPooled(); var asapEnqueued = false; @@ -15283,6 +15806,13 @@ function runBatchedUpdates(transaction) { // them before their children by sorting the array. dirtyComponents.sort(mountOrderComparator); + // Any updates enqueued while reconciling must be performed after this entire + // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and + // C, B could update twice in a single batch if C's render enqueues an update + // to B (since B would have already updated, we should skip it, and the only + // way we can know to do so is by checking the batch counter). + updateBatchNumber++; + for (var i = 0; i < len; i++) { // If a component is unmounted before pending changes apply, it will still // be here, but we assume that it has cleared its _pendingCallbacks and @@ -15306,7 +15836,7 @@ function runBatchedUpdates(transaction) { console.time(markerName); } - ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction); + ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); if (markerName) { console.timeEnd(markerName); @@ -15321,6 +15851,10 @@ function runBatchedUpdates(transaction) { } var flushBatchedUpdates = function () { + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onBeginFlush(); + } + // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents // array and perform any updates enqueued by mount-ready handlers (i.e., // componentDidUpdate) but we need to check here too in order to catch @@ -15340,8 +15874,11 @@ var flushBatchedUpdates = function () { CallbackQueue.release(queue); } } + + if ("development" !== 'production') { + ReactInstrumentation.debugTool.onEndFlush(); + } }; -flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates); /** * Mark a component as needing a rerender, adding an optional callback to a @@ -15362,6 +15899,9 @@ function enqueueUpdate(component) { } dirtyComponents.push(component); + if (component._updateBatchNumber == null) { + component._updateBatchNumber = updateBatchNumber + 1; + } } /** @@ -15405,7 +15945,7 @@ var ReactUpdates = { }; module.exports = ReactUpdates; -},{"124":124,"173":173,"184":184,"26":26,"5":5,"72":72,"88":88,"93":93}],105:[function(_dereq_,module,exports){ +},{"124":124,"173":173,"184":184,"26":26,"5":5,"71":71,"76":76,"93":93}],105:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15419,7 +15959,7 @@ module.exports = ReactUpdates; 'use strict'; -module.exports = '15.0.2'; +module.exports = '15.1.0'; },{}],106:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. @@ -15436,9 +15976,9 @@ module.exports = '15.0.2'; var LinkedStateMixin = _dereq_(24); var React = _dereq_(27); -var ReactComponentWithPureRenderMixin = _dereq_(37); +var ReactComponentWithPureRenderMixin = _dereq_(38); var ReactCSSTransitionGroup = _dereq_(29); -var ReactFragment = _dereq_(73); +var ReactFragment = _dereq_(72); var ReactTransitionGroup = _dereq_(102); var shallowCompare = _dereq_(152); @@ -15456,12 +15996,12 @@ React.addons = { }; if ("development" !== 'production') { - React.addons.Perf = _dereq_(64); + React.addons.Perf = _dereq_(88); React.addons.TestUtils = _dereq_(99); } module.exports = React; -},{"102":102,"152":152,"155":155,"24":24,"27":27,"29":29,"37":37,"64":64,"73":73,"99":99}],107:[function(_dereq_,module,exports){ +},{"102":102,"152":152,"155":155,"24":24,"27":27,"29":29,"38":38,"72":72,"88":88,"99":99}],107:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15477,8 +16017,8 @@ module.exports = React; var _assign = _dereq_(184); -var ReactDOM = _dereq_(40); -var ReactDOMServer = _dereq_(56); +var ReactDOM = _dereq_(41); +var ReactDOMServer = _dereq_(57); var ReactWithAddons = _dereq_(106); // `version` will be added here by ReactIsomorphic. @@ -15488,7 +16028,7 @@ var ReactWithAddonsUMDEntry = _assign({ }, ReactWithAddons); module.exports = ReactWithAddonsUMDEntry; -},{"106":106,"184":184,"40":40,"56":56}],108:[function(_dereq_,module,exports){ +},{"106":106,"184":184,"41":41,"57":57}],108:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15806,8 +16346,8 @@ module.exports = SVGDOMPropertyConfig; var EventConstants = _dereq_(16); var EventPropagators = _dereq_(20); var ExecutionEnvironment = _dereq_(159); -var ReactDOMComponentTree = _dereq_(44); -var ReactInputSelection = _dereq_(75); +var ReactDOMComponentTree = _dereq_(45); +var ReactInputSelection = _dereq_(74); var SyntheticEvent = _dereq_(115); var getActiveElement = _dereq_(168); @@ -15986,7 +16526,7 @@ var SelectEventPlugin = { }; module.exports = SelectEventPlugin; -},{"115":115,"146":146,"159":159,"16":16,"168":168,"177":177,"182":182,"20":20,"44":44,"75":75}],110:[function(_dereq_,module,exports){ +},{"115":115,"146":146,"159":159,"16":16,"168":168,"177":177,"182":182,"20":20,"45":45,"74":74}],110:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16003,7 +16543,7 @@ module.exports = SelectEventPlugin; var EventConstants = _dereq_(16); var EventListener = _dereq_(158); var EventPropagators = _dereq_(20); -var ReactDOMComponentTree = _dereq_(44); +var ReactDOMComponentTree = _dereq_(45); var SyntheticAnimationEvent = _dereq_(111); var SyntheticClipboardEvent = _dereq_(112); var SyntheticEvent = _dereq_(115); @@ -16614,7 +17154,7 @@ var SimpleEventPlugin = { }; module.exports = SimpleEventPlugin; -},{"111":111,"112":112,"114":114,"115":115,"116":116,"118":118,"119":119,"120":120,"121":121,"122":122,"123":123,"135":135,"158":158,"16":16,"165":165,"173":173,"177":177,"20":20,"44":44}],111:[function(_dereq_,module,exports){ +},{"111":111,"112":112,"114":114,"115":115,"116":116,"118":118,"119":119,"120":120,"121":121,"122":122,"123":123,"135":135,"158":158,"16":16,"165":165,"173":173,"177":177,"20":20,"45":45}],111:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18016,9 +18556,9 @@ module.exports = escapeTextContentForBrowser; 'use strict'; -var ReactCurrentOwner = _dereq_(39); -var ReactDOMComponentTree = _dereq_(44); -var ReactInstanceMap = _dereq_(76); +var ReactCurrentOwner = _dereq_(40); +var ReactDOMComponentTree = _dereq_(45); +var ReactInstanceMap = _dereq_(75); var getNativeComponentFromComposite = _dereq_(140); var invariant = _dereq_(173); @@ -18027,6 +18567,8 @@ var warning = _dereq_(183); /** * Returns the DOM node rendered by this element. * + * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode + * * @param {ReactComponent|DOMElement} componentOrElement * @return {?DOMElement} The root node of this element. */ @@ -18059,7 +18601,7 @@ function findDOMNode(componentOrElement) { } module.exports = findDOMNode; -},{"140":140,"173":173,"183":183,"39":39,"44":44,"76":76}],133:[function(_dereq_,module,exports){ +},{"140":140,"173":173,"183":183,"40":40,"45":45,"75":75}],133:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18673,9 +19215,10 @@ module.exports = getVendorPrefixedEventName; var _assign = _dereq_(184); -var ReactCompositeComponent = _dereq_(38); -var ReactEmptyComponent = _dereq_(68); -var ReactNativeComponent = _dereq_(84); +var ReactCompositeComponent = _dereq_(39); +var ReactEmptyComponent = _dereq_(67); +var ReactNativeComponent = _dereq_(83); +var ReactInstrumentation = _dereq_(76); var invariant = _dereq_(173); var warning = _dereq_(183); @@ -18698,6 +19241,21 @@ function getDeclarationErrorAddendum(owner) { return ''; } +function getDisplayName(instance) { + var element = instance._currentElement; + if (element == null) { + return '#empty'; + } else if (typeof element === 'string' || typeof element === 'number') { + return '#text'; + } else if (typeof element.type === 'string') { + return element.type; + } else if (instance.getName) { + return instance.getName() || 'Unknown'; + } else { + return element.type.displayName || element.type.name || 'Unknown'; + } +} + /** * Check if the type reference is a known internal type. I.e. not a user * provided composite type. @@ -18709,6 +19267,8 @@ function isInternalComponentType(type) { return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; } +var nextDebugID = 1; + /** * Given a ReactNode, create an instance that will actually be mounted. * @@ -18719,7 +19279,8 @@ function isInternalComponentType(type) { function instantiateReactComponent(node) { var instance; - if (node === null || node === false) { + var isEmpty = node === null || node === false; + if (isEmpty) { instance = ReactEmptyComponent.create(instantiateReactComponent); } else if (typeof node === 'object') { var element = node; @@ -18757,6 +19318,20 @@ function instantiateReactComponent(node) { instance._warnedAboutRefsInRender = false; } + if ("development" !== 'production') { + var debugID = isEmpty ? 0 : nextDebugID++; + instance._debugID = debugID; + + if (debugID !== 0) { + var displayName = getDisplayName(instance); + ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName); + var owner = node && node._owner; + if (owner) { + ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID); + } + } + } + // Internal instances should fully constructed at this point, so they should // not get any new fields added to them at this point. if ("development" !== 'production') { @@ -18769,7 +19344,7 @@ function instantiateReactComponent(node) { } module.exports = instantiateReactComponent; -},{"173":173,"183":183,"184":184,"38":38,"68":68,"84":84}],145:[function(_dereq_,module,exports){ +},{"173":173,"183":183,"184":184,"39":39,"67":67,"76":76,"83":83}],145:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18885,16 +19460,19 @@ module.exports = isTextInputElement; */ 'use strict'; -var ReactElement = _dereq_(66); +var ReactElement = _dereq_(65); var invariant = _dereq_(173); /** * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. The current implementation of this - * function assumes that a single child gets passed without a wrapper, but the - * purpose of this helper function is to abstract away the particular structure - * of children. + * is only one child in the collection. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. * * @param {?object} children Child collection structure. * @return {ReactElement} The first and only `ReactElement` contained in the @@ -18906,7 +19484,7 @@ function onlyChild(children) { } module.exports = onlyChild; -},{"173":173,"66":66}],148:[function(_dereq_,module,exports){ +},{"173":173,"65":65}],148:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18947,10 +19525,10 @@ module.exports = quoteAttributeValueForBrowser; 'use strict'; -var ReactMount = _dereq_(81); +var ReactMount = _dereq_(80); module.exports = ReactMount.renderSubtreeIntoContainer; -},{"81":81}],150:[function(_dereq_,module,exports){ +},{"80":80}],150:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19093,6 +19671,7 @@ var shallowEqual = _dereq_(182); /** * Does a shallow comparison for props and state. * See ReactComponentWithPureRenderMixin + * See also https://facebook.github.io/react/docs/shallow-compare.html */ function shallowCompare(instance, nextProps, nextState) { return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState); @@ -19156,8 +19735,8 @@ module.exports = shouldUpdateReactComponent; 'use strict'; -var ReactCurrentOwner = _dereq_(39); -var ReactElement = _dereq_(66); +var ReactCurrentOwner = _dereq_(40); +var ReactElement = _dereq_(65); var getIteratorFn = _dereq_(139); var invariant = _dereq_(173); @@ -19301,7 +19880,7 @@ function traverseAllChildren(children, callback, traverseContext) { } module.exports = traverseAllChildren; -},{"139":139,"173":173,"183":183,"23":23,"39":39,"66":66}],155:[function(_dereq_,module,exports){ +},{"139":139,"173":173,"183":183,"23":23,"40":40,"65":65}],155:[function(_dereq_,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19354,6 +19933,10 @@ function invariantArrayCase(value, spec, command) { !Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. ' + 'Did you forget to wrap your parameter in an array?', command, specValue) : invariant(false) : void 0; } +/** + * Returns a updated shallow copy of an object without mutating the original. + * See https://facebook.github.io/react/docs/update.html for details. + */ function update(value, spec) { !(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one ' + 'of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : invariant(false) : void 0; @@ -21121,8 +21704,8 @@ if ("development" !== 'production') { module.exports = warning; },{"165":165}],184:[function(_dereq_,module,exports){ -/* eslint-disable no-unused-vars */ 'use strict'; +/* eslint-disable no-unused-vars */ var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; @@ -21134,7 +21717,51 @@ function toObject(val) { return Object(val); } -module.exports = Object.assign || function (target, source) { +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (e) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; diff --git a/browser/extensions/loop/chrome/locale/ast/loop.properties b/browser/extensions/loop/chrome/locale/ast/loop.properties index 6061a6c0dbff..6aecc6138479 100644 --- a/browser/extensions/loop/chrome/locale/ast/loop.properties +++ b/browser/extensions/loop/chrome/locale/ast/loop.properties @@ -262,6 +262,7 @@ rooms_room_joined_owner_not_connected_label=El to collaciu ta esperando pa resto peer_left_session=El to collaciu coló. peer_unexpected_quit=El to collaciu desconeutóse de mou inesperáu. +peer_join_session=Xunióse'l to collaciu. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/az/loop.properties b/browser/extensions/loop/chrome/locale/az/loop.properties index ad4fe2d1f310..65026ba16dbb 100644 --- a/browser/extensions/loop/chrome/locale/az/loop.properties +++ b/browser/extensions/loop/chrome/locale/az/loop.properties @@ -267,6 +267,7 @@ self_view_hidden_message=Özünü göstərmə gizlədilib amma hələ də gönd peer_left_session=Yoldaşınız çıxdı. peer_unexpected_quit=Yoldaşınız gözlənilmədən ayrıldı. +peer_join_session=Yoldaşınız qoşuldu. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/ca/loop.properties b/browser/extensions/loop/chrome/locale/ca/loop.properties index f73d3fa7de01..009ef8749880 100644 --- a/browser/extensions/loop/chrome/locale/ca/loop.properties +++ b/browser/extensions/loop/chrome/locale/ca/loop.properties @@ -7,6 +7,8 @@ ## LOCALIZATION_NOTE(loopMenuItem_label): Label of the menu item that is placed ## inside the browser 'Tools' menu. Use the unicode ellipsis char, \u2026, or ## use "..." if \u2026 doesn't suit traditions in your locale. +loopMenuItem_label=Inicia una conversa… +loopMenuItem_accesskey=I ## LOCALIZATION_NOTE(sign_in_again_title_line_one, sign_in_again_title_line_two2): ## These are displayed together at the top of the panel when a user is needed to @@ -14,9 +16,13 @@ ## and this is displayed in slightly larger font. Please arrange as necessary for ## your locale. ## {{clientShortname2}} will be replaced by the brand name for either string. +sign_in_again_title_line_one=Torneu a iniciar la sessió +sign_in_again_button=Inicia la sessió ## LOCALIZATION_NOTE(sign_in_again_use_as_guest_button2): {{clientSuperShortname}} ## will be replaced by the super short brandname. +panel_browse_with_friend_button=Navega per aquesta pàgina amb un amic +panel_disconnect_button=Desconnecta ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. @@ -39,6 +45,10 @@ ## LOCALIZATION_NOTE(invite_copy_link_button, invite_copied_link_button, ## invite_email_link_button, invite_facebook_button2): These labels appear under ## an iconic button for the invite view. +invite_copy_link_button=Copia l'enllaç +invite_copied_link_button=S'ha copiat +invite_email_link_button=Envia l'enllaç per correu +invite_facebook_button3=Facebook # Error bars ## LOCALIZATION NOTE(session_expired_error_description,could_not_authenticate,password_changed_question,try_again_later,could_not_connect,check_internet_connection,login_expired,service_not_available,problem_accessing_account): diff --git a/browser/extensions/loop/chrome/locale/cs/loop.properties b/browser/extensions/loop/chrome/locale/cs/loop.properties index 969589ed4755..87826b87a0c0 100644 --- a/browser/extensions/loop/chrome/locale/cs/loop.properties +++ b/browser/extensions/loop/chrome/locale/cs/loop.properties @@ -114,8 +114,8 @@ settings_menu_item_account=Účet settings_menu_item_settings=Nastavení settings_menu_item_signout=Odhlásit settings_menu_item_signin=Přihlásit -settings_menu_item_turnnotificationson=Zapnout upozornění -settings_menu_item_turnnotificationsoff=Vypnout upozornění +settings_menu_item_turnnotificationson=Zapnout oznámení +settings_menu_item_turnnotificationsoff=Vypnout oznámení settings_menu_item_feedback=Odeslat zpětnou vazbu settings_menu_button_tooltip=Nastavení @@ -268,6 +268,7 @@ self_view_hidden_message=Váš obraz byl skryt, ale je nadále odesílán; pro j peer_left_session=Váš přítel odešel. peer_unexpected_quit=Váš přítel se nečekaně odpojil. +peer_join_session=Váš přítel se připojil. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/cy/loop.properties b/browser/extensions/loop/chrome/locale/cy/loop.properties index 61be9bb8224e..62dcbe840dce 100644 --- a/browser/extensions/loop/chrome/locale/cy/loop.properties +++ b/browser/extensions/loop/chrome/locale/cy/loop.properties @@ -29,12 +29,12 @@ panel_disconnect_button=Datgysylltu ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. first_time_experience_subheading2=Cliciwch y botwm Helo i bori drwy'r tudalennau gwe gyda ffrind. -first_time_experience_subheading_button_above=Cliciwch ar y botwn uchod er mwyn pori tudalennau gwe gyda ffrind. +first_time_experience_subheading_button_above=Cliciwch ar y botwm uchod er mwyn pori tudalennau gwe gyda ffrind. ## LOCALIZATION_NOTE(first_time_experience_content, first_time_experience_content2): Message describing ## ways to use Hello project. first_time_experience_content=Ei ddefnyddio i gynllunio gyda'n gilydd, gweithio gyda'n gilydd, chwerthin gyda'n gilydd. -first_time_experience_content2=Defnyddiwch Hello i wneud pethau: cynllunio, chwerthin, gweithio gyda'ch gilydd. +first_time_experience_content2=Defnyddiwch Hello i wneud pethau: cynllunio, chwerthin, gweithio. first_time_experience_button_label2=Gweld sut mae'n gweithio ## First Time Experience Slides @@ -141,7 +141,7 @@ initiate_audio_video_call_button2=Cychwyn initiate_audio_video_call_tooltip2=Cychwyn sgwrs fideo initiate_audio_call_button2=Sgwrs llais -peer_ended_conversation2=Mae'r person roeddech yn galw wedi dod a'r sgwr i ben. +peer_ended_conversation2=Mae'r person roeddech yn galw wedi dod a'r sgwrs i ben. restart_call=Ailymuno ## LOCALIZATION NOTE (contact_offline_title): Title which is displayed when the @@ -258,7 +258,7 @@ rooms_panel_title=Dewiswch sgwrs neu gychwyn un newydd rooms_room_full_call_to_action_label=Dysgu rhagor am {{clientShortname}} » rooms_room_full_call_to_action_nonFx_label=Llwytho {{brandShortname}} i lawr i gychwyn eich sgwrs eich hun -rooms_room_full_label=Mae eisioes dau berson yn y sgwrs. +rooms_room_full_label=Mae eisoes dau berson yn y sgwrs. rooms_room_join_label=Ymuno â'r sgwrs rooms_room_joined_owner_connected_label2=Mae eich ffrind nawr wedi cysylltu a bydd yn gallu gweld eich tabiau. rooms_room_joined_owner_not_connected_label=Mae eich ffrind yn aros i gael pori {{roomURLHostname}} gyda chi. diff --git a/browser/extensions/loop/chrome/locale/de/loop.properties b/browser/extensions/loop/chrome/locale/de/loop.properties index 7f8fdf6a5179..d624e1bdf070 100644 --- a/browser/extensions/loop/chrome/locale/de/loop.properties +++ b/browser/extensions/loop/chrome/locale/de/loop.properties @@ -218,7 +218,7 @@ infobar_button_disconnect_accesskey=t copy_panel_message=Möchten Sie diese Webseite teilen? Teilen Sie Ihren Browser-Tab mit einem Freund. copy_panel_dont_show_again_label=Nicht mehr anzeigen copy_panel_cancel_button_label=Jetzt nicht. -copy_panel_accept_button_label=Ja, zeig mir, wie es geht. +copy_panel_accept_button_label=Ja (Anleitung öffnen). # E10s not supported strings diff --git a/browser/extensions/loop/chrome/locale/el/loop.properties b/browser/extensions/loop/chrome/locale/el/loop.properties index f9bba4184e10..7da6aa8ec4fb 100644 --- a/browser/extensions/loop/chrome/locale/el/loop.properties +++ b/browser/extensions/loop/chrome/locale/el/loop.properties @@ -14,9 +14,11 @@ ## and this is displayed in slightly larger font. Please arrange as necessary for ## your locale. ## {{clientShortname2}} will be replaced by the brand name for either string. +sign_in_again_button=Είσοδος ## LOCALIZATION_NOTE(sign_in_again_use_as_guest_button2): {{clientSuperShortname}} ## will be replaced by the super short brandname. +panel_disconnect_button=Αποσύνδεση ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. diff --git a/browser/extensions/loop/chrome/locale/en-GB/loop.properties b/browser/extensions/loop/chrome/locale/en-GB/loop.properties index 9c947a05411c..f040098778a0 100644 --- a/browser/extensions/loop/chrome/locale/en-GB/loop.properties +++ b/browser/extensions/loop/chrome/locale/en-GB/loop.properties @@ -267,6 +267,7 @@ self_view_hidden_message=Self-view hidden but still being sent; resize window \\ peer_left_session=Your friend has left. peer_unexpected_quit=Your friend has unexpectedly disconnected. +peer_join_session=Your friend has joined. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/en-US/loop.properties b/browser/extensions/loop/chrome/locale/en-US/loop.properties index c6ea81b89811..8908fe3df8c0 100644 --- a/browser/extensions/loop/chrome/locale/en-US/loop.properties +++ b/browser/extensions/loop/chrome/locale/en-US/loop.properties @@ -94,12 +94,6 @@ share_email_body7=A friend is waiting for you on Firefox Hello. Click the link t share_email_body_context3=A friend is waiting for you on Firefox Hello. Click the link to connect and browse {{title}} together: {{callUrl}} ## LOCALIZATION NOTE (share_email_footer2): Common footer content for both email types share_email_footer2=\n\n____________\nFirefox Hello lets you browse the Web with your friends. Use it when you want to get things done: plan together, work together, laugh together. Learn more at http://www.firefox.com/hello -## LOCALIZATION NOTE (share_tweeet): In this item, don't translate the part -## between {{..}}. Please keep the text below 117 characters to make sure it fits -## in a tweet. -share_tweet=Join me for a video conversation on {{clientShortname2}}! - -share_add_service_button=Add a Service ## LOCALIZATION NOTE (copy_link_menuitem, email_link_menuitem, delete_conversation_menuitem): ## These menu items are displayed from a panel's context menu for a conversation. diff --git a/browser/extensions/loop/chrome/locale/es-AR/loop.properties b/browser/extensions/loop/chrome/locale/es-AR/loop.properties index d5ae5b98950e..c0b47a4270b0 100644 --- a/browser/extensions/loop/chrome/locale/es-AR/loop.properties +++ b/browser/extensions/loop/chrome/locale/es-AR/loop.properties @@ -7,6 +7,8 @@ ## LOCALIZATION_NOTE(loopMenuItem_label): Label of the menu item that is placed ## inside the browser 'Tools' menu. Use the unicode ellipsis char, \u2026, or ## use "..." if \u2026 doesn't suit traditions in your locale. +loopMenuItem_label=Iniciar una conversación… +loopMenuItem_accesskey=n ## LOCALIZATION_NOTE(sign_in_again_title_line_one, sign_in_again_title_line_two2): ## These are displayed together at the top of the panel when a user is needed to @@ -14,99 +16,264 @@ ## and this is displayed in slightly larger font. Please arrange as necessary for ## your locale. ## {{clientShortname2}} will be replaced by the brand name for either string. +sign_in_again_title_line_one=Ingrese nuevamente +sign_in_again_title_line_two2=para continuar usando {{clientShortname2}} +sign_in_again_button=Ingresar ## LOCALIZATION_NOTE(sign_in_again_use_as_guest_button2): {{clientSuperShortname}} ## will be replaced by the super short brandname. +sign_in_again_use_as_guest_button2=Usar {{clientSuperShortname}} como invitado +panel_browse_with_friend_button=Navegá esta página con un amigo +panel_disconnect_button=Desconectar ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. +first_time_experience_subheading2=Clic en el botón Hello para navegar páginas web con un amigo. +first_time_experience_subheading_button_above=Clic en el botón que está encima para navegar páginas web con un amigo. ## LOCALIZATION_NOTE(first_time_experience_content, first_time_experience_content2): Message describing ## ways to use Hello project. +first_time_experience_content=Puede usarse para planificar juntos, trabajar juntos, reírse juntos. +first_time_experience_content2=Puede usarse para planificar juntos, trabajar juntos, reírse juntos. +first_time_experience_button_label2=Ver como funciona ## First Time Experience Slides +fte_slide_1_title=Navegá páginas web con un amigo ## LOCALIZATION_NOTE(fte_slide_1_copy): {{clientShortname2}} ## will be replaced by the short name 2. +fte_slide_1_copy=Si estás planificando un viaje o comprando un regalo, {{clientShortname2}} permite tomar decisiones más rápidas en tiempo real. +fte_slide_2_title2=Hecho para compartir la web ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. +fte_slide_2_copy2=Ahora, cuando invités a un amigo a una sesión, {{clientShortname2}} compartirá automáticamente cualquier página web que estés viendo. Planifiquen. Compren. Decidan. Juntos. +fte_slide_3_title=Invitá a un amigo enviándole un enlace ## LOCALIZATION_NOTE(fte_slide_3_copy): {{clientSuperShortname}} ## will be replaced by the super short brand name. +fte_slide_3_copy={{clientSuperShortname}} funciona con la mayor parte de los navegadores de escritorio. No se necesitan cuentas y todos se conectan gratis. ## LOCALIZATION_NOTE(fte_slide_4_title): {{clientSuperShortname}} ## will be replaced by the super short brand name. +fte_slide_4_title=Buscá el ícono de {{clientSuperShortname}} para empezar ## LOCALIZATION_NOTE(fte_slide_4_copy): {{brandShortname}} ## will be replaced by the brand short name. +fte_slide_4_copy=Cuando encontraste una pagina sobre la que querés discutir, clic en el ícono en {{brandShortname}} para crear un enlace. ¡Después enviáselo a tu amigo como mejor te parezca! +invite_header_text_bold2=¡Invitá a un amigo a unirse! +invite_header_text4=Compartí este enlace para poder empezar a navegar la web juntos. ## LOCALIZATION_NOTE(invite_copy_link_button, invite_copied_link_button, ## invite_email_link_button, invite_facebook_button2): These labels appear under ## an iconic button for the invite view. +invite_copy_link_button=Copiar enlace +invite_copied_link_button=¡Copiado! +invite_email_link_button=Enlace por correo +invite_facebook_button3=Facebook +invite_your_link=Tu enlace: # Error bars ## LOCALIZATION NOTE(session_expired_error_description,could_not_authenticate,password_changed_question,try_again_later,could_not_connect,check_internet_connection,login_expired,service_not_available,problem_accessing_account): ## These may be displayed at the top of the panel. +session_expired_error_description=Sesión expirada. Toda URL creada previamente y compartida no funcionará más. +could_not_authenticate=No se pudo autenticar +password_changed_question=¿Cambiaste tu contraseña? +try_again_later=Intentá nuevamente +could_not_connect=No se pudo conectar al servidor +check_internet_connection=Verificá la conexión a internet +login_expired=El ingreso ha expirado +service_not_available=Servicio no disponible en este momento +problem_accessing_account=Hubo un problema accediendo a la cuenta ## LOCALIZATION NOTE(retry_button): Displayed when there is an error to retry ## the appropriate action. +retry_button=Reintentar +share_email_subject7=Tu invitación a navegar la web juntos ## LOCALIZATION NOTE (share_email_body7): In this item, don't translate the ## part between {{..}} and leave the \n\n part alone +share_email_body7=Un amigo te está esperando en Firefox Hello. Clic en el enlace para conectar y navegar la web juntos: {{callUrl}} ## LOCALIZATION NOTE (share_email_body_context3): In this item, don't translate ## the part between {{..}} and leave the \n\n part alone. +share_email_body_context3=Un amigo te está esperando en Firefox Hello. Clic en el enlace para conectar y navegar {{title}} juntos: {{callUrl}} ## LOCALIZATION NOTE (share_email_footer2): Common footer content for both email types +share_email_footer2=\n\n____________\nFirefox Hello permite navegar la web con tus amigos. Usalo cuando quieras que se hagan las cosas: planificar juntos, trabajar juntos, reírse juntos. Conocé más en http://www.firefox.com/hello ## LOCALIZATION NOTE (share_tweeet): In this item, don't translate the part ## between {{..}}. Please keep the text below 117 characters to make sure it fits ## in a tweet. +share_tweet=¡Unite a una conversación en video en {{clientShortname2}}! +share_add_service_button=Agregar un servicio ## LOCALIZATION NOTE (copy_link_menuitem, email_link_menuitem, delete_conversation_menuitem): ## These menu items are displayed from a panel's context menu for a conversation. +copy_link_menuitem=Copiar enlace +email_link_menuitem=Enlace por correo +edit_name_menuitem=Editar nombre +delete_conversation_menuitem2=Borrar +panel_footer_signin_or_signup_link=Ingresar o registrarse +settings_menu_item_account=Cuenta +settings_menu_item_settings=Configuración +settings_menu_item_signout=Salir +settings_menu_item_signin=Ingresar +settings_menu_item_turnnotificationson=Habilitar notificaciones +settings_menu_item_turnnotificationsoff=Deshabilitar notificaciones +settings_menu_item_feedback=Enviar opinión +settings_menu_button_tooltip=Configuración # Conversation Window Strings +initiate_call_button_label2=¿Listo para empezar la conversación? +incoming_call_title2=Pedido de conversación +incoming_call_block_button=Bloquear +hangup_button_title=Desconectar +hangup_button_caption2=Salir ## LOCALIZATION NOTE (call_with_contact_title): The title displayed ## when calling a contact. Don't translate the part between {{..}} because ## this will be replaced by the contact's name. +call_with_contact_title=Conversación con {{contactName}} # Outgoing conversation +outgoing_call_title=¿Comenzar conversación? +initiate_audio_video_call_button2=Comenzar +initiate_audio_video_call_tooltip2=Comenzar una conversación con video +initiate_audio_call_button2=Conversación de voz +peer_ended_conversation2=La persona que estabas llamando terminó la conversación. +restart_call=Volvé a unirte ## LOCALIZATION NOTE (contact_offline_title): Title which is displayed when the ## contact is offline. +contact_offline_title=Esta persona no está conectada ## LOCALIZATION NOTE (call_timeout_notification_text): Title which is displayed ## when the call didn't go through. +call_timeout_notification_text=La llamada no prosperó. ## LOCALIZATION NOTE (cancel_button): ## This button is displayed when a call has failed. +cancel_button=Cancelar +rejoin_button=Volvé a unirte a la conversación +cannot_start_call_session_not_ready=No se puede comenzar la conversación, la sesión no está lista. +network_disconnected=La conexión de red terminó abruptamente. +connection_error_see_console_notification=Falló la llamada; mirá la consola para más detalles. +no_media_failure_message=No se encontró cámara o micrófono. +ice_failure_message=Falló la conexión. El firewall puede estar bloqueando llamadas. ## LOCALIZATION NOTE (legal_text_and_links3): In this item, don't translate the ## parts between {{..}} because these will be replaced with links with the labels ## from legal_text_tos and legal_text_privacy. clientShortname will be replaced ## by the brand name. +legal_text_and_links3=Al usar {{clientShortname}} acepta los {{terms_of_use}} y la {{privacy_notice}}. +legal_text_tos=Términos de uso +legal_text_privacy=Nota de privacidad ## LOCALIZATION NOTE (powered_by_beforeLogo, powered_by_afterLogo): ## These 2 strings are displayed before and after a 'Telefonica' ## logo. +powered_by_beforeLogo=Con tecnología de +powered_by_afterLogo= ## LOCALIZATION_NOTE (feedback_rejoin_button): Displayed on the feedback form after ## a signed-in to signed-in user call. +feedback_rejoin_button=Volver a unirse ## LOCALIZATION NOTE (feedback_report_user_button): Used to report a user in the case of ## an abusive user. +feedback_report_user_button=Informar usuario +feedback_window_heading=¿Cómo fue la conversación? +feedback_request_button=Dejar opinión +rooms_list_recently_browsed2=Navegado recientemente +rooms_list_currently_browsing2=Navegando actualmente +rooms_signout_alert=Las conversaciones abiertas se cerrarán +room_name_untitled_page=Página sin título ## LOCALIZATION NOTE (door_hanger_return, door_hanger_prompt_name, door_hanger_button): Dialog message on leaving conversation +door_hanger_bye=¡Nos vemos! +door_hanger_return2=Podés volver a esta sesión compartida en cualquier momento desde el panel de Hello. ¿Querés ponerle un nombre para que sea más fácil de recordar? +door_hanger_current=Nombre actual: +door_hanger_button2=Aceptar # Infobar strings +infobar_screenshare_no_guest_message=En cuanto tu amigo se una, podrán ver cualquier pestaña en la que se haga clic. +infobar_screenshare_browser_message2=Estás compartiendo tus pestañas. Cualquier pestaña en la que hagás clic puede ser vista por tus amigos +infobar_screenshare_browser_message3=Ahora estás compartiendo tus pestañas. Tu amigo verá cualquier pestaña en la que hagás clic. +infobar_screenshare_stop_sharing_message2=Ya no estás compartiendo las pestañas. +infobar_screenshare_stop_no_guest_message=Dejaste de compartir tus pestañas. Cuando tu amigo se una, no podrá ver nada hasta que se reinicie la comparticion. +infobar_button_restart_label2=Reiniciar compartición +infobar_button_restart_accesskey=e +infobar_button_stop_label2=Dejar de compartir +infobar_button_stop_accesskey=a +infobar_button_disconnect_label=Desconectar +infobar_button_disconnect_accesskey=D # Copy panel strings +copy_panel_message=¿Necesitás compartir esta página web? Compartí la pestaña del navegador con un amigo. +copy_panel_dont_show_again_label=No mostrar nuevamente +copy_panel_cancel_button_label=No ahora +copy_panel_accept_button_label=Si, mostrarme como # E10s not supported strings +e10s_not_supported_button_label=Abrir nueva ventana +e10s_not_supported_subheading={{brandShortname}} no funciona en una ventana multiproceso. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +## LOCALIZATION NOTE: In this file, don't translate the part between {{..}} + +# Text chat strings +chat_textbox_placeholder=Esscribí aquí... + +## LOCALIZATION NOTE(clientShortname2): This should not be localized and +## should remain "Firefox Hello" for all locales. +clientShortname2=Firefox Hello + +conversation_has_ended=Se terminó tu conversación. +generic_failure_message=Estamos con problemas técnicos... + +generic_failure_no_reason2=¿Querés probar de vuelta? + +help_label=Ayuda + +mute_local_audio_button_title=Deshabilitá tu audio +unmute_local_audio_button_title=Habilitá tu audio +mute_local_video_button_title2=Deshabilitar video +unmute_local_video_button_title2=Habilitar video + +## LOCALIZATION NOTE (retry_call_button): +## This button is displayed when a call has failed. +retry_call_button=Probar de nuevo + +rooms_leave_button_label=Salir + +rooms_panel_title=Elegí una conversación o empezá una nueva + +rooms_room_full_call_to_action_label=Aprendé más sobre ({clientShortname}) » +rooms_room_full_call_to_action_nonFx_label=Descargá ({brandShortname}) para empezar la tuya +rooms_room_full_label=Ya hay dos personas en esta conversación. +rooms_room_join_label=Unite a la conversación +rooms_room_joined_owner_connected_label2=Ahroa tu amigo está conectado y podrá ver tus pestañas. +rooms_room_joined_owner_not_connected_label=Tu amigo está esperando para navegar ({roomURLHostname}) con vos. + +self_view_hidden_message=La vista propia está oculta pero se envía de todas maneras; cambiá el tamaño de la ventana para verlo + +peer_left_session=Tu amigo se fue. +peer_unexpected_quit=Tu amigo se desconectó de manera inesperada. +peer_join_session=Tu amigo se unió. + +## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} +## as this will be replaced by clientShortname2. +tos_failure_message=({clientShortname}) no está disponible en tu país. + +display_name_guest=Invitado + +## LOCALIZATION NOTE(clientSuperShortname): This should not be localized and +## should remain "Hello" for all locales. +clientSuperShortname=Hello diff --git a/browser/extensions/loop/chrome/locale/es-CL/loop.properties b/browser/extensions/loop/chrome/locale/es-CL/loop.properties index 858006832bd5..eb9cff497a04 100644 --- a/browser/extensions/loop/chrome/locale/es-CL/loop.properties +++ b/browser/extensions/loop/chrome/locale/es-CL/loop.properties @@ -268,6 +268,7 @@ self_view_hidden_message=La vista local está oculta pero continúa siendo envia peer_left_session=Tu amigo se ha ido. peer_unexpected_quit=Tu amigo se ha desconectado inesperadamente. +peer_join_session=Tu amigo se ha unido. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/es-MX/loop.properties b/browser/extensions/loop/chrome/locale/es-MX/loop.properties index e883a8308fc3..0de73904a755 100644 --- a/browser/extensions/loop/chrome/locale/es-MX/loop.properties +++ b/browser/extensions/loop/chrome/locale/es-MX/loop.properties @@ -267,6 +267,7 @@ self_view_hidden_message=Auto-vista oculta pero enviándose; redimensiona ventan peer_left_session=Tu amigo se ha ido. peer_unexpected_quit=Tu amigo se ha desconectado inesperadamente. +peer_join_session=Tu amigo se ha unido. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/et/loop.properties b/browser/extensions/loop/chrome/locale/et/loop.properties index 9ce5e3f5775b..a0b22dd55837 100644 --- a/browser/extensions/loop/chrome/locale/et/loop.properties +++ b/browser/extensions/loop/chrome/locale/et/loop.properties @@ -268,6 +268,7 @@ self_view_hidden_message=Sinu pilti edastatakse, kuid see on praegu peidetud. Pi peer_left_session=Sõber on lahkunud. peer_unexpected_quit=Ühendus sõbraga on ootamatult katkenud. +peer_join_session=Sinu sõber liitus. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/fa/loop.properties b/browser/extensions/loop/chrome/locale/fa/loop.properties index d17ee186c916..d69bd4623474 100644 --- a/browser/extensions/loop/chrome/locale/fa/loop.properties +++ b/browser/extensions/loop/chrome/locale/fa/loop.properties @@ -203,6 +203,8 @@ door_hanger_button2=تایید! infobar_screenshare_no_guest_message=هر موقع دوستان شما متصل شوند، آنها قادر خواهند بود هر زبانه‌ای که روی‌اش کلیک می‌کنید را ببینند. infobar_screenshare_browser_message2=شما در حال اشتراک‌گذاری زبانه‌های خود هستید. هر زبانه‌ای که بر روی‌اش کلیک کنید، توسط دوستانتان دید میشود infobar_screenshare_browser_message3=شما هم‌اکنون در حال اشتراک‌گذاری زبانه‌های خود هستید. دوستان شما هر زبانه‌ای که روی‌اش کلیک کنید را خواهند دید. +infobar_screenshare_stop_sharing_message2=شما هیچ زبانه‌ای را با دیگران به اشتراک نگذاشته‌اید. +infobar_screenshare_stop_no_guest_message=شما به اشتراک گذاری زبانه‌های خود را متوقف کرده‌اید. وقتی دوستان شما وارد شوند، قادر به دیدن چیزی نخواهند بود تا زمانی که شما به اشتراک گذاری را از نو راه‌اندازی کنید. infobar_button_restart_label2=راه‌اندازی مجدد اشتراک‌گذاری infobar_button_restart_accesskey=e infobar_button_stop_label2=توقف اشتراک‌گذاری @@ -265,6 +267,7 @@ self_view_hidden_message=نمای فردی پنهان شده است ولی ار peer_left_session=دوست شما گفت‌وگو را ترک کرد. peer_unexpected_quit=دوست شما بطور غیرمنتظره‌ای قطع شد. +peer_join_session=دوستان شما وارد شده‌اند. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/fy-NL/loop.properties b/browser/extensions/loop/chrome/locale/fy-NL/loop.properties index b651e326f692..8767718bdad0 100644 --- a/browser/extensions/loop/chrome/locale/fy-NL/loop.properties +++ b/browser/extensions/loop/chrome/locale/fy-NL/loop.properties @@ -45,7 +45,7 @@ fte_slide_1_copy=Oft jo no in reis planne of in kado sykje, mei {{clientShortnam fte_slide_2_title2=Makke om it web te dielen ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. -fte_slide_2_copy2=As jo no in freon útnoegje foar in sesje, sil {{clientShortname2}} automatysk websiden dy't jo besjen diele. Plan. Winkelje. Beslis. Tegearre. +fte_slide_2_copy2=As jo no in freon útnûgje foar in sesje, sil {{clientShortname2}} automatysk websiden dy't jo besjen diele. Plan. Winkelje. Beslis. Tegearre. fte_slide_3_title=Noegje in freon út troch in keppeling te dielen ## LOCALIZATION_NOTE(fte_slide_3_copy): {{clientSuperShortname}} ## will be replaced by the super short brand name. @@ -85,7 +85,7 @@ problem_accessing_account=Der wie in probleem mei tagong ta jo account ## the appropriate action. retry_button=Nochris probearje -share_email_subject7=Jo útnoeging om tegearre op it web te sneupjen +share_email_subject7=Jo útnûging om tegearre op it web te sneupjen ## LOCALIZATION NOTE (share_email_body7): In this item, don't translate the ## part between {{..}} and leave the \n\n part alone share_email_body7=In freon wachtet op dy op Firefox Hello. Klik op de keppeling om te ferbinen en sneup tegearre op it web: {{callUrl}} diff --git a/browser/extensions/loop/chrome/locale/fy/loop.properties b/browser/extensions/loop/chrome/locale/fy/loop.properties index b651e326f692..8767718bdad0 100644 --- a/browser/extensions/loop/chrome/locale/fy/loop.properties +++ b/browser/extensions/loop/chrome/locale/fy/loop.properties @@ -45,7 +45,7 @@ fte_slide_1_copy=Oft jo no in reis planne of in kado sykje, mei {{clientShortnam fte_slide_2_title2=Makke om it web te dielen ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. -fte_slide_2_copy2=As jo no in freon útnoegje foar in sesje, sil {{clientShortname2}} automatysk websiden dy't jo besjen diele. Plan. Winkelje. Beslis. Tegearre. +fte_slide_2_copy2=As jo no in freon útnûgje foar in sesje, sil {{clientShortname2}} automatysk websiden dy't jo besjen diele. Plan. Winkelje. Beslis. Tegearre. fte_slide_3_title=Noegje in freon út troch in keppeling te dielen ## LOCALIZATION_NOTE(fte_slide_3_copy): {{clientSuperShortname}} ## will be replaced by the super short brand name. @@ -85,7 +85,7 @@ problem_accessing_account=Der wie in probleem mei tagong ta jo account ## the appropriate action. retry_button=Nochris probearje -share_email_subject7=Jo útnoeging om tegearre op it web te sneupjen +share_email_subject7=Jo útnûging om tegearre op it web te sneupjen ## LOCALIZATION NOTE (share_email_body7): In this item, don't translate the ## part between {{..}} and leave the \n\n part alone share_email_body7=In freon wachtet op dy op Firefox Hello. Klik op de keppeling om te ferbinen en sneup tegearre op it web: {{callUrl}} diff --git a/browser/extensions/loop/chrome/locale/he/loop.properties b/browser/extensions/loop/chrome/locale/he/loop.properties index 0d9a272abd67..77469102a729 100644 --- a/browser/extensions/loop/chrome/locale/he/loop.properties +++ b/browser/extensions/loop/chrome/locale/he/loop.properties @@ -7,6 +7,7 @@ ## LOCALIZATION_NOTE(loopMenuItem_label): Label of the menu item that is placed ## inside the browser 'Tools' menu. Use the unicode ellipsis char, \u2026, or ## use "..." if \u2026 doesn't suit traditions in your locale. +loopMenuItem_label=התחלת שיחה… ## LOCALIZATION_NOTE(sign_in_again_title_line_one, sign_in_again_title_line_two2): ## These are displayed together at the top of the panel when a user is needed to @@ -14,35 +15,61 @@ ## and this is displayed in slightly larger font. Please arrange as necessary for ## your locale. ## {{clientShortname2}} will be replaced by the brand name for either string. +sign_in_again_title_line_one=נא להתחבר שוב +sign_in_again_title_line_two2=כדי להמשיך להשתמש ב־{{clientShortname2}} ## LOCALIZATION_NOTE(sign_in_again_use_as_guest_button2): {{clientSuperShortname}} ## will be replaced by the super short brandname. +sign_in_again_use_as_guest_button2=השתמש ב־{{clientSuperShortname}} כאורח +panel_browse_with_friend_button=גלישה בדף זה עם חבר +panel_disconnect_button=התנתקות ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. +first_time_experience_subheading2=לחץ על כפתור ה־Hello כדי לגלוש באתרים עם חבר. +first_time_experience_subheading_button_above=לחץ על הכפתור שלמעלה כדי לגלוש באתרים עם חבר. ## LOCALIZATION_NOTE(first_time_experience_content, first_time_experience_content2): Message describing ## ways to use Hello project. +first_time_experience_content=השתמש בזה כדי לתכנן ביחד, לעבוד ביחד, לצחוק ביחד. +first_time_experience_button_label2=ראו כיצד זה עובד ## First Time Experience Slides +fte_slide_1_title=גלישה באתרים עם חבר ## LOCALIZATION_NOTE(fte_slide_1_copy): {{clientShortname2}} ## will be replaced by the short name 2. +fte_slide_2_title2=נועד לשיתוף הרשת ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. +fte_slide_3_title=הזמנת חבר באמצעות שליחת קישור ## LOCALIZATION_NOTE(fte_slide_3_copy): {{clientSuperShortname}} ## will be replaced by the super short brand name. +fte_slide_3_copy={{clientSuperShortname}} עובד עם רוב הדפדפנים השולחניים. אין צורך בחשבונות וכולם יכולים להתחבר בחינם. ## LOCALIZATION_NOTE(fte_slide_4_title): {{clientSuperShortname}} ## will be replaced by the super short brand name. +fte_slide_4_title=אתר את סמל ה־{{clientSuperShortname}} כדי להתחיל ## LOCALIZATION_NOTE(fte_slide_4_copy): {{brandShortname}} ## will be replaced by the brand short name. +invite_header_text_bold2=הזמן חבר שיצטרף אליך! +invite_header_text4=שתף קישור זה כך שתוכלו לגלוש ברשת ביחד. ## LOCALIZATION_NOTE(invite_copy_link_button, invite_copied_link_button, ## invite_email_link_button, invite_facebook_button2): These labels appear under ## an iconic button for the invite view. +invite_copy_link_button=העתקת קישור +invite_copied_link_button=הועתק! +invite_email_link_button=שליחת קישור בדואר אלקטרוני +invite_facebook_button3=Facebook +invite_your_link=הקישור שלך: # Error bars ## LOCALIZATION NOTE(session_expired_error_description,could_not_authenticate,password_changed_question,try_again_later,could_not_connect,check_internet_connection,login_expired,service_not_available,problem_accessing_account): ## These may be displayed at the top of the panel. +could_not_authenticate=לא ניתן לאמת +password_changed_question=האם שינית את ססמתך? +try_again_later=נא לנסות שוב מאוחר יותר +could_not_connect=לא ניתן להתחבר לשרת +service_not_available=השירות אינו זמין כעת ## LOCALIZATION NOTE(retry_button): Displayed when there is an error to retry ## the appropriate action. @@ -56,15 +83,29 @@ ## between {{..}}. Please keep the text below 117 characters to make sure it fits ## in a tweet. +share_add_service_button=הוספת שירות ## LOCALIZATION NOTE (copy_link_menuitem, email_link_menuitem, delete_conversation_menuitem): ## These menu items are displayed from a panel's context menu for a conversation. +copy_link_menuitem=העתקת קישור +email_link_menuitem=שליחת קישור בדוא״ל +edit_name_menuitem=עריכת שם +delete_conversation_menuitem2=מחיקה +panel_footer_signin_or_signup_link=הרשמה או התחברות +settings_menu_item_account=חשבון +settings_menu_item_settings=הגדרות +settings_menu_item_signout=התנתקות +settings_menu_item_turnnotificationson=הפעלת התראות +settings_menu_item_turnnotificationsoff=נטרול התראות +settings_menu_item_feedback=שליחת משוב +settings_menu_button_tooltip=הגדרות # Conversation Window Strings +incoming_call_block_button=חסימה hangup_button_title=ניתוק hangup_button_caption2=יציאה @@ -75,6 +116,8 @@ hangup_button_caption2=יציאה # Outgoing conversation +initiate_audio_video_call_tooltip2=התחלת שיחת וידאו +initiate_audio_call_button2=שיחת וידאו ## LOCALIZATION NOTE (contact_offline_title): Title which is displayed when the @@ -84,12 +127,15 @@ hangup_button_caption2=יציאה ## LOCALIZATION NOTE (cancel_button): ## This button is displayed when a call has failed. +cancel_button=ביטול ## LOCALIZATION NOTE (legal_text_and_links3): In this item, don't translate the ## parts between {{..}} because these will be replaced with links with the labels ## from legal_text_tos and legal_text_privacy. clientShortname will be replaced ## by the brand name. +legal_text_tos=תנאי שימוש +legal_text_privacy=הצהרת פרטיות ## LOCALIZATION NOTE (powered_by_beforeLogo, powered_by_afterLogo): ## These 2 strings are displayed before and after a 'Telefonica' @@ -99,19 +145,30 @@ hangup_button_caption2=יציאה ## a signed-in to signed-in user call. ## LOCALIZATION NOTE (feedback_report_user_button): Used to report a user in the case of ## an abusive user. +feedback_report_user_button=דיווח על משתמש +feedback_request_button=יציאה מהמשוב +tour_label=סיור +room_name_untitled_page=דף ללא כותרת ## LOCALIZATION NOTE (door_hanger_return, door_hanger_prompt_name, door_hanger_button): Dialog message on leaving conversation +door_hanger_bye=להתראות! +door_hanger_current=שם נוכחי: +door_hanger_button2=קיבלתי! # Infobar strings +infobar_button_disconnect_label=התנתקות # Copy panel strings +copy_panel_accept_button_label=כן, הראו לי כיצד # E10s not supported strings +e10s_not_supported_button_label=פתיחת חלון חדש +e10s_not_supported_subheading={{brandShortname}} לא עובד בחלון מרובה תהליכים. # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -119,11 +176,14 @@ hangup_button_caption2=יציאה ## LOCALIZATION NOTE: In this file, don't translate the part between {{..}} # Text chat strings +chat_textbox_placeholder=הקלד כאן… ## LOCALIZATION NOTE(clientShortname2): This should not be localized and ## should remain "Firefox Hello" for all locales. +clientShortname2=Firefox Hello -conversation_has_ended=הדיון הסתיים. +conversation_has_ended=השיחה הסתיימה. +generic_failure_message=יש לנו קשיים טכניים… generic_failure_no_reason2=לנסות שוב? @@ -131,6 +191,8 @@ help_label=עזרה mute_local_audio_button_title=השתקת השמע שלך unmute_local_audio_button_title=ביטול השתקת השמע שלך +mute_local_video_button_title2=נטרול וידאו +unmute_local_video_button_title2=אפשר וידאו ## LOCALIZATION NOTE (retry_call_button): ## This button is displayed when a call has failed. @@ -138,12 +200,24 @@ retry_call_button=ניסיון חוזר rooms_leave_button_label=עזיבה +rooms_panel_title=בחר בשיחה או התחל שיחה חדשה -rooms_room_join_label=הצטרפות לדיון +rooms_room_full_call_to_action_label=מידע נוסף אודות {{clientShortname}} » +rooms_room_full_label=יש כבר שני אנשים בשיחה זו. +rooms_room_join_label=הצטרפות לשיחה +rooms_room_joined_owner_connected_label2=חברך כרגע מחובר ויוכל לצפות בלשוניות שלך. +rooms_room_joined_owner_not_connected_label=חברך ממתין לגלוש ב־{{roomURLHostname}} יחד אתך. +peer_left_session=חברך עזב. +peer_unexpected_quit=חברך התנתק באופן לא צפוי. +peer_join_session=חברך הצטרף. + ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. +tos_failure_message={{clientShortname}} אינו זמין במדינה שלך. + +display_name_guest=אורח ## LOCALIZATION NOTE(clientSuperShortname): This should not be localized and ## should remain "Hello" for all locales. diff --git a/browser/extensions/loop/chrome/locale/id/loop.properties b/browser/extensions/loop/chrome/locale/id/loop.properties index cce4fa5b3b99..c6b9a6ed9213 100644 --- a/browser/extensions/loop/chrome/locale/id/loop.properties +++ b/browser/extensions/loop/chrome/locale/id/loop.properties @@ -265,8 +265,9 @@ rooms_room_joined_owner_not_connected_label=Teman Anda sedang menunggu untuk men self_view_hidden_message=Tampilan diri sedang tersembunyi tetapi tetap dikirim, ubah ukuran jendela untuk menampilkannya -peer_left_session=Teman anda telah pergi. -peer_unexpected_quit=Teman anda tiba-tiba terputus. +peer_left_session=Teman Anda telah pergi. +peer_unexpected_quit=Teman Anda tiba-tiba tak tersambung. +peer_join_session=Teman Anda telah bergabung. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/it/loop.properties b/browser/extensions/loop/chrome/locale/it/loop.properties index 149abe2ffdc7..34a3963f1af6 100644 --- a/browser/extensions/loop/chrome/locale/it/loop.properties +++ b/browser/extensions/loop/chrome/locale/it/loop.properties @@ -267,6 +267,7 @@ self_view_hidden_message=L’anteprima della fotocamera è nascosta, ma l’inte peer_left_session=L'interlocutore si è disconnesso. peer_unexpected_quit=L'interlocutore si è inaspettatamente disconnesso. +peer_join_session=L’interlocutore si è aggiunto alla conversazione. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/ko/loop.properties b/browser/extensions/loop/chrome/locale/ko/loop.properties index 503ebac1e7d7..695cf731f488 100644 --- a/browser/extensions/loop/chrome/locale/ko/loop.properties +++ b/browser/extensions/loop/chrome/locale/ko/loop.properties @@ -24,6 +24,7 @@ sign_in_again_button=로그인 sign_in_again_use_as_guest_button2=손님으로 {{clientSuperShortname}} 쓰기 panel_browse_with_friend_button=친구와 함께 이 페이지 사용 +panel_disconnect_button=연결 끊음 ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. diff --git a/browser/extensions/loop/chrome/locale/nl/loop.properties b/browser/extensions/loop/chrome/locale/nl/loop.properties index b9119288c6cf..f8aef94c94df 100644 --- a/browser/extensions/loop/chrome/locale/nl/loop.properties +++ b/browser/extensions/loop/chrome/locale/nl/loop.properties @@ -222,7 +222,7 @@ copy_panel_accept_button_label=Ja, toon me hoe # E10s not supported strings e10s_not_supported_button_label=Nieuw venster openen -e10s_not_supported_subheading={{brandShortname}} werkt niet in een multi-process-venster. +e10s_not_supported_subheading={{brandShortname}} werkt niet in een multiprocess-venster. # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/browser/extensions/loop/chrome/locale/nn-NO/loop.properties b/browser/extensions/loop/chrome/locale/nn-NO/loop.properties index 567313dc5ff0..cc562d7ed0b5 100644 --- a/browser/extensions/loop/chrome/locale/nn-NO/loop.properties +++ b/browser/extensions/loop/chrome/locale/nn-NO/loop.properties @@ -35,7 +35,7 @@ first_time_experience_subheading_button_above=Trykk på knappen ovanfor for å s ## ways to use Hello project. first_time_experience_content=Bruk han til å planleggja, arbeida, og ha det moro i lag. first_time_experience_content2=Bruk han til å få gjort ting: planlegging, arbeid og for å ha det moro i lag. -first_time_experience_button_label2=Sjå korleis det fungerar +first_time_experience_button_label2=Sjå korleis det fungerer ## First Time Experience Slides fte_slide_1_title=Surf på nettsider med ein ven @@ -45,11 +45,11 @@ fte_slide_1_copy=Om du planlegg ei reise eller leitar du etter ein present, {{cl fte_slide_2_title2=Laga for å dela nettet ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. -fte_slide_2_copy2=Når du inviterer ein ven til ei ykt, vil {{clientShortname2}} automatisk dela nettsidene du ser på. Planlegg. Handla. Ta avgjerder. Saman. +fte_slide_2_copy2=Når du inviterer inn ein ven til ei økt, vil {{clientShortname2}} automatisk dela alle nettsider du viser. Planlegg. Gjer innkjøp. Ta avgjerder. Ilag. fte_slide_3_title=Inviter ein ven ved å senda ei lenke ## LOCALIZATION_NOTE(fte_slide_3_copy): {{clientSuperShortname}} ## will be replaced by the super short brand name. -fte_slide_3_copy={{clientSuperShortname}} fungerar med dei fleste nettlesarar. Det treng ingen konto og elle tilkoplingar er gratis. +fte_slide_3_copy={{clientSuperShortname}} fungerer med dei fleste nettlesarar. Du treng ingen konto og alle tilkoplingar er gratis. ## LOCALIZATION_NOTE(fte_slide_4_title): {{clientSuperShortname}} ## will be replaced by the super short brand name. fte_slide_4_title=Finn ikonet for {{clientSuperShortname}} for å koma i gang @@ -222,7 +222,7 @@ copy_panel_accept_button_label=Ja, vis meg korleis # E10s not supported strings e10s_not_supported_button_label=Opna nytt vindauge -e10s_not_supported_subheading={{brandShortname}} fungerar ikkje i eit multiprosessvindauge. +e10s_not_supported_subheading={{brandShortname}} fungerer ikkje i eit multiprosessvindauge. # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -267,6 +267,7 @@ self_view_hidden_message=Bildet frå eige kamera er skjult, men vert framleis se peer_left_session=Venane dine fór. peer_unexpected_quit=Venane dine har uventa kopla seg frå. +peer_join_session=Venen din er no med. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/pl/loop.properties b/browser/extensions/loop/chrome/locale/pl/loop.properties index c5dbeeef62b4..9081c72b5163 100644 --- a/browser/extensions/loop/chrome/locale/pl/loop.properties +++ b/browser/extensions/loop/chrome/locale/pl/loop.properties @@ -23,9 +23,9 @@ first_time_experience_button_label2=Przekonaj się, jak to działa fte_slide_1_title=Przeglądaj strony WWW wspólnie ze znajomymi fte_slide_1_copy=Niezależnie czy planujesz wycieczkę, zakup prezentu, {{clientShortname2}} pozwala podejmować decyzje szybciej. fte_slide_2_title2=Stworzony, by dzielić się siecią -fte_slide_2_copy2=Zapraszając znajomego do czatu, {{clientShortname2}} automatycznie udostępni stronę którą oglądasz. Planuj. Rób zakupy. Decyduj. Wspólnie. +fte_slide_2_copy2=Zapraszając znajomego do czatu, {{clientShortname2}} automatycznie udostępni stronę, którą oglądasz. Planuj. Rób zakupy. Decyduj. Wspólnie. fte_slide_3_title=Zaproś znajomego wysyłając odnośnik -fte_slide_3_copy={{clientSuperShortname}} działa w większości przeglądarek na komputery. Nie jest wymagane zakładnie kont i wszyscy łączą się bez opłat. +fte_slide_3_copy={{clientSuperShortname}} działa w większości przeglądarek na komputery. Nie jest wymagane zakładanie kont i wszyscy łączą się bez opłat. fte_slide_4_title=Odszukaj ikonę {{clientSuperShortname}}, aby rozpocząć fte_slide_4_copy=Po znalezieniu strony do omówienia, kliknij ikonę w {{brandShortname}}, aby utworzyć odnośnik. Wyślij go znajomemu jakkolwiek chcesz! @@ -117,9 +117,6 @@ rooms_list_currently_browsing2=Obecnie aktywne rooms_signout_alert=Otwarte rozmowy zostaną zamknięte room_name_untitled_page=Strona bez tytułu -door_hanger_return=Do zobaczenia! Do tej współdzielonej sesji można zawsze wrócić przez panel Hello. -door_hanger_prompt_name=Czy nadać jej nazwę ułatwiającą jej zapamiętanie? Obecna nazwa to: -door_hanger_button=OK door_hanger_bye=Do zobaczenia! door_hanger_return2=Zawsze można powrócić do tej udostępnianej sesji poprzez panel Firefox Hello. Czy nadać ułatwiającą jej zapamiętanie nazwę? door_hanger_current=Obecna nazwa: @@ -128,7 +125,8 @@ door_hanger_button2=OK infobar_screenshare_no_guest_message=Jak tylko znajomy dołączy, będzie mógł oglądać zawartość każdej karty, którą klikniesz. infobar_screenshare_browser_message2=Udostępniasz obraz kart. Rozmówcy mogą oglądać zawartość każdej karty, którą klikniesz. infobar_screenshare_browser_message3=Udostępniasz obraz kart. Rozmówcy mogą oglądać zawartość każdej karty, którą klikniesz. -infobar_screenshare_stop_sharing_message=Udostępnianie obrazu kart zostało wstrzymane +infobar_screenshare_stop_sharing_message2=Udostępnianie obrazu kart zostało wstrzymane. +infobar_screenshare_stop_no_guest_message=Udostępnianie obrazu kart zostało wstrzymane. Gdy ktoś dołączy do rozmowy, nic nie zobaczy dopóki nie wznowisz udostępniania. infobar_button_restart_label2=Wznów udostępnianie infobar_button_restart_accesskey=W infobar_button_stop_label2=Nie udostępniaj dłużej @@ -174,10 +172,11 @@ rooms_room_join_label=Dołącz do rozmowy rooms_room_joined_owner_connected_label2=Zestawiono połączenie, druga osoba będzie od teraz mogła widzieć Twoje karty. rooms_room_joined_owner_not_connected_label=Ktoś czeka, aby wspólnie przeglądać {{roomURLHostname}}. -self_view_hidden_message=Obraz z kamery jest ukryty ale nadal wysyłany (powiększenie okna ukaże go) +self_view_hidden_message=Obraz z kamery jest ukryty, ale nadal wysyłany (powiększenie okna ukaże go) peer_left_session=Rozmówca się rozłączył. peer_unexpected_quit=Rozmówca nieoczekiwanie się rozłączył. +peer_join_session=Dołączył rozmówca. tos_failure_message=Usługa {{clientShortname}} nie jest dostępna w tym kraju. diff --git a/browser/extensions/loop/chrome/locale/pt-PT/loop.properties b/browser/extensions/loop/chrome/locale/pt-PT/loop.properties index 995004d48854..a27c362cb6cd 100644 --- a/browser/extensions/loop/chrome/locale/pt-PT/loop.properties +++ b/browser/extensions/loop/chrome/locale/pt-PT/loop.properties @@ -267,6 +267,7 @@ self_view_hidden_message=Vista própria oculta mas ainda a ser enviada; redimens peer_left_session=O seu amigo saiu. peer_unexpected_quit=O seu amigo foi desligado de forma inesperada. +peer_join_session=O seu amigo entrou. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/rm/loop.properties b/browser/extensions/loop/chrome/locale/rm/loop.properties index ac9969ca4142..f112d6bd0c7e 100644 --- a/browser/extensions/loop/chrome/locale/rm/loop.properties +++ b/browser/extensions/loop/chrome/locale/rm/loop.properties @@ -34,6 +34,7 @@ first_time_experience_subheading_button_above=Clicca sin il buttun survart per n ## LOCALIZATION_NOTE(first_time_experience_content, first_time_experience_content2): Message describing ## ways to use Hello project. first_time_experience_content=Fa diever da la funcziun per planisar ensemen, lavurar ensemen, rir ensemen. +first_time_experience_content2=Fa diever da la funcziun per planisar ensemen, lavurar ensemen, rir ensemen. first_time_experience_button_label2=Mussar co che quai funcziunescha ## First Time Experience Slides @@ -193,6 +194,7 @@ rooms_signout_alert=Conversaziuns avertas vegnan serradas room_name_untitled_page=Pagina senza titel ## LOCALIZATION NOTE (door_hanger_return, door_hanger_prompt_name, door_hanger_button): Dialog message on leaving conversation +door_hanger_bye=A pli tard! # Infobar strings diff --git a/browser/extensions/loop/chrome/locale/ro/loop.properties b/browser/extensions/loop/chrome/locale/ro/loop.properties index 485cacbe3f24..3a8275e17602 100644 --- a/browser/extensions/loop/chrome/locale/ro/loop.properties +++ b/browser/extensions/loop/chrome/locale/ro/loop.properties @@ -7,6 +7,8 @@ ## LOCALIZATION_NOTE(loopMenuItem_label): Label of the menu item that is placed ## inside the browser 'Tools' menu. Use the unicode ellipsis char, \u2026, or ## use "..." if \u2026 doesn't suit traditions in your locale. +loopMenuItem_label=Pornește o conversație… +loopMenuItem_accesskey=t ## LOCALIZATION_NOTE(sign_in_again_title_line_one, sign_in_again_title_line_two2): ## These are displayed together at the top of the panel when a user is needed to @@ -14,35 +16,56 @@ ## and this is displayed in slightly larger font. Please arrange as necessary for ## your locale. ## {{clientShortname2}} will be replaced by the brand name for either string. +sign_in_again_title_line_one=Te rugăm să te autentifici din nou +sign_in_again_title_line_two2=pentru a continua să folosești {{clientShortname2}} +sign_in_again_button=Autentificare ## LOCALIZATION_NOTE(sign_in_again_use_as_guest_button2): {{clientSuperShortname}} ## will be replaced by the super short brandname. +sign_in_again_use_as_guest_button2=Folosește {{clientSuperShortname}} ca oaspete +panel_browse_with_friend_button=Navighează pe această pagină cu un prieten +panel_disconnect_button=Deconectare ## LOCALIZATION_NOTE(first_time_experience_subheading2, first_time_experience_subheading_button_above): Message inviting the ## user to create his or her first conversation. +first_time_experience_subheading2=Clic pe butonul Hello pentru a naviga pe pagini web cu un prieten. +first_time_experience_subheading_button_above=Clic pe butonul de mai sus pentru a naviga pe pagini web cu un prieten. ## LOCALIZATION_NOTE(first_time_experience_content, first_time_experience_content2): Message describing ## ways to use Hello project. +first_time_experience_content=Folosește-l pentru a planifica împreună, a lucra împreună, a râde împreună. +first_time_experience_content2=Folosește-l pentru realizarea unor lucruri: pentru a planifica împreună, a lucra împreună, a râde împreună. +first_time_experience_button_label2=Vezi cum funcționează ## First Time Experience Slides +fte_slide_1_title=Navighează pe pagini web cu un prieten ## LOCALIZATION_NOTE(fte_slide_1_copy): {{clientShortname2}} ## will be replaced by the short name 2. +fte_slide_2_title2=Realizat pentru a împărtăși webul ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. ## LOCALIZATION_NOTE(fte_slide_3_copy): {{clientSuperShortname}} ## will be replaced by the super short brand name. ## LOCALIZATION_NOTE(fte_slide_4_title): {{clientSuperShortname}} ## will be replaced by the super short brand name. +fte_slide_4_title=Găsește iconița {{clientSuperShortname}} pentru a începe ## LOCALIZATION_NOTE(fte_slide_4_copy): {{brandShortname}} ## will be replaced by the brand short name. ## LOCALIZATION_NOTE(invite_copy_link_button, invite_copied_link_button, ## invite_email_link_button, invite_facebook_button2): These labels appear under ## an iconic button for the invite view. +invite_copied_link_button=Copiat! +invite_email_link_button=Trimite e-mail cu linkul +invite_facebook_button3=Facebook +invite_your_link=Linkul tău: # Error bars ## LOCALIZATION NOTE(session_expired_error_description,could_not_authenticate,password_changed_question,try_again_later,could_not_connect,check_internet_connection,login_expired,service_not_available,problem_accessing_account): ## These may be displayed at the top of the panel. +session_expired_error_description=Sesiune expirată. Toate URL-urile pe care le-ai creat anterior și partajate nu vor mai funcționa. +could_not_authenticate=Nu se poate autentifica +try_again_later=Te rugăm să încerci din nou mai târziu ## LOCALIZATION NOTE(retry_button): Displayed when there is an error to retry ## the appropriate action. @@ -56,15 +79,23 @@ ## between {{..}}. Please keep the text below 117 characters to make sure it fits ## in a tweet. +share_add_service_button=Adaugă un serviciu ## LOCALIZATION NOTE (copy_link_menuitem, email_link_menuitem, delete_conversation_menuitem): ## These menu items are displayed from a panel's context menu for a conversation. +email_link_menuitem=Trimite e-mail cu linkul +settings_menu_item_account=Cont +settings_menu_item_settings=Setări +settings_menu_button_tooltip=Setări # Conversation Window Strings +initiate_call_button_label2=Ești gata să pornești conversația? +incoming_call_title2=Cerere de conversație +incoming_call_block_button=Blochează hangup_button_title=Închide hangup_button_caption2=Ieșire @@ -75,7 +106,11 @@ hangup_button_caption2=Ieșire # Outgoing conversation +outgoing_call_title=Pornești conversația? +initiate_audio_video_call_button2=Pornește +initiate_audio_video_call_tooltip2=Pornește o conversație video +restart_call=Realătură-te ## LOCALIZATION NOTE (contact_offline_title): Title which is displayed when the ## contact is offline. @@ -85,6 +120,7 @@ hangup_button_caption2=Ieșire ## LOCALIZATION NOTE (cancel_button): ## This button is displayed when a call has failed. +cannot_start_call_session_not_ready=Nu se poate porni apelul, sesiunea nu este pregătită. ## LOCALIZATION NOTE (legal_text_and_links3): In this item, don't translate the ## parts between {{..}} because these will be replaced with links with the labels @@ -106,6 +142,9 @@ hangup_button_caption2=Ieșire # Infobar strings +infobar_button_restart_label2=Repornește partajarea +infobar_button_restart_accesskey=R +infobar_button_stop_label2=Oprește partajarea # Copy panel strings @@ -125,8 +164,8 @@ chat_textbox_placeholder=Tastează aici… ## should remain "Firefox Hello" for all locales. clientShortname2=Firefox Hello -conversation_has_ended=Conversația s-a încheiat. -generic_failure_message=Momentan întâmpinăm dificultăți tehnice… +conversation_has_ended=Conversația ta s-a încheiat. +generic_failure_message=Întâmpinăm dificultăți tehnice… generic_failure_no_reason2=Dorești să încerci din nou? @@ -134,16 +173,16 @@ help_label=Ajutor mute_local_audio_button_title=Închide sunetul unmute_local_audio_button_title=Pornește sunetul -mute_local_video_button_title2=Oprește video -unmute_local_video_button_title2=Pornește video +mute_local_video_button_title2=Oprește videoul +unmute_local_video_button_title2=Pornește videoul ## LOCALIZATION NOTE (retry_call_button): ## This button is displayed when a call has failed. retry_call_button=Reîncearcă -rooms_leave_button_label=Părăsire +rooms_leave_button_label=Părăsește -rooms_panel_title=Alege o conversație sau începe una nouă +rooms_panel_title=Alege o conversație sau pornește una nouă rooms_room_full_call_to_action_label=Află mai multe despre {{clientShortname}} » rooms_room_full_call_to_action_nonFx_label=Descarcă {{brandShortname}} pentru a porni propria conversație diff --git a/browser/extensions/loop/chrome/locale/ru/loop.properties b/browser/extensions/loop/chrome/locale/ru/loop.properties index c8be43048269..612aeebc43bd 100644 --- a/browser/extensions/loop/chrome/locale/ru/loop.properties +++ b/browser/extensions/loop/chrome/locale/ru/loop.properties @@ -41,7 +41,7 @@ first_time_experience_button_label2=Посмотреть, как это рабо fte_slide_1_title=Просматривайте веб-страницы с другом ## LOCALIZATION_NOTE(fte_slide_1_copy): {{clientShortname2}} ## will be replaced by the short name 2. -fte_slide_1_copy=Бу то планирование поездки или покупка подарка, {{clientShortname2}} позволяет вам принимать решения быстрее в реальном времени. +fte_slide_1_copy=Будь то планирование поездки или покупка подарка, {{clientShortname2}} позволяет вам принимать решения быстрее в реальном времени. fte_slide_2_title2=Создан для совместной работы в Интернете ## LOCALIZATION_NOTE(fte_slide_2_copy2): {{clientShortname2}} ## will be replaced by the short name 2. diff --git a/browser/extensions/loop/chrome/locale/sk/loop.properties b/browser/extensions/loop/chrome/locale/sk/loop.properties index 1623c9b8604f..13a97e9f4658 100644 --- a/browser/extensions/loop/chrome/locale/sk/loop.properties +++ b/browser/extensions/loop/chrome/locale/sk/loop.properties @@ -268,6 +268,7 @@ self_view_hidden_message=Záber z kamery je skrytý, napriek tomu sa stále odos peer_left_session=Váš priateľ odišiel. peer_unexpected_quit=Váš priateľ neočakávane ukončil spojenie. +peer_join_session=Váš priateľ sa pripojil. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/sr/loop.properties b/browser/extensions/loop/chrome/locale/sr/loop.properties index fe4a40e4cf02..0c3ed8a1bda7 100644 --- a/browser/extensions/loop/chrome/locale/sr/loop.properties +++ b/browser/extensions/loop/chrome/locale/sr/loop.properties @@ -268,6 +268,7 @@ self_view_hidden_message=Приказ вашег екрана је сакрив peer_left_session=Ваш пријатељ је изашао. peer_unexpected_quit=Ваш пријатељ се неочекивано искључио. +peer_join_session=Ваш пријатељ се придружио. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/locale/tr/loop.properties b/browser/extensions/loop/chrome/locale/tr/loop.properties index 2ebacc310ec6..36b12ecca6b0 100644 --- a/browser/extensions/loop/chrome/locale/tr/loop.properties +++ b/browser/extensions/loop/chrome/locale/tr/loop.properties @@ -267,6 +267,7 @@ self_view_hidden_message=Kendi görünümünüz gizlendi ama hâlâ gönderiliyo peer_left_session=Arkadaşınız çıktı. peer_unexpected_quit=Arkadaşınızın bağlantısı koptu. +peer_join_session=Arkadaşınız geldi. ## LOCALIZATION NOTE (tos_failure_message): Don't translate {{clientShortname}} ## as this will be replaced by clientShortname2. diff --git a/browser/extensions/loop/chrome/skin/linux/platform.css b/browser/extensions/loop/chrome/skin/linux/platform.css new file mode 100644 index 000000000000..12a0f784574c --- /dev/null +++ b/browser/extensions/loop/chrome/skin/linux/platform.css @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* Only apply to browser.xul documents */ +@-moz-document url("chrome://browser/content/browser.xul") { + /** + * XXX Due to bug 1228542, anything in this file that overrides a browser style + * must specify !important. Otherwise the style won't get applied correctly + * due to the limitations caused by the bug. + */ + + #loop-button[state="slideshow"] { + background: none; + } + + #loop-button[state="slideshow"] > .toolbarbutton-badge-stack { + background: var(--toolbarbutton-hover-background) !important; + background-clip: padding-box !important; + border-color: var(--toolbarbutton-hover-bordercolor) !important; + box-shadow: var(--toolbarbutton-hover-boxshadow) !important; + } +} diff --git a/browser/extensions/loop/chrome/skin/windows/platform.css b/browser/extensions/loop/chrome/skin/windows/platform.css index 6f0c7610e9af..8ea88fa9ed01 100644 --- a/browser/extensions/loop/chrome/skin/windows/platform.css +++ b/browser/extensions/loop/chrome/skin/windows/platform.css @@ -23,4 +23,15 @@ list-style-image: url(chrome://loop/skin/toolbar-lunaSilver@2x.png) } } + + #loop-button[state="slideshow"] { + background: none; + } + + #loop-button[state="slideshow"] > .toolbarbutton-badge-stack { + background: var(--toolbarbutton-hover-background) !important; + background-clip: padding-box !important; + border-color: var(--toolbarbutton-hover-bordercolor) !important; + box-shadow: var(--toolbarbutton-hover-boxshadow) !important; + } } diff --git a/browser/extensions/loop/chrome/test/mochitest/browser.ini b/browser/extensions/loop/chrome/test/mochitest/browser.ini index 530e5749233f..2187c3736c10 100644 --- a/browser/extensions/loop/chrome/test/mochitest/browser.ini +++ b/browser/extensions/loop/chrome/test/mochitest/browser.ini @@ -16,7 +16,6 @@ skip-if = os == "linux" # Bug 1266041 [browser_mozLoop_chat.js] [browser_mozLoop_context.js] [browser_mozLoop_infobar.js] -[browser_mozLoop_socialShare.js] [browser_panel_privateBrowsing.js] [browser_mozLoop_sharingListeners.js] [browser_mozLoop_telemetry.js] diff --git a/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_appVersionInfo.js b/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_appVersionInfo.js index 91f180902772..dd22564802e5 100644 --- a/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_appVersionInfo.js +++ b/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_appVersionInfo.js @@ -6,7 +6,9 @@ var [, gHandlers] = LoopAPI.inspect(); add_task(function* test_mozLoop_appVersionInfo() { let appVersionInfo; - gHandlers.GetAppVersionInfo({}, result => { appVersionInfo = result; }); + gHandlers.GetAppVersionInfo({}, result => { + appVersionInfo = result; + }); Assert.ok(appVersionInfo, "should have appVersionInfo"); diff --git a/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_socialShare.js b/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_socialShare.js deleted file mode 100644 index f0d8045badc0..000000000000 --- a/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_socialShare.js +++ /dev/null @@ -1,98 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ -"use strict"; - -Cu.import("resource://gre/modules/Promise.jsm"); -const { SocialService } = Cu.import("resource://gre/modules/SocialService.jsm", {}); - -var [, gHandlers] = LoopAPI.inspect(); - -const kShareProvider = { - name: "provider 1", - origin: "https://example.com", - iconURL: "https://example.com/browser/browser/base/content/test/general/moz.png", - shareURL: "https://example.com/browser/browser/base/content/test/social/social_sidebar_empty.html" -}; -const kShareProviderInvalid = { - name: "provider 1", - origin: "https://example2.com" -}; -const kActivationPage = "https://example.com/browser/browser/base/content/test/social/share_activate.html"; - -registerCleanupFunction(function* () { - Services.prefs.clearUserPref("social.shareDirectory"); - yield new Promise(resolve => SocialService.disableProvider(kShareProvider.origin, resolve)); - yield new Promise(resolve => SocialService.disableProvider(kShareProviderInvalid.origin, resolve)); - Assert.strictEqual(Social.providers.length, 0, "all providers should be removed"); - SocialShare.uninit(); -}); - -add_task(function* test_mozLoop_addSocialShareProvider() { - Services.prefs.setCharPref("social.shareDirectory", kActivationPage); - - gHandlers.AddSocialShareProvider({}, () => {}); - - yield promiseWaitForCondition(() => SocialShare.panel.state == "open"); - - Assert.equal(SocialShare.iframe.getAttribute("src"), "about:providerdirectory", - "Provider directory page should be visible"); - - SocialShare.panel.hidePopup(); -}); - -add_task(function* test_mozLoop_getSocialShareProviders() { - let providers; - gHandlers.GetSocialShareProviders({}, result => { providers = result; }); - Assert.strictEqual(providers.length, 0, "Provider list should be empty initially"); - - // Add a provider. - yield new Promise(resolve => SocialService.addProvider(kShareProvider, resolve)); - - gHandlers.GetSocialShareProviders({}, result => { providers = result; }); - Assert.strictEqual(providers.length, 1, - "The newly added provider should be part of the list"); - let provider = providers[0]; - Assert.strictEqual(provider.iconURL, kShareProvider.iconURL, "Icon URLs should match"); - Assert.strictEqual(provider.name, kShareProvider.name, "Names should match"); - Assert.strictEqual(provider.origin, kShareProvider.origin, "Origins should match"); - - // Add another provider that should not be picked up by Loop. - yield new Promise(resolve => SocialService.addProvider(kShareProviderInvalid, resolve)); - - gHandlers.GetSocialShareProviders({}, result => { providers = result; }); - Assert.strictEqual(providers.length, 1, - "The newly added provider should not be part of the list"); - - // Let's add a valid second provider object. - let provider2 = Object.create(kShareProvider); - provider2.name = "Wildly different name"; - provider2.origin = "https://example3.com"; - yield new Promise(resolve => SocialService.addProvider(provider2, resolve)); - - gHandlers.GetSocialShareProviders({}, result => { providers = result; }); - Assert.strictEqual(providers.length, 2, - "The newly added provider should be part of the list"); - Assert.strictEqual(providers[1].name, provider2.name, - "Providers should be ordered alphabetically"); - - // Remove the second valid provider. - yield new Promise(resolve => SocialService.disableProvider(provider2.origin, resolve)); - gHandlers.GetSocialShareProviders({}, result => { providers = result; }); - Assert.strictEqual(providers.length, 1, - "The uninstalled provider should not be part of the list"); - Assert.strictEqual(providers[0].name, kShareProvider.name, "Names should match"); -}); - -add_task(function* test_mozLoop_socialShareRoom() { - gHandlers.SocialShareRoom({ data: [kShareProvider.origin, "https://someroom.com", - "Some Title"] }, () => {}); - - yield promiseWaitForCondition(() => SocialShare.panel.state == "open"); - - Assert.equal(SocialShare.iframe.getAttribute("origin"), kShareProvider.origin, - "Origins should match"); - Assert.equal(SocialShare.iframe.getAttribute("src"), kShareProvider.shareURL, - "Provider's share page should be displayed"); - - SocialShare.panel.hidePopup(); -}); diff --git a/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_telemetry.js b/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_telemetry.js index a37698060751..70c919942876 100644 --- a/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_telemetry.js +++ b/browser/extensions/loop/chrome/test/mochitest/browser_mozLoop_telemetry.js @@ -9,7 +9,9 @@ var [, gHandlers] = LoopAPI.inspect(); var gConstants; -gHandlers.GetAllConstants({}, constants => { gConstants = constants; }); +gHandlers.GetAllConstants({}, constants => { + gConstants = constants; +}); function resetMauPrefs() { Services.prefs.clearUserPref("loop.mau.openPanel"); @@ -36,65 +38,6 @@ add_task(function* test_initialize() { }); }); -/** - * Tests that enumerated bucket histograms exist and can be updated. - */ -add_task(function* test_mozLoop_telemetryAdd_buckets() { - let histogramId = "LOOP_TWO_WAY_MEDIA_CONN_LENGTH_1"; - let histogram = Services.telemetry.getHistogramById(histogramId); - let CONN_LENGTH = gConstants.TWO_WAY_MEDIA_CONN_LENGTH; - - histogram.clear(); - for (let value of [CONN_LENGTH.SHORTER_THAN_10S, - CONN_LENGTH.BETWEEN_10S_AND_30S, - CONN_LENGTH.BETWEEN_10S_AND_30S, - CONN_LENGTH.BETWEEN_30S_AND_5M, - CONN_LENGTH.BETWEEN_30S_AND_5M, - CONN_LENGTH.BETWEEN_30S_AND_5M, - CONN_LENGTH.MORE_THAN_5M, - CONN_LENGTH.MORE_THAN_5M, - CONN_LENGTH.MORE_THAN_5M, - CONN_LENGTH.MORE_THAN_5M]) { - gHandlers.TelemetryAddValue({ data: [histogramId, value] }, () => {}); - } - - let snapshot = histogram.snapshot(); - is(snapshot.counts[CONN_LENGTH.SHORTER_THAN_10S], 1, "TWO_WAY_MEDIA_CONN_LENGTH.SHORTER_THAN_10S"); - is(snapshot.counts[CONN_LENGTH.BETWEEN_10S_AND_30S], 2, "TWO_WAY_MEDIA_CONN_LENGTH.BETWEEN_10S_AND_30S"); - is(snapshot.counts[CONN_LENGTH.BETWEEN_30S_AND_5M], 3, "TWO_WAY_MEDIA_CONN_LENGTH.BETWEEN_30S_AND_5M"); - is(snapshot.counts[CONN_LENGTH.MORE_THAN_5M], 4, "TWO_WAY_MEDIA_CONN_LENGTH.MORE_THAN_5M"); -}); - -add_task(function* test_mozLoop_telemetryAdd_sharingURL_buckets() { - let histogramId = "LOOP_SHARING_ROOM_URL"; - let histogram = Services.telemetry.getHistogramById(histogramId); - const SHARING_TYPES = gConstants.SHARING_ROOM_URL; - - histogram.clear(); - for (let value of [SHARING_TYPES.COPY_FROM_PANEL, - SHARING_TYPES.COPY_FROM_CONVERSATION, - SHARING_TYPES.COPY_FROM_CONVERSATION, - SHARING_TYPES.EMAIL_FROM_CALLFAILED, - SHARING_TYPES.EMAIL_FROM_CALLFAILED, - SHARING_TYPES.EMAIL_FROM_CALLFAILED, - SHARING_TYPES.EMAIL_FROM_CONVERSATION, - SHARING_TYPES.EMAIL_FROM_CONVERSATION, - SHARING_TYPES.EMAIL_FROM_CONVERSATION, - SHARING_TYPES.EMAIL_FROM_CONVERSATION]) { - gHandlers.TelemetryAddValue({ data: [histogramId, value] }, () => {}); - } - - let snapshot = histogram.snapshot(); - Assert.strictEqual(snapshot.counts[SHARING_TYPES.COPY_FROM_PANEL], 1, - "SHARING_ROOM_URL.COPY_FROM_PANEL"); - Assert.strictEqual(snapshot.counts[SHARING_TYPES.COPY_FROM_CONVERSATION], 2, - "SHARING_ROOM_URL.COPY_FROM_CONVERSATION"); - Assert.strictEqual(snapshot.counts[SHARING_TYPES.EMAIL_FROM_CALLFAILED], 3, - "SHARING_ROOM_URL.EMAIL_FROM_CALLFAILED"); - Assert.strictEqual(snapshot.counts[SHARING_TYPES.EMAIL_FROM_CONVERSATION], 4, - "SHARING_ROOM_URL.EMAIL_FROM_CONVERSATION"); -}); - add_task(function* test_mozLoop_telemetryAdd_roomCreate_buckets() { let histogramId = "LOOP_ROOM_CREATE"; let histogram = Services.telemetry.getHistogramById(histogramId); @@ -114,59 +57,6 @@ add_task(function* test_mozLoop_telemetryAdd_roomCreate_buckets() { "SHARING_ROOM_URL.CREATE_FAIL"); }); -add_task(function* test_mozLoop_telemetryAdd_roomDelete_buckets() { - let histogramId = "LOOP_ROOM_DELETE"; - let histogram = Services.telemetry.getHistogramById(histogramId); - const ACTION_TYPES = gConstants.ROOM_DELETE; - - histogram.clear(); - for (let value of [ACTION_TYPES.DELETE_SUCCESS, - ACTION_TYPES.DELETE_FAIL, - ACTION_TYPES.DELETE_FAIL]) { - gHandlers.TelemetryAddValue({ data: [histogramId, value] }, () => {}); - } - - let snapshot = histogram.snapshot(); - Assert.strictEqual(snapshot.counts[ACTION_TYPES.DELETE_SUCCESS], 1, - "SHARING_ROOM_URL.DELETE_SUCCESS"); - Assert.strictEqual(snapshot.counts[ACTION_TYPES.DELETE_FAIL], 2, - "SHARING_ROOM_URL.DELETE_FAIL"); -}); - -add_task(function* test_mozLoop_telemetryAdd_roomSessionWithChat() { - let histogramId = "LOOP_ROOM_SESSION_WITHCHAT"; - let histogram = Services.telemetry.getHistogramById(histogramId); - - histogram.clear(); - - let snapshot; - for (let i = 1; i < 4; ++i) { - gHandlers.TelemetryAddValue({ data: [histogramId, 1] }, () => {}); - snapshot = histogram.snapshot(); - Assert.strictEqual(snapshot.counts[0], i); - } -}); - -add_task(function* test_mozLoop_telemetryAdd_infobarActionButtons() { - let histogramId = "LOOP_INFOBAR_ACTION_BUTTONS"; - let histogram = Services.telemetry.getHistogramById(histogramId); - const ACTION_TYPES = gConstants.SHARING_SCREEN; - - histogram.clear(); - - for (let value of [ACTION_TYPES.PAUSED, - ACTION_TYPES.PAUSED, - ACTION_TYPES.RESUMED]) { - gHandlers.TelemetryAddValue({ data: [histogramId, value] }, () => {}); - } - - let snapshot = histogram.snapshot(); - Assert.strictEqual(snapshot.counts[ACTION_TYPES.RESUMED], 1, - "SHARING_SCREEN.RESUMED"); - Assert.strictEqual(snapshot.counts[ACTION_TYPES.PAUSED], 2, - "SHARING_SCREEN.PAUSED"); -}); - add_task(function* test_mozLoop_telemetryAdd_loopMauType_buckets() { let histogramId = "LOOP_ACTIVITY_COUNTER"; let histogram = Services.telemetry.getHistogramById(histogramId); diff --git a/browser/extensions/loop/install.rdf.in b/browser/extensions/loop/install.rdf.in index 679a2cb3f0d3..704bed93ec1b 100644 --- a/browser/extensions/loop/install.rdf.in +++ b/browser/extensions/loop/install.rdf.in @@ -9,7 +9,7 @@ loop@mozilla.org true - 1.4.0 + 1.4.1 2