text: (function webpackUniversalModuleDefinition(root, factory) {
  	if(typeof exports === 'object' && typeof module === 'object')
  		module.exports = factory();
  	else if(typeof define === 'function' && define.amd)
  		define([], factory);
  	else if(typeof exports === 'object')
  		exports["WatsonSpeech"] = factory();
  	else
  		root["WatsonSpeech"] = factory();
  })(this, function() {
  return /******/ (function(modules) { // webpackBootstrap
  /******/ 	// The module cache
  /******/ 	var installedModules = {};
  /******/
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  /******/
  /******/ 		// Check if module is in cache
  /******/ 		if(installedModules[moduleId]) {
  /******/ 			return installedModules[moduleId].exports;
  /******/ 		}
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = installedModules[moduleId] = {
  /******/ 			i: moduleId,
  /******/ 			l: false,
  /******/ 			exports: {}
  /******/ 		};
  /******/
  /******/ 		// Execute the module function
  /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  /******/
  /******/ 		// Flag the module as loaded
  /******/ 		module.l = true;
  /******/
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  /******/
  /******/
  /******/ 	// expose the modules object (__webpack_modules__)
  /******/ 	__webpack_require__.m = modules;
  /******/
  /******/ 	// expose the module cache
  /******/ 	__webpack_require__.c = installedModules;
  /******/
  /******/ 	// define getter function for harmony exports
  /******/ 	__webpack_require__.d = function(exports, name, getter) {
  /******/ 		if(!__webpack_require__.o(exports, name)) {
  /******/ 			Object.defineProperty(exports, name, {
  /******/ 				configurable: false,
  /******/ 				enumerable: true,
  /******/ 				get: getter
  /******/ 			});
  /******/ 		}
  /******/ 	};
  /******/
  /******/ 	// getDefaultExport function for compatibility with non-harmony modules
  /******/ 	__webpack_require__.n = function(module) {
  /******/ 		var getter = module && module.__esModule ?
  /******/ 			function getDefault() { return module['default']; } :
  /******/ 			function getModuleExports() { return module; };
  /******/ 		__webpack_require__.d(getter, 'a', getter);
  /******/ 		return getter;
  /******/ 	};
  /******/
  /******/ 	// Object.prototype.hasOwnProperty.call
  /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  /******/
  /******/ 	// __webpack_public_path__
  /******/ 	__webpack_require__.p = "";
  /******/
  /******/ 	// Load entry module and return exports
  /******/ 	return __webpack_require__(__webpack_require__.s = 43);
  /******/ })
  /************************************************************************/
  /******/ ([
  /* 0 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(global) {/*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
   * @license  MIT
   */
  /* eslint-disable no-proto */
  
  
  
  var base64 = __webpack_require__(45)
  var ieee754 = __webpack_require__(46)
  var isArray = __webpack_require__(24)
  
  exports.Buffer = Buffer
  exports.SlowBuffer = SlowBuffer
  exports.INSPECT_MAX_BYTES = 50
  
  /**
   * If `Buffer.TYPED_ARRAY_SUPPORT`:
   *   === true    Use Uint8Array implementation (fastest)
   *   === false   Use Object implementation (most compatible, even IE6)
   *
   * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
   * Opera 11.6+, iOS 4.2+.
   *
   * Due to various browser bugs, sometimes the Object implementation will be used even
   * when the browser supports typed arrays.
   *
   * Note:
   *
   *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
   *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
   *
   *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
   *
   *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
   *     incorrect length in some situations.
  
   * 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 = 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.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
      return arr.foo() === 42 && // typed array instances can be augmented
          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
      ? 0x7fffffff
      : 0x3fffffff
  }
  
  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
    }
  
    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') {
      if (typeof encodingOrOffset === 'string') {
        throw new Error(
          'If encoding is specified then the first argument must be a string'
        )
      }
      return allocUnsafe(this, arg)
    }
    return from(this, arg, encodingOrOffset, length)
  }
  
  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')
    } else if (size < 0) {
      throw new RangeError('"size" argument must not be negative')
    }
  }
  
  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 < size; ++i) {
        that[i] = 0
      }
    }
    return that
  }
  
  /**
   * 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')
    }
  
    var length = byteLength(string, encoding) | 0
    that = createBuffer(that, length)
  
    var actual = that.write(string, encoding)
  
    if (actual !== length) {
      // Writing a hex string, for example, that contains invalid characters will
      // cause everything after the first invalid character to be ignored. (e.g.
      // 'abxxcd' will be treated as 'ab')
      that = that.slice(0, actual)
    }
  
    return that
  }
  
  function fromArrayLike (that, array) {
    var length = array.length < 0 ? 0 : checked(array.length) | 0
    that = createBuffer(that, length)
    for (var i = 0; i < length; i += 1) {
      that[i] = array[i] & 255
    }
    return that
  }
  
  function fromArrayBuffer (that, array, byteOffset, length) {
    array.byteLength // this throws if `array` is not a valid ArrayBuffer
  
    if (byteOffset < 0 || array.byteLength < byteOffset) {
      throw new RangeError('\'offset\' is out of bounds')
    }
  
    if (array.byteLength < byteOffset + (length || 0)) {
      throw new RangeError('\'length\' is out of bounds')
    }
  
    if (byteOffset === undefined && length === undefined) {
      array = new Uint8Array(array)
    } else if (length === undefined) {
      array = new Uint8Array(array, byteOffset)
    } else {
      array = new Uint8Array(array, byteOffset, length)
    }
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      // Return an augmented `Uint8Array` instance, for best performance
      that = array
      that.__proto__ = Buffer.prototype
    } else {
      // Fallback: Return an object instance of the Buffer class
      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
    }
  
    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)
      }
  
      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) {
    // Note: cannot use `length < kMaxLength()` here because that fails when
    // length is NaN (which is otherwise coerced to zero.)
    if (length >= kMaxLength()) {
      throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                           'size: 0x' + kMaxLength().toString(16) + ' bytes')
    }
    return length | 0
  }
  
  function SlowBuffer (length) {
    if (+length != length) { // eslint-disable-line eqeqeq
      length = 0
    }
    return Buffer.alloc(+length)
  }
  
  Buffer.isBuffer = function isBuffer (b) {
    return !!(b != null && b._isBuffer)
  }
  
  Buffer.compare = function compare (a, b) {
    if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
      throw new TypeError('Arguments must be Buffers')
    }
  
    if (a === b) return 0
  
    var x = a.length
    var y = b.length
  
    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
    if (y < x) return 1
    return 0
  }
  
  Buffer.isEncoding = function isEncoding (encoding) {
    switch (String(encoding).toLowerCase()) {
      case 'hex':
      case 'utf8':
      case 'utf-8':
      case 'ascii':
      case 'latin1':
      case 'binary':
      case 'base64':
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return true
      default:
        return false
    }
  }
  
  Buffer.concat = function concat (list, length) {
    if (!isArray(list)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    }
  
    if (list.length === 0) {
      return Buffer.alloc(0)
    }
  
    var i
    if (length === undefined) {
      length = 0
      for (i = 0; i < list.length; ++i) {
        length += list[i].length
      }
    }
  
    var buffer = Buffer.allocUnsafe(length)
    var pos = 0
    for (i = 0; i < list.length; ++i) {
      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 buffer
  }
  
  function byteLength (string, encoding) {
    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
  
    // Use a for loop to avoid recursion
    var loweredCase = false
    for (;;) {
      switch (encoding) {
        case 'ascii':
        case 'latin1':
        case 'binary':
          return len
        case 'utf8':
        case 'utf-8':
        case undefined:
          return utf8ToBytes(string).length
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return len * 2
        case 'hex':
          return len >>> 1
        case 'base64':
          return base64ToBytes(string).length
        default:
          if (loweredCase) return utf8ToBytes(string).length // assume utf8
          encoding = ('' + encoding).toLowerCase()
          loweredCase = true
      }
    }
  }
  Buffer.byteLength = byteLength
  
  function slowToString (encoding, start, end) {
    var loweredCase = false
  
    // 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'
  
    while (true) {
      switch (encoding) {
        case 'hex':
          return hexSlice(this, start, end)
  
        case 'utf8':
        case 'utf-8':
          return utf8Slice(this, start, end)
  
        case 'ascii':
          return asciiSlice(this, start, end)
  
        case 'latin1':
        case 'binary':
          return latin1Slice(this, start, end)
  
        case 'base64':
          return base64Slice(this, start, end)
  
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return utf16leSlice(this, start, end)
  
        default:
          if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
          encoding = (encoding + '').toLowerCase()
          loweredCase = true
      }
    }
  }
  
  // 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.swap64 = function swap64 () {
    var len = this.length
    if (len % 8 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 64-bits')
    }
    for (var i = 0; i < len; i += 8) {
      swap(this, i, i + 7)
      swap(this, i + 1, i + 6)
      swap(this, i + 2, i + 5)
      swap(this, i + 3, i + 4)
    }
    return this
  }
  
  Buffer.prototype.toString = function toString () {
    var length = this.length | 0
    if (length === 0) return ''
    if (arguments.length === 0) return utf8Slice(this, 0, length)
    return slowToString.apply(this, arguments)
  }
  
  Buffer.prototype.equals = function equals (b) {
    if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
    if (this === b) return true
    return Buffer.compare(this, b) === 0
  }
  
  Buffer.prototype.inspect = function inspect () {
    var str = ''
    var max = exports.INSPECT_MAX_BYTES
    if (this.length > 0) {
      str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
      if (this.length > max) str += ' ... '
    }
    return '<Buffer ' + str + '>'
  }
  
  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
  }
  
  // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  //
  // Arguments:
  // - buffer - a Buffer to search
  // - val - a string, Buffer, or number
  // - byteOffset - an index into `buffer`; will be clamped to an int32
  // - encoding - an optional encoding, relevant is val is a string
  // - dir - true for indexOf, false for lastIndexOf
  function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
    // Empty buffer means no match
    if (buffer.length === 0) return -1
  
    // Normalize byteOffset
    if (typeof byteOffset === 'string') {
      encoding = byteOffset
      byteOffset = 0
    } else if (byteOffset > 0x7fffffff) {
      byteOffset = 0x7fffffff
    } else if (byteOffset < -0x80000000) {
      byteOffset = -0x80000000
    }
    byteOffset = +byteOffset  // Coerce to Number.
    if (isNaN(byteOffset)) {
      // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
      byteOffset = dir ? 0 : (buffer.length - 1)
    }
  
    // Normalize byteOffset: negative offsets start from the end of the buffer
    if (byteOffset < 0) byteOffset = buffer.length + byteOffset
    if (byteOffset >= buffer.length) {
      if (dir) return -1
      else byteOffset = buffer.length - 1
    } else if (byteOffset < 0) {
      if (dir) byteOffset = 0
      else return -1
    }
  
    // Normalize val
    if (typeof val === 'string') {
      val = Buffer.from(val, encoding)
    }
  
    // Finally, search either indexOf (if dir is true) or lastIndexOf
    if (Buffer.isBuffer(val)) {
      // Special case: looking for empty string/buffer always fails
      if (val.length === 0) {
        return -1
      }
      return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
    } else if (typeof val === 'number') {
      val = val & 0xFF // Search for a byte value [0-255]
      if (Buffer.TYPED_ARRAY_SUPPORT &&
          typeof Uint8Array.prototype.indexOf === 'function') {
        if (dir) {
          return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
        } else {
          return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
        }
      }
      return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
    }
  
    throw new TypeError('val must be string, number or Buffer')
  }
  
  function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
    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 i
    if (dir) {
      var foundIndex = -1
      for (i = byteOffset; i < arrLength; i++) {
        if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
          if (foundIndex === -1) foundIndex = i
          if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
        } else {
          if (foundIndex !== -1) i -= i - foundIndex
          foundIndex = -1
        }
      }
    } else {
      if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
      for (i = byteOffset; i >= 0; i--) {
        var found = true
        for (var j = 0; j < valLength; j++) {
          if (read(arr, i + j) !== read(val, j)) {
            found = false
            break
          }
        }
        if (found) return i
      }
    }
  
    return -1
  }
  
  Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
    return this.indexOf(val, byteOffset, encoding) !== -1
  }
  
  Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
    return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  }
  
  Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
    return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  }
  
  function hexWrite (buf, string, offset, length) {
    offset = Number(offset) || 0
    var remaining = buf.length - offset
    if (!length) {
      length = remaining
    } else {
      length = Number(length)
      if (length > remaining) {
        length = remaining
      }
    }
  
    // must be an even number of digits
    var strLen = string.length
    if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  
    if (length > strLen / 2) {
      length = strLen / 2
    }
    for (var i = 0; i < length; ++i) {
      var parsed = parseInt(string.substr(i * 2, 2), 16)
      if (isNaN(parsed)) return i
      buf[offset + i] = parsed
    }
    return i
  }
  
  function utf8Write (buf, string, offset, length) {
    return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  }
  
  function asciiWrite (buf, string, offset, length) {
    return blitBuffer(asciiToBytes(string), buf, offset, length)
  }
  
  function latin1Write (buf, string, offset, length) {
    return asciiWrite(buf, string, offset, length)
  }
  
  function base64Write (buf, string, offset, length) {
    return blitBuffer(base64ToBytes(string), buf, offset, length)
  }
  
  function ucs2Write (buf, string, offset, length) {
    return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  }
  
  Buffer.prototype.write = function write (string, offset, length, encoding) {
    // Buffer#write(string)
    if (offset === undefined) {
      encoding = 'utf8'
      length = this.length
      offset = 0
    // Buffer#write(string, encoding)
    } else if (length === undefined && typeof offset === 'string') {
      encoding = offset
      length = this.length
      offset = 0
    // Buffer#write(string, offset[, length][, encoding])
    } else if (isFinite(offset)) {
      offset = offset | 0
      if (isFinite(length)) {
        length = length | 0
        if (encoding === undefined) encoding = 'utf8'
      } else {
        encoding = length
        length = undefined
      }
    // legacy write(string, encoding, offset, length) - remove in v0.13
    } else {
      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')
    }
  
    if (!encoding) encoding = 'utf8'
  
    var loweredCase = false
    for (;;) {
      switch (encoding) {
        case 'hex':
          return hexWrite(this, string, offset, length)
  
        case 'utf8':
        case 'utf-8':
          return utf8Write(this, string, offset, length)
  
        case 'ascii':
          return asciiWrite(this, string, offset, length)
  
        case 'latin1':
        case 'binary':
          return latin1Write(this, string, offset, length)
  
        case 'base64':
          // Warning: maxLength not taken into account in base64Write
          return base64Write(this, string, offset, length)
  
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return ucs2Write(this, string, offset, length)
  
        default:
          if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
          encoding = ('' + encoding).toLowerCase()
          loweredCase = true
      }
    }
  }
  
  Buffer.prototype.toJSON = function toJSON () {
    return {
      type: 'Buffer',
      data: Array.prototype.slice.call(this._arr || this, 0)
    }
  }
  
  function base64Slice (buf, start, end) {
    if (start === 0 && end === buf.length) {
      return base64.fromByteArray(buf)
    } else {
      return base64.fromByteArray(buf.slice(start, end))
    }
  }
  
  function utf8Slice (buf, start, end) {
    end = Math.min(buf.length, end)
    var res = []
  
    var i = start
    while (i < end) {
      var firstByte = buf[i]
      var codePoint = null
      var bytesPerSequence = (firstByte > 0xEF) ? 4
        : (firstByte > 0xDF) ? 3
        : (firstByte > 0xBF) ? 2
        : 1
  
      if (i + bytesPerSequence <= end) {
        var secondByte, thirdByte, fourthByte, tempCodePoint
  
        switch (bytesPerSequence) {
          case 1:
            if (firstByte < 0x80) {
              codePoint = firstByte
            }
            break
          case 2:
            secondByte = buf[i + 1]
            if ((secondByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
              if (tempCodePoint > 0x7F) {
                codePoint = tempCodePoint
              }
            }
            break
          case 3:
            secondByte = buf[i + 1]
            thirdByte = buf[i + 2]
            if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
              if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
                codePoint = tempCodePoint
              }
            }
            break
          case 4:
            secondByte = buf[i + 1]
            thirdByte = buf[i + 2]
            fourthByte = buf[i + 3]
            if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
              if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
                codePoint = tempCodePoint
              }
            }
        }
      }
  
      if (codePoint === null) {
        // we did not generate a valid codePoint so insert a
        // replacement char (U+FFFD) and advance only 1 byte
        codePoint = 0xFFFD
        bytesPerSequence = 1
      } else if (codePoint > 0xFFFF) {
        // encode to utf16 (surrogate pair dance)
        codePoint -= 0x10000
        res.push(codePoint >>> 10 & 0x3FF | 0xD800)
        codePoint = 0xDC00 | codePoint & 0x3FF
      }
  
      res.push(codePoint)
      i += bytesPerSequence
    }
  
    return decodeCodePointsArray(res)
  }
  
  // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  // the lowest limit is Chrome, with 0x10000 args.
  // We go 1 magnitude less, for safety
  var MAX_ARGUMENTS_LENGTH = 0x1000
  
  function decodeCodePointsArray (codePoints) {
    var len = codePoints.length
    if (len <= MAX_ARGUMENTS_LENGTH) {
      return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
    }
  
    // Decode in chunks to avoid "call stack size exceeded".
    var res = ''
    var i = 0
    while (i < len) {
      res += String.fromCharCode.apply(
        String,
        codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
      )
    }
    return res
  }
  
  function asciiSlice (buf, start, end) {
    var ret = ''
    end = Math.min(buf.length, end)
  
    for (var i = start; i < end; ++i) {
      ret += String.fromCharCode(buf[i] & 0x7F)
    }
    return ret
  }
  
  function latin1Slice (buf, start, end) {
    var ret = ''
    end = Math.min(buf.length, end)
  
    for (var i = start; i < end; ++i) {
      ret += String.fromCharCode(buf[i])
    }
    return ret
  }
  
  function hexSlice (buf, start, end) {
    var len = buf.length
  
    if (!start || start < 0) start = 0
    if (!end || end < 0 || end > len) end = len
  
    var out = ''
    for (var i = start; i < end; ++i) {
      out += toHex(buf[i])
    }
    return out
  }
  
  function utf16leSlice (buf, start, end) {
    var bytes = buf.slice(start, end)
    var res = ''
    for (var i = 0; i < bytes.length; i += 2) {
      res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
    }
    return res
  }
  
  Buffer.prototype.slice = function slice (start, end) {
    var len = this.length
    start = ~~start
    end = end === undefined ? len : ~~end
  
    if (start < 0) {
      start += len
      if (start < 0) start = 0
    } else if (start > len) {
      start = len
    }
  
    if (end < 0) {
      end += len
      if (end < 0) end = 0
    } else if (end > len) {
      end = len
    }
  
    if (end < start) end = start
  
    var newBuf
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      newBuf = this.subarray(start, end)
      newBuf.__proto__ = Buffer.prototype
    } else {
      var sliceLen = end - start
      newBuf = new Buffer(sliceLen, undefined)
      for (var i = 0; i < sliceLen; ++i) {
        newBuf[i] = this[i + start]
      }
    }
  
    return newBuf
  }
  
  /*
   * Need to make sure that buffer isn't trying to write out of bounds.
   */
  function checkOffset (offset, ext, length) {
    if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
    if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  }
  
  Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
    offset = offset | 0
    byteLength = byteLength | 0
    if (!noAssert) checkOffset(offset, byteLength, this.length)
  
    var val = this[offset]
    var mul = 1
    var i = 0
    while (++i < byteLength && (mul *= 0x100)) {
      val += this[offset + i] * mul
    }
  
    return val
  }
  
  Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
    offset = offset | 0
    byteLength = byteLength | 0
    if (!noAssert) {
      checkOffset(offset, byteLength, this.length)
    }
  
    var val = this[offset + --byteLength]
    var mul = 1
    while (byteLength > 0 && (mul *= 0x100)) {
      val += this[offset + --byteLength] * mul
    }
  
    return val
  }
  
  Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 1, this.length)
    return this[offset]
  }
  
  Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length)
    return this[offset] | (this[offset + 1] << 8)
  }
  
  Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length)
    return (this[offset] << 8) | this[offset + 1]
  }
  
  Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length)
  
    return ((this[offset]) |
        (this[offset + 1] << 8) |
        (this[offset + 2] << 16)) +
        (this[offset + 3] * 0x1000000)
  }
  
  Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length)
  
    return (this[offset] * 0x1000000) +
      ((this[offset + 1] << 16) |
      (this[offset + 2] << 8) |
      this[offset + 3])
  }
  
  Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
    offset = offset | 0
    byteLength = byteLength | 0
    if (!noAssert) checkOffset(offset, byteLength, this.length)
  
    var val = this[offset]
    var mul = 1
    var i = 0
    while (++i < byteLength && (mul *= 0x100)) {
      val += this[offset + i] * mul
    }
    mul *= 0x80
  
    if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  
    return val
  }
  
  Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
    offset = offset | 0
    byteLength = byteLength | 0
    if (!noAssert) checkOffset(offset, byteLength, this.length)
  
    var i = byteLength
    var mul = 1
    var val = this[offset + --i]
    while (i > 0 && (mul *= 0x100)) {
      val += this[offset + --i] * mul
    }
    mul *= 0x80
  
    if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  
    return val
  }
  
  Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 1, this.length)
    if (!(this[offset] & 0x80)) return (this[offset])
    return ((0xff - this[offset] + 1) * -1)
  }
  
  Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length)
    var val = this[offset] | (this[offset + 1] << 8)
    return (val & 0x8000) ? val | 0xFFFF0000 : val
  }
  
  Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length)
    var val = this[offset + 1] | (this[offset] << 8)
    return (val & 0x8000) ? val | 0xFFFF0000 : val
  }
  
  Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length)
  
    return (this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16) |
      (this[offset + 3] << 24)
  }
  
  Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length)
  
    return (this[offset] << 24) |
      (this[offset + 1] << 16) |
      (this[offset + 2] << 8) |
      (this[offset + 3])
  }
  
  Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length)
    return ieee754.read(this, offset, true, 23, 4)
  }
  
  Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length)
    return ieee754.read(this, offset, false, 23, 4)
  }
  
  Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 8, this.length)
    return ieee754.read(this, offset, true, 52, 8)
  }
  
  Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 8, this.length)
    return ieee754.read(this, offset, false, 52, 8)
  }
  
  function checkInt (buf, value, offset, ext, max, min) {
    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) {
      var maxBytes = Math.pow(2, 8 * byteLength) - 1
      checkInt(this, value, offset, byteLength, maxBytes, 0)
    }
  
    var mul = 1
    var i = 0
    this[offset] = value & 0xFF
    while (++i < byteLength && (mul *= 0x100)) {
      this[offset + i] = (value / mul) & 0xFF
    }
  
    return offset + byteLength
  }
  
  Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
    value = +value
    offset = offset | 0
    byteLength = 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
    this[offset + i] = value & 0xFF
    while (--i >= 0 && (mul *= 0x100)) {
      this[offset + i] = (value / mul) & 0xFF
    }
  
    return offset + byteLength
  }
  
  Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
    if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
    this[offset] = (value & 0xff)
    return offset + 1
  }
  
  function objectWriteUInt16 (buf, value, offset, littleEndian) {
    if (value < 0) value = 0xffff + value + 1
    for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
      buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
        (littleEndian ? i : 1 - i) * 8
    }
  }
  
  Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value & 0xff)
      this[offset + 1] = (value >>> 8)
    } else {
      objectWriteUInt16(this, value, offset, true)
    }
    return offset + 2
  }
  
  Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 8)
      this[offset + 1] = (value & 0xff)
    } else {
      objectWriteUInt16(this, value, offset, false)
    }
    return offset + 2
  }
  
  function objectWriteUInt32 (buf, value, offset, littleEndian) {
    if (value < 0) value = 0xffffffff + value + 1
    for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
      buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
    }
  }
  
  Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset + 3] = (value >>> 24)
      this[offset + 2] = (value >>> 16)
      this[offset + 1] = (value >>> 8)
      this[offset] = (value & 0xff)
    } else {
      objectWriteUInt32(this, value, offset, true)
    }
    return offset + 4
  }
  
  Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 24)
      this[offset + 1] = (value >>> 16)
      this[offset + 2] = (value >>> 8)
      this[offset + 3] = (value & 0xff)
    } else {
      objectWriteUInt32(this, value, offset, false)
    }
    return offset + 4
  }
  
  Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) {
      var limit = Math.pow(2, 8 * byteLength - 1)
  
      checkInt(this, value, offset, byteLength, limit - 1, -limit)
    }
  
    var i = 0
    var mul = 1
    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
    }
  
    return offset + byteLength
  }
  
  Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) {
      var limit = Math.pow(2, 8 * byteLength - 1)
  
      checkInt(this, value, offset, byteLength, limit - 1, -limit)
    }
  
    var i = byteLength - 1
    var mul = 1
    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
    }
  
    return offset + byteLength
  }
  
  Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    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 & 0xff)
    return offset + 1
  }
  
  Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value & 0xff)
      this[offset + 1] = (value >>> 8)
    } else {
      objectWriteUInt16(this, value, offset, true)
    }
    return offset + 2
  }
  
  Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 8)
      this[offset + 1] = (value & 0xff)
    } else {
      objectWriteUInt16(this, value, offset, false)
    }
    return offset + 2
  }
  
  Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value & 0xff)
      this[offset + 1] = (value >>> 8)
      this[offset + 2] = (value >>> 16)
      this[offset + 3] = (value >>> 24)
    } else {
      objectWriteUInt32(this, value, offset, true)
    }
    return offset + 4
  }
  
  Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
    value = +value
    offset = offset | 0
    if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
    if (value < 0) value = 0xffffffff + value + 1
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 24)
      this[offset + 1] = (value >>> 16)
      this[offset + 2] = (value >>> 8)
      this[offset + 3] = (value & 0xff)
    } else {
      objectWriteUInt32(this, value, offset, false)
    }
    return offset + 4
  }
  
  function checkIEEE754 (buf, value, offset, ext, max, min) {
    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) {
    if (!noAssert) {
      checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
    }
    ieee754.write(buf, value, offset, littleEndian, 23, 4)
    return offset + 4
  }
  
  Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
    return writeFloat(this, value, offset, true, noAssert)
  }
  
  Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
    return writeFloat(this, value, offset, false, noAssert)
  }
  
  function writeDouble (buf, value, offset, littleEndian, noAssert) {
    if (!noAssert) {
      checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
    }
    ieee754.write(buf, value, offset, littleEndian, 52, 8)
    return offset + 8
  }
  
  Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
    return writeDouble(this, value, offset, true, noAssert)
  }
  
  Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
    return writeDouble(this, value, offset, false, noAssert)
  }
  
  // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  Buffer.prototype.copy = function copy (target, targetStart, start, end) {
    if (!start) start = 0
    if (!end && end !== 0) end = this.length
    if (targetStart >= target.length) targetStart = target.length
    if (!targetStart) targetStart = 0
    if (end > 0 && end < start) end = start
  
    // Copy 0 bytes; we're done
    if (end === start) return 0
    if (target.length === 0 || this.length === 0) return 0
  
    // Fatal error conditions
    if (targetStart < 0) {
      throw new RangeError('targetStart out of bounds')
    }
    if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
    if (end < 0) throw new RangeError('sourceEnd out of bounds')
  
    // Are we oob?
    if (end > this.length) end = this.length
    if (target.length - targetStart < end - start) {
      end = target.length - targetStart + start
    }
  
    var len = end - start
    var i
  
    if (this === target && start < targetStart && targetStart < end) {
      // descending copy from end
      for (i = len - 1; i >= 0; --i) {
        target[i + targetStart] = this[i + start]
      }
    } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
      // ascending copy from start
      for (i = 0; i < len; ++i) {
        target[i + targetStart] = this[i + start]
      }
    } else {
      Uint8Array.prototype.set.call(
        target,
        this.subarray(start, start + len),
        targetStart
      )
    }
  
    return len
  }
  
  // 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
    }
  
    // 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')
    }
  
    if (end <= start) {
      return this
    }
  
    start = start >>> 0
    end = end === undefined ? this.length : end >>> 0
  
    if (!val) val = 0
  
    var i
    if (typeof val === 'number') {
      for (i = start; i < end; ++i) {
        this[i] = val
      }
    } else {
      var bytes = Buffer.isBuffer(val)
        ? val
        : utf8ToBytes(new Buffer(val, encoding).toString())
      var len = bytes.length
      for (i = 0; i < end - start; ++i) {
        this[i + start] = bytes[i % len]
      }
    }
  
    return this
  }
  
  // HELPER FUNCTIONS
  // ================
  
  var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  
  function base64clean (str) {
    // Node strips out invalid characters like \n and \t from the string, base64-js does not
    str = stringtrim(str).replace(INVALID_BASE64_RE, '')
    // Node converts strings with length < 2 to ''
    if (str.length < 2) return ''
    // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
    while (str.length % 4 !== 0) {
      str = str + '='
    }
    return str
  }
  
  function stringtrim (str) {
    if (str.trim) return str.trim()
    return str.replace(/^\s+|\s+$/g, '')
  }
  
  function toHex (n) {
    if (n < 16) return '0' + n.toString(16)
    return n.toString(16)
  }
  
  function utf8ToBytes (string, units) {
    units = units || Infinity
    var codePoint
    var length = string.length
    var leadSurrogate = null
    var bytes = []
  
    for (var i = 0; i < length; ++i) {
      codePoint = string.charCodeAt(i)
  
      // is surrogate component
      if (codePoint > 0xD7FF && codePoint < 0xE000) {
        // last char was a lead
        if (!leadSurrogate) {
          // no lead yet
          if (codePoint > 0xDBFF) {
            // unexpected trail
            if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
            continue
          } else if (i + 1 === length) {
            // unpaired lead
            if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
            continue
          }
  
          // valid lead
          leadSurrogate = codePoint
  
          continue
        }
  
        // 2 leads in a row
        if (codePoint < 0xDC00) {
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          leadSurrogate = codePoint
          continue
        }
  
        // valid surrogate pair
        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)
      }
  
      leadSurrogate = null
  
      // encode utf8
      if (codePoint < 0x80) {
        if ((units -= 1) < 0) break
        bytes.push(codePoint)
      } else if (codePoint < 0x800) {
        if ((units -= 2) < 0) break
        bytes.push(
          codePoint >> 0x6 | 0xC0,
          codePoint & 0x3F | 0x80
        )
      } else if (codePoint < 0x10000) {
        if ((units -= 3) < 0) break
        bytes.push(
          codePoint >> 0xC | 0xE0,
          codePoint >> 0x6 & 0x3F | 0x80,
          codePoint & 0x3F | 0x80
        )
      } else if (codePoint < 0x110000) {
        if ((units -= 4) < 0) break
        bytes.push(
          codePoint >> 0x12 | 0xF0,
          codePoint >> 0xC & 0x3F | 0x80,
          codePoint >> 0x6 & 0x3F | 0x80,
          codePoint & 0x3F | 0x80
        )
      } else {
        throw new Error('Invalid code point')
      }
    }
  
    return bytes
  }
  
  function asciiToBytes (str) {
    var byteArray = []
    for (var i = 0; i < str.length; ++i) {
      // Node's code seems to be doing this and not & 0x7F..
      byteArray.push(str.charCodeAt(i) & 0xFF)
    }
    return byteArray
  }
  
  function utf16leToBytes (str, units) {
    var c, hi, lo
    var byteArray = []
    for (var i = 0; i < str.length; ++i) {
      if ((units -= 2) < 0) break
  
      c = str.charCodeAt(i)
      hi = c >> 8
      lo = c % 256
      byteArray.push(lo)
      byteArray.push(hi)
    }
  
    return byteArray
  }
  
  function base64ToBytes (str) {
    return base64.toByteArray(base64clean(str))
  }
  
  function blitBuffer (src, dst, offset, length) {
    for (var i = 0; i < length; ++i) {
      if ((i + offset >= dst.length) || (i >= src.length)) break
      dst[i + offset] = src[i]
    }
    return i
  }
  
  function isnan (val) {
    return val !== val // eslint-disable-line no-self-compare
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
  
  /***/ }),
  /* 1 */
  /***/ (function(module, exports, __webpack_require__) {
  
  // 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 = __webpack_require__(11).EventEmitter;
  var inherits = __webpack_require__(2);
  
  inherits(Stream, EE);
  Stream.Readable = __webpack_require__(7);
  Stream.Writable = __webpack_require__(54);
  Stream.Duplex = __webpack_require__(55);
  Stream.Transform = __webpack_require__(56);
  Stream.PassThrough = __webpack_require__(57);
  
  // 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;
  };
  
  
  /***/ }),
  /* 2 */
  /***/ (function(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
    }
  }
  
  
  /***/ }),
  /* 3 */
  /***/ (function(module, exports) {
  
  // shim for using process in browser
  var process = module.exports = {};
  
  // cached from whatever global is present so that test runners that stub it
  // don't break things.  But we need to wrap it in a try catch in case it is
  // wrapped in strict mode code which doesn't define any globals.  It's inside a
  // function because try/catches deoptimize in certain engines.
  
  var cachedSetTimeout;
  var cachedClearTimeout;
  
  function defaultSetTimout() {
      throw new Error('setTimeout has not been defined');
  }
  function defaultClearTimeout () {
      throw new Error('clearTimeout has not been defined');
  }
  (function () {
      try {
          if (typeof setTimeout === 'function') {
              cachedSetTimeout = setTimeout;
          } else {
              cachedSetTimeout = defaultSetTimout;
          }
      } catch (e) {
          cachedSetTimeout = defaultSetTimout;
      }
      try {
          if (typeof clearTimeout === 'function') {
              cachedClearTimeout = clearTimeout;
          } else {
              cachedClearTimeout = defaultClearTimeout;
          }
      } catch (e) {
          cachedClearTimeout = defaultClearTimeout;
      }
  } ())
  function runTimeout(fun) {
      if (cachedSetTimeout === setTimeout) {
          //normal enviroments in sane situations
          return setTimeout(fun, 0);
      }
      // if setTimeout wasn't available but was latter defined
      if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
          cachedSetTimeout = setTimeout;
          return setTimeout(fun, 0);
      }
      try {
          // when when somebody has screwed with setTimeout but no I.E. maddness
          return cachedSetTimeout(fun, 0);
      } catch(e){
          try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
              return cachedSetTimeout.call(null, fun, 0);
          } catch(e){
              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
              return cachedSetTimeout.call(this, fun, 0);
          }
      }
  
  
  }
  function runClearTimeout(marker) {
      if (cachedClearTimeout === clearTimeout) {
          //normal enviroments in sane situations
          return clearTimeout(marker);
      }
      // if clearTimeout wasn't available but was latter defined
      if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
          cachedClearTimeout = clearTimeout;
          return clearTimeout(marker);
      }
      try {
          // when when somebody has screwed with setTimeout but no I.E. maddness
          return cachedClearTimeout(marker);
      } catch (e){
          try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
              return cachedClearTimeout.call(null, marker);
          } catch (e){
              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
              // Some versions of I.E. have different rules for clearTimeout vs setTimeout
              return cachedClearTimeout.call(this, marker);
          }
      }
  
  
  
  }
  var queue = [];
  var draining = false;
  var currentQueue;
  var queueIndex = -1;
  
  function cleanUpNextTick() {
      if (!draining || !currentQueue) {
          return;
      }
      draining = false;
      if (currentQueue.length) {
          queue = currentQueue.concat(queue);
      } else {
          queueIndex = -1;
      }
      if (queue.length) {
          drainQueue();
      }
  }
  
  function drainQueue() {
      if (draining) {
          return;
      }
      var timeout = runTimeout(cleanUpNextTick);
      draining = true;
  
      var len = queue.length;
      while(len) {
          currentQueue = queue;
          queue = [];
          while (++queueIndex < len) {
              if (currentQueue) {
                  currentQueue[queueIndex].run();
              }
          }
          queueIndex = -1;
          len = queue.length;
      }
      currentQueue = null;
      draining = false;
      runClearTimeout(timeout);
  }
  
  process.nextTick = function (fun) {
      var args = new Array(arguments.length - 1);
      if (arguments.length > 1) {
          for (var i = 1; i < arguments.length; i++) {
              args[i - 1] = arguments[i];
          }
      }
      queue.push(new Item(fun, args));
      if (queue.length === 1 && !draining) {
          runTimeout(drainQueue);
      }
  };
  
  // v8 likes predictible objects
  function Item(fun, array) {
      this.fun = fun;
      this.array = array;
  }
  Item.prototype.run = function () {
      this.fun.apply(null, this.array);
  };
  process.title = 'browser';
  process.browser = true;
  process.env = {};
  process.argv = [];
  process.version = ''; // empty string to avoid regexp issues
  process.versions = {};
  
  function noop() {}
  
  process.on = noop;
  process.addListener = noop;
  process.once = noop;
  process.off = noop;
  process.removeListener = noop;
  process.removeAllListeners = noop;
  process.emit = noop;
  
  process.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; };
  
  
  /***/ }),
  /* 4 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global, 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.
  
  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 = __webpack_require__(58);
  
  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 = __webpack_require__(59);
  
  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);
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(3)))
  
  /***/ }),
  /* 5 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  // 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.
  
  
  
  /*<replacement>*/
  
  var objectKeys = Object.keys || function (obj) {
    var keys = [];
    for (var key in obj) {
      keys.push(key);
    }return keys;
  };
  /*</replacement>*/
  
  module.exports = Duplex;
  
  /*<replacement>*/
  var processNextTick = __webpack_require__(12);
  /*</replacement>*/
  
  /*<replacement>*/
  var util = __webpack_require__(8);
  util.inherits = __webpack_require__(2);
  /*</replacement>*/
  
  var Readable = __webpack_require__(27);
  var Writable = __webpack_require__(14);
  
  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);
    }
  }
  
  /***/ }),
  /* 6 */
  /***/ (function(module, exports) {
  
  var g;
  
  // This works in non-strict mode
  g = (function() {
  	return this;
  })();
  
  try {
  	// This works if eval is allowed (see CSP)
  	g = g || Function("return this")() || (1,eval)("this");
  } catch(e) {
  	// This works if the window reference is available
  	if(typeof window === "object")
  		g = window;
  }
  
  // g can still be undefined, but nothing to do about it...
  // We return undefined, instead of nothing here, so it's
  // easier to handle this case. if(!global) { ...}
  
  module.exports = g;
  
  
  /***/ }),
  /* 7 */
  /***/ (function(module, exports, __webpack_require__) {
  
  exports = module.exports = __webpack_require__(27);
  exports.Stream = exports;
  exports.Readable = exports;
  exports.Writable = __webpack_require__(14);
  exports.Duplex = __webpack_require__(5);
  exports.Transform = __webpack_require__(30);
  exports.PassThrough = __webpack_require__(53);
  
  
  /***/ }),
  /* 8 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {// 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.
  
  // NOTE: These type checking functions intentionally don't use `instanceof`
  // because it is fragile and can be easily faked with `Object.create()`.
  
  function isArray(arg) {
    if (Array.isArray) {
      return Array.isArray(arg);
    }
    return objectToString(arg) === '[object Array]';
  }
  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 objectToString(re) === '[object RegExp]';
  }
  exports.isRegExp = isRegExp;
  
  function isObject(arg) {
    return typeof arg === 'object' && arg !== null;
  }
  exports.isObject = isObject;
  
  function isDate(d) {
    return objectToString(d) === '[object Date]';
  }
  exports.isDate = isDate;
  
  function isError(e) {
    return (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 = Buffer.isBuffer;
  
  function objectToString(o) {
    return Object.prototype.toString.call(o);
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 9 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(Buffer) {
  
  /**
   * Helper method that can be bound to a stream - it sets the output to utf-8, captures all of the results, and returns a promise that resolves to the final text.
   * Essentially a smaller version of concat-stream wrapped in a promise
   *
   * @param {Stream} [stream=] optional stream param for when not bound to an existing stream instance
   * @return {Promise}
   */
  module.exports = function promise(stream) {
    stream = stream || this;
    return new Promise(function(resolve, reject) {
      var results = [];
      stream
        .on('data', function(result) {
          results.push(result);
        })
        .on('end', function() {
          resolve(Buffer.isBuffer(results[0]) ? Buffer.concat(results).toString() : results);
        })
        .on('error', reject);
    });
  };
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 10 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var clone = __webpack_require__(78);
  
  module.exports = function(options, defaults) {
    options = options || {};
  
    Object.keys(defaults).forEach(function(key) {
      if (typeof options[key] === 'undefined') {
        options[key] = clone(defaults[key]);
      }
    });
  
    return options;
  };
  
  /***/ }),
  /* 11 */
  /***/ (function(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
        } else {
          // At least give some kind of context to the user
          var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
          err.context = er;
          throw err;
        }
      }
    }
  
    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;
  }
  
  
  /***/ }),
  /* 12 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(process) {
  
  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');
    }
    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);
      });
    }
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  
  /***/ }),
  /* 13 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(global) {
  
  var buffer = __webpack_require__(0);
  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);
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
  
  /***/ }),
  /* 14 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(process, setImmediate) {// A bit simpler than readable streams.
  // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  // the drain event emission and buffering.
  
  
  
  module.exports = Writable;
  
  /*<replacement>*/
  var processNextTick = __webpack_require__(12);
  /*</replacement>*/
  
  /*<replacement>*/
  var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
  /*</replacement>*/
  
  /*<replacement>*/
  var Duplex;
  /*</replacement>*/
  
  Writable.WritableState = WritableState;
  
  /*<replacement>*/
  var util = __webpack_require__(8);
  util.inherits = __webpack_require__(2);
  /*</replacement>*/
  
  /*<replacement>*/
  var internalUtil = {
    deprecate: __webpack_require__(52)
  };
  /*</replacement>*/
  
  /*<replacement>*/
  var Stream = __webpack_require__(28);
  /*</replacement>*/
  
  var Buffer = __webpack_require__(0).Buffer;
  /*<replacement>*/
  var bufferShim = __webpack_require__(13);
  /*</replacement>*/
  
  util.inherits(Writable, Stream);
  
  function nop() {}
  
  function WriteReq(chunk, encoding, cb) {
    this.chunk = chunk;
    this.encoding = encoding;
    this.callback = cb;
    this.next = null;
  }
  
  function WritableState(options, stream) {
    Duplex = Duplex || __webpack_require__(5);
  
    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;
  
    // drain event flag.
    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 getBuffer() {
    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 (_) {}
  })();
  
  // Test _writableState for inheritance to account for Duplex streams,
  // whose prototype chain only points to Readable.
  var realHasInstance;
  if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
    realHasInstance = Function.prototype[Symbol.hasInstance];
    Object.defineProperty(Writable, Symbol.hasInstance, {
      value: function (object) {
        if (realHasInstance.call(this, object)) return true;
  
        return object && object._writableState instanceof WritableState;
      }
    });
  } else {
    realHasInstance = function (object) {
      return object instanceof this;
    };
  }
  
  function Writable(options) {
    Duplex = Duplex || __webpack_require__(5);
  
    // Writable ctor is applied to Duplexes, too.
    // `realHasInstance` is necessary because using plain `instanceof`
    // would return false, as no `_writableState` property is attached.
  
    // Trying to use the custom `instanceof` for Writable here will also break the
    // Node.js LazyTransform implementation, which has a non-trivial getter for
    // `_writableState` that would lead to infinite recursion.
    if (!realHasInstance.call(Writable, this) && !(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);
  }
  
  // Checks that a user-supplied chunk is valid, especially for the particular
  // mode the stream is in. Currently this means that `null` is never accepted
  // and undefined/non-string values are only allowed in object mode.
  function validChunk(stream, state, chunk, cb) {
    var valid = true;
    var er = false;
  
    if (chunk === null) {
      er = new TypeError('May not write null values to stream');
    } else if (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;
    var isBuf = Buffer.isBuffer(chunk);
  
    if (typeof encoding === 'function') {
      cb = encoding;
      encoding = null;
    }
  
    if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  
    if (typeof cb !== 'function') cb = nop;
  
    if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
      state.pendingcb++;
      ret = writeOrBuffer(this, state, isBuf, 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;
  };
  
  function decodeChunk(state, chunk, encoding) {
    if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
      chunk = bufferShim.from(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, isBuf, chunk, encoding, cb) {
    if (!isBuf) {
      chunk = decodeChunk(state, chunk, encoding);
      if (Buffer.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) {
      var last = state.lastBufferedRequest;
      state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
      if (last) {
        last.next = state.lastBufferedRequest;
      } else {
        state.bufferedRequest = state.lastBufferedRequest;
      }
      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) {
        /*<replacement>*/
        asyncWrite(afterWrite, stream, state, finished, cb);
        /*</replacement>*/
      } 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('_write() is not implemented'));
  };
  
  Writable.prototype._writev = null;
  
  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;
      }
    };
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(50).setImmediate))
  
  /***/ }),
  /* 15 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {var isArrayBuffer = __webpack_require__(60)
  
  var isModern = (
    typeof Buffer.alloc === 'function' &&
    typeof Buffer.allocUnsafe === 'function' &&
    typeof Buffer.from === 'function'
  )
  
  function fromArrayBuffer (obj, byteOffset, length) {
    byteOffset >>>= 0
  
    var maxLength = obj.byteLength - byteOffset
  
    if (maxLength < 0) {
      throw new RangeError("'offset' is out of bounds")
    }
  
    if (length === undefined) {
      length = maxLength
    } else {
      length >>>= 0
  
      if (length > maxLength) {
        throw new RangeError("'length' is out of bounds")
      }
    }
  
    return isModern
      ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
      : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
  }
  
  function fromString (string, encoding) {
    if (typeof encoding !== 'string' || encoding === '') {
      encoding = 'utf8'
    }
  
    if (!Buffer.isEncoding(encoding)) {
      throw new TypeError('"encoding" must be a valid string encoding')
    }
  
    return isModern
      ? Buffer.from(string, encoding)
      : new Buffer(string, encoding)
  }
  
  function bufferFrom (value, encodingOrOffset, length) {
    if (typeof value === 'number') {
      throw new TypeError('"value" argument must not be a number')
    }
  
    if (isArrayBuffer(value)) {
      return fromArrayBuffer(value, encodingOrOffset, length)
    }
  
    if (typeof value === 'string') {
      return fromString(value, encodingOrOffset)
    }
  
    return isModern
      ? Buffer.from(value)
      : new Buffer(value)
  }
  
  module.exports = bufferFrom
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 16 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file List of ECMAScript5 white space characters.
   * @version 2.0.2
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module white-space-x
   */
  
  
  
  /**
   * An array of the ES5 whitespace char codes, string, and their descriptions.
   *
   * @name list
   * @type Array.<Object>
   * @example
   * var whiteSpace = require('white-space-x');
   * whiteSpaces.list.foreach(function (item) {
   *   console.log(lib.description, item.code, item.string);
   * });
   */
  var list = [
    {
      code: 0x0009,
      description: 'Tab',
      string: '\u0009'
    },
    {
      code: 0x000a,
      description: 'Line Feed',
      string: '\u000a'
    },
    {
      code: 0x000b,
      description: 'Vertical Tab',
      string: '\u000b'
    },
    {
      code: 0x000c,
      description: 'Form Feed',
      string: '\u000c'
    },
    {
      code: 0x000d,
      description: 'Carriage Return',
      string: '\u000d'
    },
    {
      code: 0x0020,
      description: 'Space',
      string: '\u0020'
    },
    /*
    {
      code: 0x0085,
      description: 'Next line - Not ES5 whitespace',
      string: '\u0085'
    }
    */
    {
      code: 0x00a0,
      description: 'No-break space',
      string: '\u00a0'
    },
    {
      code: 0x1680,
      description: 'Ogham space mark',
      string: '\u1680'
    },
    {
      code: 0x180e,
      description: 'Mongolian vowel separator',
      string: '\u180e'
    },
    {
      code: 0x2000,
      description: 'En quad',
      string: '\u2000'
    },
    {
      code: 0x2001,
      description: 'Em quad',
      string: '\u2001'
    },
    {
      code: 0x2002,
      description: 'En space',
      string: '\u2002'
    },
    {
      code: 0x2003,
      description: 'Em space',
      string: '\u2003'
    },
    {
      code: 0x2004,
      description: 'Three-per-em space',
      string: '\u2004'
    },
    {
      code: 0x2005,
      description: 'Four-per-em space',
      string: '\u2005'
    },
    {
      code: 0x2006,
      description: 'Six-per-em space',
      string: '\u2006'
    },
    {
      code: 0x2007,
      description: 'Figure space',
      string: '\u2007'
    },
    {
      code: 0x2008,
      description: 'Punctuation space',
      string: '\u2008'
    },
    {
      code: 0x2009,
      description: 'Thin space',
      string: '\u2009'
    },
    {
      code: 0x200a,
      description: 'Hair space',
      string: '\u200a'
    },
    /*
    {
      code: 0x200b,
      description: 'Zero width space - Not ES5 whitespace',
      string: '\u200b'
    },
    */
    {
      code: 0x2028,
      description: 'Line separator',
      string: '\u2028'
    },
    {
      code: 0x2029,
      description: 'Paragraph separator',
      string: '\u2029'
    },
    {
      code: 0x202f,
      description: 'Narrow no-break space',
      string: '\u202f'
    },
    {
      code: 0x205f,
      description: 'Medium mathematical space',
      string: '\u205f'
    },
    {
      code: 0x3000,
      description: 'Ideographic space',
      string: '\u3000'
    },
    {
      code: 0xfeff,
      description: 'Byte Order Mark',
      string: '\ufeff'
    }
  ];
  
  var string = '';
  var length = list.length;
  for (var i = 0; i < length; i += 1) {
    string += list[i].string;
  }
  
  /**
   * A string of the ES5 whitespace characters.
   *
   * @name string
   * @type string
   * @example
   * var whiteSpace = require('white-space-x');
   * var characters = [
   *   '\u0009',
   *   '\u000a',
   *   '\u000b',
   *   '\u000c',
   *   '\u000d',
   *   '\u0020',
   *   '\u00a0',
   *   '\u1680',
   *   '\u180e',
   *   '\u2000',
   *   '\u2001',
   *   '\u2002',
   *   '\u2003',
   *   '\u2004',
   *   '\u2005',
   *   '\u2006',
   *   '\u2007',
   *   '\u2008',
   *   '\u2009',
   *   '\u200a',
   *   '\u2028',
   *   '\u2029',
   *   '\u202f',
   *   '\u205f',
   *   '\u3000',
   *   '\ufeff'
   * ];
   * var ws = characters.join('');
   * var re1 = new RegExp('^[' + whiteSpace.string + ']+$)');
   * re1.test(ws); // true
   */
  module.exports = {
    list: list,
    string: string
  };
  
  
  /***/ }),
  /* 17 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(process) {/**
   * Copyright 2014 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  
  var Duplex = __webpack_require__(1).Duplex;
  var util = __webpack_require__(4);
  var pick = __webpack_require__(35);
  var W3CWebSocket = __webpack_require__(74).w3cwebsocket;
  var contentType = __webpack_require__(18);
  var qs = __webpack_require__(36);
  
  var OPENING_MESSAGE_PARAMS_ALLOWED = [
    'inactivity_timeout',
    'timestamps',
    'word_confidence',
    'content-type',
    'interim_results',
    'keywords',
    'keywords_threshold',
    'max_alternatives',
    'word_alternatives_threshold',
    'profanity_filter',
    'smart_formatting',
    'speaker_labels'
  ];
  
  var QUERY_PARAMS_ALLOWED = ['customization_id', 'model', 'watson-token', 'X-Watson-Learning-Opt-Out'];
  
  /**
   * pipe()-able Node.js Duplex stream - accepts binary audio and emits text/objects in it's `data` events.
   *
   * Uses WebSockets under the hood. For audio with no recognizable speech, no `data` events are emitted.
   *
   * By default, only finalized text is emitted in the data events, however when `objectMode`/`readableObjectMode` and `interim_results` are enabled, both interim and final results objects are emitted.
   * WriteableElementStream uses this, for example, to live-update the DOM with word-by-word transcriptions.
   *
   * Note that the WebSocket connection is not established until the first chunk of data is recieved. This allows for auto-detection of content type (for wav/flac/opus audio).
   *
   * @param {Object} options
   * @param {String} [options.model='en-US_BroadbandModel'] - voice model to use. Microphone streaming only supports broadband models.
   * @param {String} [options.url='wss://stream.watsonplatform.net/speech-to-text/api'] base URL for service
   * @param {String} [options.token] - Auth token
   * @param {Object} [options.headers] - Only works in Node.js, not in browsers. Allows for custom headers to be set, including an Authorization header (preventing the need for auth tokens)
   * @param {String} [options.content-type='audio/wav'] - content type of audio; can be automatically determined from file header in most cases. only wav, flac, and ogg/opus are supported
   * @param {Boolean} [options.interim_results=true] - Send back non-final previews of each "sentence" as it is being processed. These results are ignored in text mode.
   * @param {Boolean} [options.word_confidence=false] - include confidence scores with results. Defaults to true when in objectMode.
   * @param {Boolean} [options.timestamps=false] - include timestamps with results. Defaults to true when in objectMode.
   * @param {Number} [options.max_alternatives=1] - maximum number of alternative transcriptions to include. Defaults to 3 when in objectMode.
   * @param {Array<String>} [options.keywords] - a list of keywords to search for in the audio
   * @param {Number} [options.keywords_threshold] - Number between 0 and 1 representing the minimum confidence before including a keyword in the results. Required when options.keywords is set
   * @param {Number} [options.word_alternatives_threshold] - Number between 0 and 1 representing the minimum confidence before including an alternative word in the results. Must be set to enable word alternatives,
   * @param {Boolean} [options.profanity_filter=false] - set to true to filter out profanity and replace the words with *'s
   * @param {Number} [options.inactivity_timeout=30] - how many seconds of silence before automatically closing the stream. use -1 for infinity
   * @param {Boolean} [options.readableObjectMode=false] - emit `result` objects instead of string Buffers for the `data` events. Does not affect input (which must be binary)
   * @param {Boolean} [options.objectMode=false] - alias for options.readableObjectMode
   * @param {Number} [options.X-Watson-Learning-Opt-Out=false] - set to true to opt-out of allowing Watson to use this request to improve it's services
   * @param {Boolean} [options.smart_formatting=false] - formats numeric values such as dates, times, currency, etc.
   * @param {String} [options.customization_id] - Customization ID
   *
   * @constructor
   */
  function RecognizeStream(options) {
    // this stream only supports objectMode on the output side.
    // It must receive binary data input.
    if (options.objectMode) {
      options.readableObjectMode = true;
      delete options.objectMode;
    }
    Duplex.call(this, options);
    this.options = options;
    this.listening = false;
    this.initialized = false;
    this.finished = false;
  
    this.on('newListener', function(event) {
      if (!options.silent) {
        if (event === 'results' || event === 'result' || event === 'speaker_labels') {
          // eslint-disable-next-line no-console
          console.log(
            new Error(
              'Watson Speech to Text RecognizeStream: the ' +
                event +
                ' event was deprecated. ' +
                "Please set {objectMode: true} and listen for the 'data' event instead. " +
                'Pass {silent: true} to disable this message.'
            )
          );
        } else if (event === 'connection-close') {
          // eslint-disable-next-line no-console
          console.log(
            new Error(
              'Watson Speech to Text RecognizeStream: the ' +
                event +
                ' event was deprecated. ' +
                "Please listen for the 'close' event instead. " +
                'Pass {silent: true} to disable this message.'
            )
          );
        } else if (event === 'connect') {
          // eslint-disable-next-line no-console
          console.log(
            new Error(
              'Watson Speech to Text RecognizeStream: the ' +
                event +
                ' event was deprecated. ' +
                "Please listen for the 'open' event instead. " +
                'Pass {silent: true} to disable this message.'
            )
          );
        }
      }
    });
  }
  util.inherits(RecognizeStream, Duplex);
  
  RecognizeStream.WEBSOCKET_CONNECTION_ERROR = 'WebSocket connection error';
  
  RecognizeStream.prototype.initialize = function() {
    var options = this.options;
  
    if (options.token && !options['watson-token']) {
      options['watson-token'] = options.token;
    }
    if (options.content_type && !options['content-type']) {
      options['content-type'] = options.content_type;
    }
    if (options['X-WDC-PL-OPT-OUT'] && !options['X-Watson-Learning-Opt-Out']) {
      options['X-Watson-Learning-Opt-Out'] = options['X-WDC-PL-OPT-OUT'];
    }
  
    var queryParams = util._extend(
      'customization_id' in options ? pick(options, QUERY_PARAMS_ALLOWED) : { model: 'en-US_BroadbandModel' },
      pick(options, QUERY_PARAMS_ALLOWED)
    );
  
    var queryString = qs.stringify(queryParams);
    var url = (options.url || 'wss://stream.watsonplatform.net/speech-to-text/api').replace(/^http/, 'ws') + '/v1/recognize?' + queryString;
  
    var openingMessage = pick(options, OPENING_MESSAGE_PARAMS_ALLOWED);
    openingMessage.action = 'start';
  
    var self = this;
  
    // node params: requestUrl, protocols, origin, headers, extraRequestOptions
    // browser params: requestUrl, protocols (all others ignored)
    var socket = (this.socket = new W3CWebSocket(url, null, null, options.headers, null));
  
    // when the input stops, let the service know that we're done
    self.on('finish', self.finish.bind(self));
  
    /**
     * This can happen if the credentials are invalid - in that case, the response from DataPower doesn't include the
     * necessary CORS headers, so JS can't even read it :(
     *
     * @param {Event} event - event object with essentially no useful information
     */
    socket.onerror = function(event) {
      self.listening = false;
      var err = new Error('WebSocket connection error');
      err.name = RecognizeStream.WEBSOCKET_CONNECTION_ERROR;
      err.event = event;
      self.emit('error', err);
      self.push(null);
    };
  
    this.socket.onopen = function() {
      self.sendJSON(openingMessage);
      /**
       * emitted once the WebSocket connection has been established
       * @event RecognizeStream#open
       */
      self.emit('open');
    };
  
    this.socket.onclose = function(e) {
      // if (self.listening) {
      self.listening = false;
      self.push(null);
      // }
      /**
       * @event RecognizeStream#close
       * @param {Number} reasonCode
       * @param {String} description
       */
      self.emit('close', e.code, e.reason);
    };
  
    /**
     * @event RecognizeStream#error
     * @param {String} msg custom error message
     * @param {*} [frame] unprocessed frame (should have a .data property with either string or binary data)
     * @param {Error} [err]
     */
    function emitError(msg, frame, err) {
      if (err) {
        err.message = msg + ' ' + err.message;
      } else {
        err = new Error(msg);
      }
      err.raw = frame;
      self.emit('error', err);
    }
  
    socket.onmessage = function(frame) {
      if (typeof frame.data !== 'string') {
        return emitError('Unexpected binary data received from server', frame);
      }
  
      var data;
      try {
        data = JSON.parse(frame.data);
      } catch (jsonEx) {
        return emitError('Invalid JSON received from service:', frame, jsonEx);
      }
  
      /**
       * Emit any messages received over the wire, mainly used for debugging.
       *
       * @event RecognizeStream#message
       * @param {Object} message - frame object with a data attribute that's either a string or a Buffer/TypedArray
       * @param {Object} [data] - parsed JSON object (if possible);
       */
      self.emit('message', frame, data);
  
      if (data.error) {
        emitError(data.error, frame);
      } else if (data.state === 'listening') {
        // this is emitted both when the server is ready for audio, and after we send the close message to indicate that it's done processing
        if (self.listening) {
          self.listening = false;
          socket.close();
        } else {
          self.listening = true;
          /**
           * Emitted when the Watson Service indicates readiness to transcribe audio. Any audio sent before this point will be buffered until now.
           * @event RecognizeStream#listening
           */
          self.emit('listening');
        }
      } else {
        if (options.readableObjectMode) {
          /**
           * Object with interim or final results, possibly including confidence scores, alternatives, and word timing.
           * @event RecognizeStream#data
           * @param {Object} data
           */
          self.push(data);
        } else if (Array.isArray(data.results)) {
          data.results.forEach(function(result) {
            if (result.final && result.alternatives) {
              /**
               * Finalized text
               * @event RecognizeStream#data
               * @param {String} transcript
               */
              self.push(result.alternatives[0].transcript, 'utf8');
            }
          });
        }
      }
    };
  
    this.initialized = true;
  };
  
  RecognizeStream.prototype.sendJSON = function sendJSON(msg) {
    /**
     * Emits any JSON object sent to the service from the client. Mainly used for debugging.
     * @event RecognizeStream#send-json
     * @param {Object} msg
     */
    this.emit('send-json', msg);
    return this.socket.send(JSON.stringify(msg));
  };
  
  RecognizeStream.prototype.sendData = function sendData(data) {
    /**
     * Emits any Binary object sent to the service from the client. Mainly used for debugging.
     * @event RecognizeStream#send-data
     * @param {Object} msg
     */
    this.emit('send-data', data);
    return this.socket.send(data);
  };
  
  RecognizeStream.prototype._read = function() /* size*/ {
    // there's no easy way to control reads from the underlying library
    // so, the best we can do here is a no-op
  };
  
  RecognizeStream.ERROR_UNRECOGNIZED_FORMAT = 'UNRECOGNIZED_FORMAT';
  
  RecognizeStream.prototype._write = function(chunk, encoding, callback) {
    var self = this;
    if (self.finished) {
      // can't send any more data after the stop message (although this shouldn't happen normally...)
      return;
    }
    if (!this.initialized) {
      if (!this.options['content-type']) {
        var ct = RecognizeStream.getContentType(chunk);
        if (ct) {
          this.options['content-type'] = ct;
        } else {
          var err = new Error('Unable to determine content-type from file header, please specify manually.');
          err.name = RecognizeStream.ERROR_UNRECOGNIZED_FORMAT;
          this.emit('error', err);
          this.push(null);
          return;
        }
      }
      this.initialize();
  
      this.once('open', function() {
        self.sendData(chunk);
        self.afterSend(callback);
      });
    } else {
      self.sendData(chunk);
      this.afterSend(callback);
    }
  };
  
  /**
   * Flow control - don't ask for more data until we've finished what we have
   *
   * Notes:
   *
   * This limits upload speed to 100 * options.highWaterMark / second.
   *
   * The default highWaterMark is 16kB, so the default max upload speed is ~1.6MB/s.
   *
   * Microphone input provides audio at a (downsampled) rate of:
   *   16000 samples/s * 16-bits * 1 channel = 32kB/s
   * (note the bits to Bytes conversion there)
   *
   * @private
   * @param {Function} next
   */
  RecognizeStream.prototype.afterSend = function afterSend(next) {
    if (this.socket.bufferedAmount <= (this._writableState.highWaterMark || 0)) {
      process.nextTick(next);
    } else {
      setTimeout(this.afterSend.bind(this, next), 10);
    }
  };
  
  /**
   * Prevents any more audio from being sent over the WebSocket and gracefully closes the connection.
   * Additional data may still be emitted up until the `end` event is triggered.
   */
  RecognizeStream.prototype.stop = function() {
    /**
     * Event emitted when the stop method is called. Mainly for synchronising with file reading and playback.
     * @event RecognizeStream#stop
     */
    this.emit('stop');
    this.finish();
  };
  
  RecognizeStream.prototype.finish = function finish() {
    // this is called both when the source stream finishes, and when .stop() is fired, but we only want to send the stop message once.
    if (this.finished) {
      return;
    }
    this.finished = true;
    var self = this;
    var closingMessage = { action: 'stop' };
    if (self.socket && self.socket.readyState === self.socket.OPEN) {
      self.sendJSON(closingMessage);
    } else {
      this.once('open', function() {
        self.sendJSON(closingMessage);
      });
    }
  };
  
  RecognizeStream.prototype.promise = __webpack_require__(9);
  
  RecognizeStream.getContentType = function(buffer) {
    // the substr really shouldn't be necessary, but there's a bug somewhere that can cause buffer.slice(0,4) to return
    // the entire contents of the buffer, so it's a failsafe to catch that
    return contentType.fromHeader(buffer);
  };
  
  module.exports = RecognizeStream;
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  
  /***/ }),
  /* 18 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var extname = __webpack_require__(77).extname;
  
  // This module attempts to identify common content-types based on the filename or header.
  // It is not exhaustive, and for best results, you should always manually specify the content-type option.
  // See the complete list of supported content-types at
  // https://console.bluemix.net/docs/services/speech-to-text/input.html#formats
  
  // *some* file types can be identified by the first 3-4 bytes of the file
  var headerContentTypes = {
    fLaC: 'audio/flac',
    RIFF: 'audio/wav',
    OggS: 'audio/ogg',
    ID3: 'audio/mp3'
  };
  
  /**
   * Takes the beginning of an audio file and returns the associated content-type / mime type
   *
   * @param {Buffer} buffer with at least the first 4 bytes of the file
   * @return {String|undefined} - the contentType of undefined
   */
  exports.fromHeader = function contentTypeFromHeader(buffer) {
    var headerStr = buffer
      .slice(0, 4)
      .toString()
      .substr(0, 4);
    // mp3's are only consistent for the first 3 characters
    return headerContentTypes[headerStr] || headerContentTypes[headerStr.substr(0, 3)];
  };
  
  var filenameContentTypes = {
    '.mp3': 'audio/mp3',
    '.wav': 'audio/wav',
    '.flac': 'audio/flac',
    '.ogg': 'audio/ogg',
    '.oga': 'audio/ogg',
    '.opus': 'audio/ogg; codec=opus',
    '.webm': 'audio/webm'
  };
  
  /**
   * Guess the content type from the filename
   *
   * Note: Blob and File objects include a .type property, but we're ignoring it because it's frequently either
   * incorrect (e.g. video/ogg instead of audio/ogg) or else a different format than what's expected (e.g. audio/x-wav)
   *
   * @param {String|Blob|File} file - string filename or url, or binary File/Blob object
   * @return {String|undefined}
   */
  exports.fromFilename = function contentTypeFromFilename(file) {
    // todo: consider retrying with querystring & hash stripped from URLs
    var ext = extname((typeof file === 'string' && file) || file.name || '');
    return filenameContentTypes[ext];
  };
  
  
  /***/ }),
  /* 19 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var Transform = __webpack_require__(1).Transform;
  var util = __webpack_require__(4);
  var clone = __webpack_require__(20);
  var defaults = __webpack_require__(10);
  
  /**
   * Applies some basic formatting to transcriptions:
   *  - Capitalize the first word of each sentence
   *  - Add a period to the end
   *  - Fix any "cruft" in the transcription
   *  - etc.
   *
   *  May be used as either a Stream, or a standalone helper.
   *
   * @param {Object} opts
   * @param {String} [opts.model] - some models / languages need special handling
   * @param {String} [opts.hesitation=''] - what to put down for a "hesitation" event, also consider \u2026 (ellipsis: ...)
   * @param {Boolean} [options.objectMode=false] - emit `result` objects instead of string Buffers for the `data` events.
   * @constructor
   */
  function FormatStream(opts) {
    this.options = defaults(opts, {
      model: '', // some models should have all spaces removed
      hesitation: '',
      decodeStrings: false // false = don't convert strings to buffers before passing to _write
    });
    Transform.call(this, this.options);
  
    this.isJaCn = this.options.model.substring(0, 5) === 'ja-JP' || this.options.model.substring(0, 5) === 'zh-CN';
    this._transform = this.options.objectMode ? this.transformObject : this.transformString;
  }
  util.inherits(FormatStream, Transform);
  
  var reHesitation = /%HESITATION ?/g; // http://www.ibm.com/watson/developercloud/doc/speech-to-text/output.shtml#hesitation - D_ is handled below
  var reRepeatedCharacter = /([a-z])\1{2,}/gi; // detect the same character repeated three or more times and remove it
  var reDUnderscoreWords = /D_[^\s]+/g; // replace D_(anything)
  
  /**
   * Formats one or more words, removing special symbols, junk, and spacing for some languages
   * @param {String} text
   * @param {Boolean} isFinal
   * @return {String}
   */
  FormatStream.prototype.clean = function clean(text) {
    // clean out "junk"
    text = text
      .replace(reHesitation, this.options.hesitation ? this.options.hesitation.trim() + ' ' : this.options.hesitation)
      .replace(reRepeatedCharacter, '')
      .replace(reDUnderscoreWords, '');
  
    // remove spaces for Japanese and Chinese
    if (this.isJaCn) {
      text = text.replace(/ /g, '');
    }
  
    return text.trim() + ' '; // we want exactly 1 space at the end
  };
  
  /**
   * Capitalizes the first word of a sentence
   * @param {String} text
   * @return {string}
   */
  FormatStream.prototype.capitalize = function capitalize(text) {
    // capitalize first word, returns '' in the case of an empty word
    return text.charAt(0).toUpperCase() + text.substring(1);
  };
  
  /**
   * Puts a period on the end of a sentence
   * @param {String} text
   * @return {string}
   */
  FormatStream.prototype.period = function period(text) {
    text = text.trim();
    // don't put a period down if the clean stage remove all of the text
    if (!text) {
      return ' ';
    }
    // just add a space if the sentence ends in an ellipse
    if (text.substr(-1) === '\u2026') {
      return text + ' ';
    }
    return text + (this.isJaCn ? '。' : '. ');
  };
  
  FormatStream.prototype.transformString = function(chunk, encoding, next) {
    this.push(this.formatString(chunk.toString()));
    next();
  };
  
  FormatStream.prototype.transformObject = function formatResult(result, encoding, next) {
    this.push(this.formatResult(result));
    next();
  };
  
  /**
   * Formats a single string result.
   *
   * May be used outside of Node.js streams
   *
   * @param {String} str - text to format
   * @param {bool} [isInterim=false] - set to true to prevent adding a period to the end of the sentence
   * @return {String}
   */
  FormatStream.prototype.formatString = function(str, isInterim) {
    str = this.capitalize(this.clean(str));
    return isInterim ? str : this.period(str);
  };
  
  /**
   * Creates a new result with all transcriptions formatted
   *
   * May be used outside of Node.js streams
   *
   * @param {Object} data
   * @return {Object}
   */
  FormatStream.prototype.formatResult = function formatResult(data) {
    data = clone(data);
    if (Array.isArray(data.results)) {
      data.results.forEach(function(result, i) {
        // if there are multiple interim results (as produced by the speaker stream),
        // treat the text as final in all but the last result
        var textFinal = result.final || i !== data.results.length - 1;
  
        result.alternatives = result.alternatives.map(function(alt) {
          alt.transcript = this.formatString(alt.transcript, !textFinal);
          if (alt.timestamps) {
            alt.timestamps = alt.timestamps
              .map(function(ts, j, arr) {
                // timestamps is an array of arrays, each sub-array is in the form ["word", startTime, endTime]'
                ts[0] = this.clean(ts[0]);
                if (j === 0) {
                  ts[0] = this.capitalize(ts[0]);
                }
  
                if (j === arr.length - 1 && textFinal) {
                  ts[0] = this.period(ts[0]);
                }
                return ts;
              }, this)
              .filter(function(ts) {
                return ts[0]; // remove any timestamps without a word (due to cleaning out junk words)
              });
          }
          return alt;
        }, this);
      }, this);
    }
    return data;
  };
  
  FormatStream.prototype.promise = __webpack_require__(9);
  
  module.exports = FormatStream;
  
  
  /***/ }),
  /* 20 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {var clone = (function() {
  'use strict';
  
  function _instanceof(obj, type) {
    return type != null && obj instanceof type;
  }
  
  var nativeMap;
  try {
    nativeMap = Map;
  } catch(_) {
    // maybe a reference error because no `Map`. Give it a dummy value that no
    // value will ever be an instanceof.
    nativeMap = function() {};
  }
  
  var nativeSet;
  try {
    nativeSet = Set;
  } catch(_) {
    nativeSet = function() {};
  }
  
  var nativePromise;
  try {
    nativePromise = Promise;
  } catch(_) {
    nativePromise = function() {};
  }
  
  /**
   * Clones (copies) an Object using deep copying.
   *
   * This function supports circular references by default, but if you are certain
   * there are no circular references in your object, you can save some CPU time
   * by calling clone(obj, false).
   *
   * Caution: if `circular` is false and `parent` contains circular references,
   * your program may enter an infinite loop and crash.
   *
   * @param `parent` - the object to be cloned
   * @param `circular` - set to true if the object to be cloned may contain
   *    circular references. (optional - true by default)
   * @param `depth` - set to a number if the object is only to be cloned to
   *    a particular depth. (optional - defaults to Infinity)
   * @param `prototype` - sets the prototype to be used when cloning an object.
   *    (optional - defaults to parent prototype).
   * @param `includeNonEnumerable` - set to true if the non-enumerable properties
   *    should be cloned as well. Non-enumerable properties on the prototype
   *    chain will be ignored. (optional - false by default)
  */
  function clone(parent, circular, depth, prototype, includeNonEnumerable) {
    if (typeof circular === 'object') {
      depth = circular.depth;
      prototype = circular.prototype;
      includeNonEnumerable = circular.includeNonEnumerable;
      circular = circular.circular;
    }
    // maintain two arrays for circular references, where corresponding parents
    // and children have the same index
    var allParents = [];
    var allChildren = [];
  
    var useBuffer = typeof Buffer != 'undefined';
  
    if (typeof circular == 'undefined')
      circular = true;
  
    if (typeof depth == 'undefined')
      depth = Infinity;
  
    // recurse this function so we don't reset allParents and allChildren
    function _clone(parent, depth) {
      // cloning null always returns null
      if (parent === null)
        return null;
  
      if (depth === 0)
        return parent;
  
      var child;
      var proto;
      if (typeof parent != 'object') {
        return parent;
      }
  
      if (_instanceof(parent, nativeMap)) {
        child = new nativeMap();
      } else if (_instanceof(parent, nativeSet)) {
        child = new nativeSet();
      } else if (_instanceof(parent, nativePromise)) {
        child = new nativePromise(function (resolve, reject) {
          parent.then(function(value) {
            resolve(_clone(value, depth - 1));
          }, function(err) {
            reject(_clone(err, depth - 1));
          });
        });
      } else if (clone.__isArray(parent)) {
        child = [];
      } else if (clone.__isRegExp(parent)) {
        child = new RegExp(parent.source, __getRegExpFlags(parent));
        if (parent.lastIndex) child.lastIndex = parent.lastIndex;
      } else if (clone.__isDate(parent)) {
        child = new Date(parent.getTime());
      } else if (useBuffer && Buffer.isBuffer(parent)) {
        child = new Buffer(parent.length);
        parent.copy(child);
        return child;
      } else if (_instanceof(parent, Error)) {
        child = Object.create(parent);
      } else {
        if (typeof prototype == 'undefined') {
          proto = Object.getPrototypeOf(parent);
          child = Object.create(proto);
        }
        else {
          child = Object.create(prototype);
          proto = prototype;
        }
      }
  
      if (circular) {
        var index = allParents.indexOf(parent);
  
        if (index != -1) {
          return allChildren[index];
        }
        allParents.push(parent);
        allChildren.push(child);
      }
  
      if (_instanceof(parent, nativeMap)) {
        parent.forEach(function(value, key) {
          var keyChild = _clone(key, depth - 1);
          var valueChild = _clone(value, depth - 1);
          child.set(keyChild, valueChild);
        });
      }
      if (_instanceof(parent, nativeSet)) {
        parent.forEach(function(value) {
          var entryChild = _clone(value, depth - 1);
          child.add(entryChild);
        });
      }
  
      for (var i in parent) {
        var attrs;
        if (proto) {
          attrs = Object.getOwnPropertyDescriptor(proto, i);
        }
  
        if (attrs && attrs.set == null) {
          continue;
        }
        child[i] = _clone(parent[i], depth - 1);
      }
  
      if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(parent);
        for (var i = 0; i < symbols.length; i++) {
          // Don't need to worry about cloning a symbol because it is a primitive,
          // like a number or string.
          var symbol = symbols[i];
          var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);
          if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
            continue;
          }
          child[symbol] = _clone(parent[symbol], depth - 1);
          if (!descriptor.enumerable) {
            Object.defineProperty(child, symbol, {
              enumerable: false
            });
          }
        }
      }
  
      if (includeNonEnumerable) {
        var allPropertyNames = Object.getOwnPropertyNames(parent);
        for (var i = 0; i < allPropertyNames.length; i++) {
          var propertyName = allPropertyNames[i];
          var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);
          if (descriptor && descriptor.enumerable) {
            continue;
          }
          child[propertyName] = _clone(parent[propertyName], depth - 1);
          Object.defineProperty(child, propertyName, {
            enumerable: false
          });
        }
      }
  
      return child;
    }
  
    return _clone(parent, depth);
  }
  
  /**
   * Simple flat clone using prototype, accepts only objects, usefull for property
   * override on FLAT configuration object (no nested props).
   *
   * USE WITH CAUTION! This may not behave as you wish if you do not know how this
   * works.
   */
  clone.clonePrototype = function clonePrototype(parent) {
    if (parent === null)
      return null;
  
    var c = function () {};
    c.prototype = parent;
    return new c();
  };
  
  // private utility functions
  
  function __objToStr(o) {
    return Object.prototype.toString.call(o);
  }
  clone.__objToStr = __objToStr;
  
  function __isDate(o) {
    return typeof o === 'object' && __objToStr(o) === '[object Date]';
  }
  clone.__isDate = __isDate;
  
  function __isArray(o) {
    return typeof o === 'object' && __objToStr(o) === '[object Array]';
  }
  clone.__isArray = __isArray;
  
  function __isRegExp(o) {
    return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
  }
  clone.__isRegExp = __isRegExp;
  
  function __getRegExpFlags(re) {
    var flags = '';
    if (re.global) flags += 'g';
    if (re.ignoreCase) flags += 'i';
    if (re.multiline) flags += 'm';
    return flags;
  }
  clone.__getRegExpFlags = __getRegExpFlags;
  
  return clone;
  })();
  
  if (typeof module === 'object' && module.exports) {
    module.exports = clone;
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 21 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var Writable = __webpack_require__(1).Writable;
  var util = __webpack_require__(4);
  var defaults = __webpack_require__(10);
  
  /**
   * Writable stream that accepts results in either object or string mode and outputs the text to a supplied html element
   *
   * Can show interim results when in objectMode
   *
   * @param {Object} options
   * @param {String|DOMElement} options.outputElement
   * @param {String} [options.property] what property of the element should the text be set to. Defaults to `value` for `<input>`s and `<textarea>`s, `textContent` for everything else
   * @param {Boolean} [options.clear=true] delete any previous text
   * @constructor
   */
  function WritableElementStream(options) {
    this.options = options = defaults(options, {
      decodeStrings: false, // false = don't convert strings to buffers before passing to _write (only applies in string mode)
      property: null,
      clear: true
    });
  
    this.el = typeof options.outputElement === 'string' ? document.querySelector(options.outputElement) : options.outputElement;
  
    if (!this.el) {
      throw new Error('Watson Speech to Text WritableElementStream: missing outputElement');
    }
  
    Writable.call(this, options);
  
    // for most elements we set the textContent, but for form elements, the value property is probably the expected target
    var propMap = {
      INPUT: 'value',
      TEXTAREA: 'value'
    };
    this.prop = options.property || propMap[this.el.nodeName] || 'textContent';
  
    if (options.clear) {
      this.el[this.prop] = '';
    }
  
    if (options.objectMode) {
      this.finalizedText = this.el[this.prop];
      this._write = this.writeObject;
    } else {
      this._write = this.writeString;
    }
  }
  util.inherits(WritableElementStream, Writable);
  
  WritableElementStream.prototype.writeString = function writeString(text, encoding, next) {
    this.el[this.prop] += text;
    next();
  };
  
  WritableElementStream.prototype.writeObject = function writeObject(data, encoding, next) {
    if (Array.isArray(data.results)) {
      data.results.forEach(function(result) {
        if (result.final) {
          this.finalizedText += result.alternatives[0].transcript;
          this.el[this.prop] = this.finalizedText;
        } else {
          this.el[this.prop] = this.finalizedText + result.alternatives[0].transcript;
        }
      }, this);
    }
    next();
  };
  
  module.exports = WritableElementStream;
  
  
  /***/ }),
  /* 22 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2014 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  
  var Transform = __webpack_require__(1).Transform;
  var util = __webpack_require__(4);
  var clone = __webpack_require__(20);
  
  /**
   * Object-Mode stream that pulls result objects from the results array
   *
   * Also copies the top-level result_index to the individual results as .index
   *
   * @constructor
   * @param {Object} options
   */
  function ResultStream(options) {
    options = options || {};
    options.objectMode = true;
    Transform.call(this, options);
  }
  util.inherits(ResultStream, Transform);
  
  ResultStream.prototype._transform = function(data, encoding, next) {
    // when speaker_labels is enabled, some messages won't have a results array
    if (Array.isArray(data.results)) {
      // usually there is exactly 1 result, but there can be 0 in some circumstances, and potentially more in future iterations
      data.results.forEach(function(result) {
        var cloned = clone(result);
        cloned.index = data.result_index;
        this.push(cloned);
      }, this);
    } else {
      this.push(data);
    }
    next();
  };
  
  ResultStream.prototype.promise = __webpack_require__(9);
  
  module.exports = ResultStream;
  
  
  /***/ }),
  /* 23 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2014 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  
  var Transform = __webpack_require__(1).Transform;
  var util = __webpack_require__(4);
  var pullAllWith = __webpack_require__(84);
  var noTimestamps = __webpack_require__(40);
  var clone = __webpack_require__(20);
  
  /**
   * Object-Mode stream that splits up results by speaker.
   *
   * Output format is similar to existing results formats, but with an extra speaker field,
   *
   * Output results array will usually contain multiple results.
   * All results are interim until the final batch; the text may change (if options.speakerlessInterim is enabled) or move from one interim result to another.
   *
   * Keywords, words_alternatives, and other features may appear on results that come slightly earlier than the timestamp due to the way things are split up.
   *
   * Ignores interim results from the service unless options.speakerlessInterim is enabled.
   *
   * @constructor
   * @param {Object} options
   * @param {boolean} [options.speakerlessInterim=false] - emit interim results before initial speaker has been identified (allows UI to update more quickly)
   */
  function SpeakerStream(options) {
    options = options || {};
    options.objectMode = true;
    this.options = options;
    Transform.call(this, options);
    /**
     * timestamps is a 2-d array.
     * The sub-array is [word, from time, to time]
     * Example:
     * [
         ["Yes", 28.92, 29.17],
         ["that's", 29.17, 29.37],
         ["right", 29.37, 29.64]
      ]
     * @type {Array<Array>}
     * @private
     */
    this.results = [];
    /**
     * speaker_labels is an array of objects.
     * Example:
     * [{
        "from": 28.92,
        "to": 29.17,
        "speaker": 1,
        "confidence": 0.641,
        "final": false
      }, {
        "from": 29.17,
        "to": 29.37,
        "speaker": 1,
        "confidence": 0.641,
        "final": false
      }, {
        "from": 29.37,
        "to": 29.64,
        "speaker": 1,
        "confidence": 0.641,
        "final": false
      }]
     * @type {Array<Object>}
     * @private
     */
    this.speaker_labels = [];
  
    this.mismatchErrorEmitted = false;
  
    // flag to signal that labels were recieved before results, and therefore
    // the stream needs to emit on the next batch of final results
    this.extraLabels = false;
  }
  util.inherits(SpeakerStream, Transform);
  
  SpeakerStream.prototype.isFinal = function() {
    return this.speaker_labels.length && this.speaker_labels[this.speaker_labels.length - 1].final;
  };
  
  // positions in the timestamps 2d array
  var WORD = 0;
  var FROM = 1;
  var TO = 2;
  
  SpeakerStream.ERROR_MISMATCH = 'MISMATCH';
  
  /**
   * Builds a results object with everything we've got so far
   * @return {*}
   */
  SpeakerStream.prototype.buildMessage = function() {
    var final = this.isFinal();
    this.extraLabels = false;
  
    // first match all speaker_labeles to the appropriate word and result
    // assumes that each speaker_label will have a matching word timestamp at the same index
    // stops processing and emits an error if this assumption is violated
    var resultIndex = 0;
    var timestampIndex = -1;
    var words = this.speaker_labels.map(
      // eslint-disable-next-line camelcase
      function(speaker_label) {
        var result = this.results[resultIndex];
        timestampIndex++;
        var timestamp = result.alternatives[0].timestamps[timestampIndex];
        if (!timestamp) {
          timestampIndex = 0;
          resultIndex++;
          result = this.results[resultIndex];
          timestamp = result && result.alternatives[0].timestamps[timestampIndex];
        }
        if (!timestamp) {
          // this shouldn't happen normally, but the TimingStream could inadvertently cause a
          // speaker_labels to be emitted before a result
          this.extraLabels = true;
          return null;
        }
        if (timestamp[FROM] !== speaker_label.from || timestamp[TO] !== speaker_label.to) {
          if (!this.mismatchErrorEmitted) {
            var err = new Error('Mismatch between speaker_label and word timestamp');
            err.name = SpeakerStream.ERROR_MISMATCH;
            // eslint-disable-next-line camelcase
            err.speaker_label = speaker_label;
            err.timestamp = timestamp;
            // eslint-disable-next-line camelcase
            err.speaker_labels = this.speaker_labels;
            err.results = this.results;
            this.emit('error', err);
            this.mismatchErrorEmitted = true; // If one is off, then a bunch probably are. Just emit one error.
          }
          return null;
        }
        return {
          timestamp: timestamp,
          speaker: speaker_label.speaker,
          result: result
        };
      },
      this
    );
  
    // assume that there's nothing new to emit right now,
    // wait for new results to match our new labels
    if (this.extraLabels) {
      return;
    }
  
    // filter out any nulls
    words = words.filter(function(w) {
      return w;
    });
  
    // group the words together into utterances by speaker
    var utterances = words.reduce(function(arr, word) {
      var utterance = arr[arr.length - 1];
      // any time the speaker changes or the (original) result changes, create a new utterance
      if (!utterance || utterance.speaker !== word.speaker || utterance.result !== word.result) {
        utterance = {
          speaker: word.speaker,
          timestamps: [word.timestamp],
          result: word.result
        };
        // and add it to the list
        arr.push(utterance);
      } else {
        // otherwise just append the current word to the current result
        utterance.timestamps.push(word.timestamp);
      }
      return arr;
    }, []);
  
    // create new results
    var results = utterances.map(function(utterance, i) {
      // if this is the first usage of this result, clone the original (to keep keywords and such)
      // otherwise create a new one
      var result;
      var lastUtterance = utterances[i - 1] || {};
      if (utterance.result === lastUtterance.result) {
        result = { alternatives: [{}] };
      } else {
        result = clone(utterance.result);
      }
  
      // update the result object
      // set the speaker
      result.speaker = utterance.speaker;
      // overwrite the transcript and timestamps on the first alternative
      var alt = result.alternatives[0];
      alt.transcript =
        utterance.timestamps
          .map(function(ts) {
            return ts[WORD];
          })
          .join(' ') + ' ';
      alt.timestamps = utterance.timestamps;
      // overwrite the final value
      result.final = final;
  
      var start = utterance.timestamps[0][1];
      var end = utterance.timestamps[utterance.timestamps.length - 1][2];
  
      // overwrite the word_alternatives
      if (utterance.result.word_alternatives) {
        var alts = utterance.result.word_alternatives.filter(function(walt) {
          return walt.start_time >= start && walt.end_time <= end;
        });
        result.word_alternatives = alts;
      }
  
      // overwrite the keywords spotted
      /* eslint-disable camelcase */
      var original_keywords_result = utterance.result.keywords_result;
      if (original_keywords_result) {
        var keywords_result = {};
        Object.keys(original_keywords_result).forEach(function(keyword) {
          var spottings = original_keywords_result[keyword].filter(function(spotting) {
            return spotting.start_time >= start && spotting.end_time <= end;
          });
          if (spottings.length) {
            keywords_result[keyword] = spottings;
          }
        });
        result.keywords_result = keywords_result;
      }
      /* eslint-enable camelcase */
  
      return result;
    });
  
    // result_index is always 0 because the results always includes the entire conversation so far.
    return { results: results, result_index: 0 };
  };
  
  /**
   * Captures the timestamps out of results or errors if timestamps are missing
   * @param {Object} data
   */
  SpeakerStream.prototype.handleResults = function(data) {
    if (noTimestamps(data)) {
      var err = new Error('SpeakerStream requires that timestamps and speaker_labels be enabled');
      err.name = noTimestamps.ERROR_NO_TIMESTAMPS;
      this.emit('error', err);
      return;
    }
    data.results
      .filter(function(result) {
        return result.final;
      })
      .forEach(function(result) {
        this.results.push(result);
      }, this);
  };
  
  // sorts by start time and then end time
  SpeakerStream.speakerLabelsSorter = function(a, b) {
    if (a.from === b.from) {
      if (a.to === b.to) {
        return 0;
      }
      return a.to < b.to ? -1 : 1;
    }
    return a.from < b.from ? -1 : 1;
  };
  
  /**
   * Only the very last labeled word gets final: true. Up until that point, all speaker_labels are considered interim and
   * may be repeated with a new speaker selected in a later set of speaker_labels.
   *
   * @private
   * @param {Object} data
   */
  SpeakerStream.prototype.handleSpeakerLabels = function(data) {
    var speaker_labels = data.speaker_labels; // eslint-disable-line camelcase
  
    // remove any values from the old speaker_labels that are duplicated in the new set
    pullAllWith(this.speaker_labels, speaker_labels, function(old, nw) {
      return old.from === nw.from && old.to === nw.to;
    });
  
    // next append the new labels to the remaining old ones
    this.speaker_labels.push.apply(this.speaker_labels, data.speaker_labels);
  
    // finally, ensure the list is still sorted chronologically
    this.speaker_labels.sort(SpeakerStream.speakerLabelsSorter);
  };
  
  SpeakerStream.prototype._transform = function(data, encoding, next) {
    var message;
    if (Array.isArray(data.results)) {
      this.handleResults(data);
      if (this.options.speakerlessInterim && data.results.length && data.results[0].final === false) {
        message = this.buildMessage();
        message.results = message.results.concat(data.results);
      }
      // clean up if things got out of order
      if (this.extraLabels && data.results.length && data.results[0].final === true) {
        message = this.buildMessage();
      }
    }
    if (Array.isArray(data.speaker_labels)) {
      this.handleSpeakerLabels(data);
      message = this.buildMessage();
    }
    if (message) {
      /**
       * Emit an object similar to the normal results object, only with multiple entries in the results Array (a new one
       * each time the speaker changes), and with a speaker field on the results.
       *
       * result_index is always 0 because the results always includes the entire conversation so far.
       *
       * @event SpeakerStream#data
       * @param {Object} results-format message with multiple results and an extra speaker field on each result
       */
      this.push(message);
    }
    next();
  };
  
  /**
   * catches cases where speaker_labels was not enabled and internal errors that cause data loss
   *
   * @param {Function} done
   * @private
   */
  SpeakerStream.prototype._flush = function(done) {
    var timestamps = this.results
      .map(function(r) {
        return r.alternatives[0].timestamps;
      })
      .reduce(function(a, b) {
        return a.concat(b);
      }, []);
    if (timestamps.length !== this.speaker_labels.length) {
      var msg;
      if (timestamps.length && !this.speaker_labels.length) {
        msg = 'No speaker_labels found. SpeakerStream requires speaker_labels to be enabled.';
      } else {
        msg =
          'Mismatch between number of word timestamps (' +
          timestamps.length +
          ') and number of speaker_labels (' +
          this.speaker_labels.length +
          ') - some data may be lost.';
      }
      var err = new Error(msg);
      err.name = SpeakerStream.ERROR_MISMATCH;
      err.speaker_labels = this.speaker_labels;
      err.results = this.results;
      this.emit('error', err);
    }
    done();
  };
  
  SpeakerStream.prototype.promise = __webpack_require__(9);
  
  module.exports = SpeakerStream;
  
  
  /***/ }),
  /* 24 */
  /***/ (function(module, exports) {
  
  var toString = {}.toString;
  
  module.exports = Array.isArray || function (arr) {
    return toString.call(arr) == '[object Array]';
  };
  
  
  /***/ }),
  /* 25 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// loosely based on example code at https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
  (function (root) {
    'use strict';
  
    /**
     * Error thrown when any required feature is missing (Promises, navigator, getUserMedia)
     * @constructor
     */
    function NotSupportedError() {
      this.name = 'NotSupportedError';
      this.message = 'getUserMedia is not implemented in this browser';
    }
    NotSupportedError.prototype = Error.prototype;
  
    /**
     * Fake Promise instance that behaves like a Promise except that it always rejects with a NotSupportedError.
     * Used for situations where there is no global Promise constructor.
     *
     * The message will report that the getUserMedia API is not available.
     * This is technically true because every browser that supports getUserMedia also supports promises.
     **
     * @see http://caniuse.com/#feat=stream
     * @see http://caniuse.com/#feat=promises
     * @constructor
     */
    function FakePromise() {
      // make it chainable like a real promise
      this.then = function() {
        return this;
      };
  
      // but always reject with an error
      var err = new NotSupportedError();
      this.catch = function(cb) {
        setTimeout(function () {
          cb(err);
        });
      }
    }
  
    var isPromiseSupported = typeof Promise !== 'undefined';
  
    // checks for root.navigator to enable server-side rendering of things that depend on this
    // (will need to be updated on client, but at least doesn't throw this way)
    var navigatorExists = typeof navigator !== "undefined";
    // gump = mondern promise-based interface
    // gum = old callback-based interface
    var gump = navigatorExists && navigator.mediaDevices && navigator.mediaDevices.getUserMedia;
    var gum = navigatorExists && (navigator.getUserMedia || navigator.webkitGetUserMedia ||  navigator.mozGetUserMedia || navigator.msGetUserMedia);
  
    /**
     * Wrapper for navigator.mediaDevices.getUserMedia.
     * Always returns a Promise or Promise-like object, even in environments without a global Promise constructor
     *
     * @stream https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
     *
     * @param {Object} constraints - must include one or both of audio/video along with optional details for video
     * @param {Boolean} [constraints.audio] - include audio data in the stream
     * @param {Boolean|Object} [constraints.video] - include video data in the stream. May be a boolean or an object with additional constraints, see
     * @returns {Promise<MediaStream>} a promise that resolves to a MediaStream object
       */
    function getUserMedia(constraints) {
      // ensure that Promises are supported and we have a navigator object
      if (!isPromiseSupported) {
        return new FakePromise();
      }
  
      // Try the more modern, promise-based MediaDevices API first
      //https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
      if(gump) {
        return navigator.mediaDevices.getUserMedia(constraints);
      }
  
      // fall back to the older method second, wrap it in a promise.
      return new Promise(function(resolve, reject) {
        // if navigator doesn't exist, then we can't use the getUserMedia API. (And probably aren't even in a browser.)
        // assuming it does, try getUserMedia and then all of the prefixed versions
  
        if (!gum) {
          return reject(new NotSupportedError())
        }
        gum.call(navigator, constraints, resolve, reject);
      });
    }
  
    getUserMedia.NotSupportedError = NotSupportedError;
  
    // eslint-disable-next-line no-implicit-coercion
    getUserMedia.isSupported = !!(isPromiseSupported && (gump || gum));
  
    // UMD, loosely based on https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js
    if (true) {
      // AMD. Register as an anonymous module.
      !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
        return getUserMedia;
      }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
    } else if (typeof module === 'object' && module.exports) {
      // Node. Does not work with strict CommonJS, but
      // only CommonJS-like enviroments that support module.exports,
      // like Node.
      module.exports = getUserMedia;
    } else {
      // Browser globals
      // polyfill the MediaDevices API if it does not exist.
      root.navigator = root.navigator || {};
      root.nagivator.mediaDevices = root.navigator.mediaDevices || {};
      root.nagivator.mediaDevices.getUserMedia = root.nagivator.mediaDevices.getUserMedia || getUserMedia;
    }
  }(this));
  
  
  /***/ }),
  /* 26 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(process) {
  var Readable = __webpack_require__(1).Readable;
  var util = __webpack_require__(4);
  // some versions of the buffer browser lib don't support Buffer.from (such as the one included by the current version of express-browserify)
  var bufferFrom = __webpack_require__(15);
  
  /**
   * Turns a MediaStream object (from getUserMedia) into a Node.js Readable stream and optionally converts the audio to Buffers
   *
   * @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia
   *
   * @param {Object} [opts] options
   * @param {MediaStream} [opts.stream] https://developer.mozilla.org/en-US/docs/Web/API/MediaStream - for iOS compatibility, it is recommended that you create the MicrophoneStream instance in response to the tap - before you have a MediaStream, and then later call setStream() with the MediaStream.
   * @param {Boolean} [opts.objectMode=false] Puts the stream into ObjectMode where it emits AudioBuffers instead of Buffers - see https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer
   * @param {Number|null} [opts.bufferSize=null] https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor
   * @constructor
   */
  function MicrophoneStream(opts) {
    // backwards compatibility - passing in the Stream here will generally not work on iOS 11 Safari
    if (typeof MediaStream && opts instanceof MediaStream) {
      var stream = opts;
      opts = arguments[1] || {};
      opts.stream = stream;
    }
    // "It is recommended for authors to not specify this buffer size and allow the implementation to pick a good
    // buffer size to balance between latency and audio quality."
    // https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor
    // however, webkitAudioContext (safari) requires it to be set'
    // Possible values: null, 256, 512, 1024, 2048, 4096, 8192, 16384
    var bufferSize = (typeof window.AudioContext === 'undefined' ? 4096 : null);
    opts = opts || {};
  
    bufferSize = opts.bufferSize || bufferSize;
  
    // We can only emit one channel's worth of audio, so only one input. (Who has multiple microphones anyways?)
    var inputChannels = 1;
  
    // we shouldn't need any output channels (going back to the browser), but chrome is buggy and won't give us any audio without one
    var outputChannels = 1;
  
    Readable.call(this, opts);
  
    var self = this;
    var recording = true;
  
    /**
     * Convert and emit the raw audio data
     * @see https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode/onaudioprocess
     * @param {AudioProcessingEvent} e https://developer.mozilla.org/en-US/docs/Web/API/AudioProcessingEvent
     */
    function recorderProcess(e) {
      // onaudioprocess can be called at least once after we've stopped
      if (recording) {
        self.push(opts.objectMode ? e.inputBuffer : bufferFrom(e.inputBuffer.getChannelData(0).buffer));
      }
    }
  
    var AudioContext = window.AudioContext || window.webkitAudioContext;
    var context = new AudioContext();
    var recorder = context.createScriptProcessor(bufferSize, inputChannels, outputChannels);
  
    // Workaround for Safari on iOS 11 - context starts out suspended, and the resume() call must be in response to a tap.
    // This allows you to create the MicrophoneStream instance synchronously in response to the first tap,
    // and then connect the MediaStream asynchronously, after the user has granted microphone access.
    var audioInput;
    if (context.state === 'suspended') {
      context.resume();
    }
  
    /**
     * Set the MediaStream
     *
     * This was removed from the constructor to enable better compatibility with Safari on iOS 11.
     *
     * @param {MediaStream} stream https://developer.mozilla.org/en-US/docs/Web/API/MediaStream
     */
    this.setStream = function(stream) {
      audioInput = context.createMediaStreamSource(stream);
      audioInput.connect(recorder);
      recorder.onaudioprocess = recorderProcess;
    };
  
    if (opts.stream) {
      this.setStream(stream);
    }
  
    // other half of workaround for chrome bugs
    recorder.connect(context.destination);
  
    this.stop = function() {
      if (context.state === 'closed') {
        return;
      }
      try {
        stream.getTracks()[0].stop();
      } catch (ex) {
        // This fails in some older versions of chrome. Nothing we can do about it.
      }
      recorder.disconnect();
      if (audioInput) {
        audioInput.disconnect();
      }
      try {
        context.close(); // returns a promise;
      } catch (ex) {
        // this can also fail in older versions of chrome
      }
      recording = false;
      self.push(null);
      self.emit('close');
    };
  
    process.nextTick(function() {
      self.emit('format', {
        channels: 1,
        bitDepth: 32,
        sampleRate: context.sampleRate,
        signed: true,
        float: true
      });
    });
  }
  util.inherits(MicrophoneStream, Readable);
  
  MicrophoneStream.prototype._read = function(/* bytes */) {
    // no-op, (flow-control doesn't really work on sound)
  };
  
  /**
   * Converts a Buffer back into the raw Float32Array format that browsers use.
   * Note: this is just a new DataView for the same underlying buffer -
   * the actual audio data is not copied or changed here.
   *
   * @param {Buffer} chunk node-style buffer of audio data from a 'data' event or read() call
   * @return {Float32Array} raw 32-bit float data view of audio data
   */
  MicrophoneStream.toRaw = function toFloat32(chunk) {
    return new Float32Array(chunk.buffer);
  };
  
  module.exports = MicrophoneStream;
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  
  /***/ }),
  /* 27 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(process) {
  
  module.exports = Readable;
  
  /*<replacement>*/
  var processNextTick = __webpack_require__(12);
  /*</replacement>*/
  
  /*<replacement>*/
  var isArray = __webpack_require__(24);
  /*</replacement>*/
  
  /*<replacement>*/
  var Duplex;
  /*</replacement>*/
  
  Readable.ReadableState = ReadableState;
  
  /*<replacement>*/
  var EE = __webpack_require__(11).EventEmitter;
  
  var EElistenerCount = function (emitter, type) {
    return emitter.listeners(type).length;
  };
  /*</replacement>*/
  
  /*<replacement>*/
  var Stream = __webpack_require__(28);
  /*</replacement>*/
  
  var Buffer = __webpack_require__(0).Buffer;
  /*<replacement>*/
  var bufferShim = __webpack_require__(13);
  /*</replacement>*/
  
  /*<replacement>*/
  var util = __webpack_require__(8);
  util.inherits = __webpack_require__(2);
  /*</replacement>*/
  
  /*<replacement>*/
  var debugUtil = __webpack_require__(48);
  var debug = void 0;
  if (debugUtil && debugUtil.debuglog) {
    debug = debugUtil.debuglog('stream');
  } else {
    debug = function () {};
  }
  /*</replacement>*/
  
  var BufferList = __webpack_require__(49);
  var StringDecoder;
  
  util.inherits(Readable, Stream);
  
  var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
  
  function prependListener(emitter, event, fn) {
    // Sadly this is not cacheable as some libraries bundle their own
    // event emitter implementation with them.
    if (typeof emitter.prependListener === 'function') {
      return emitter.prependListener(event, fn);
    } else {
      // This is a 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]];
    }
  }
  
  function ReadableState(options, stream) {
    Duplex = Duplex || __webpack_require__(5);
  
    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;
  
    // A linked list is used to store data chunks instead of an array because the
    // linked list can remove elements from the beginning faster than
    // array.shift()
    this.buffer = new BufferList();
    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 = __webpack_require__(29).StringDecoder;
      this.decoder = new StringDecoder(options.encoding);
      this.encoding = options.encoding;
    }
  }
  
  function Readable(options) {
    Duplex = Duplex || __webpack_require__(5);
  
    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 = __webpack_require__(29).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 to prevent increasing hwm excessively in
      // tiny amounts
      n--;
      n |= n >>> 1;
      n |= n >>> 2;
      n |= n >>> 4;
      n |= n >>> 8;
      n |= n >>> 16;
      n++;
    }
    return n;
  }
  
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function howMuchToRead(n, state) {
    if (n <= 0 || state.length === 0 && state.ended) return 0;
    if (state.objectMode) return 1;
    if (n !== n) {
      // Only flow one buffer at a time
      if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
    }
    // If we're asking for more than the current hwm, then raise the hwm.
    if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
    if (n <= state.length) return n;
    // Don't have enough
    if (!state.ended) {
      state.needReadable = true;
      return 0;
    }
    return state.length;
  }
  
  // you can override either this method, or the async _read(n) below.
  Readable.prototype.read = function (n) {
    debug('read', n);
    n = parseInt(n, 10);
    var state = this._readableState;
    var nOrig = n;
  
    if (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);
    } else 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 (!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;
    } else {
      state.length -= n;
    }
  
    if (state.length === 0) {
      // If we have nothing in the buffer, then we want to know
      // as soon as we *do* get something into the buffer.
      if (!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) 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('_read() is 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();
    }
  
    // If the user pushes more data while we're writing to dest then we'll end up
    // in ondata again. However, we only want to increase awaitDrain once because
    // dest will only emit one 'drain' event for the multiple writes.
    // => Introduce a guard on increasing awaitDrain.
    var increasedAwaitDrain = false;
    src.on('data', ondata);
    function ondata(chunk) {
      debug('ondata');
      increasedAwaitDrain = false;
      var ret = dest.write(chunk);
      if (false === ret && !increasedAwaitDrain) {
        // 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++;
          increasedAwaitDrain = true;
        }
        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 index = indexOf(state.pipes, dest);
    if (index === -1) return this;
  
    state.pipes.splice(index, 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 (ev === 'data') {
      // Start flowing on next tick if stream isn't explicitly paused
      if (this._readableState.flowing !== false) this.resume();
    } else if (ev === 'readable') {
      var state = this._readableState;
      if (!state.endEmitted && !state.readableListening) {
        state.readableListening = state.needReadable = true;
        state.emittedReadable = false;
        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;
    state.awaitDrain = 0;
    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);
    while (state.flowing && stream.read() !== null) {}
  }
  
  // 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.
    for (var n = 0; n < kProxyEvents.length; n++) {
      stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
    }
  
    // 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.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function fromList(n, state) {
    // nothing buffered
    if (state.length === 0) return null;
  
    var ret;
    if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
      // read it all, truncate the list
      if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
      state.buffer.clear();
    } else {
      // read part of list
      ret = fromListPartial(n, state.buffer, state.decoder);
    }
  
    return ret;
  }
  
  // Extracts only enough buffered data to satisfy the amount requested.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function fromListPartial(n, list, hasStrings) {
    var ret;
    if (n < list.head.data.length) {
      // slice is the same for buffers and strings
      ret = list.head.data.slice(0, n);
      list.head.data = list.head.data.slice(n);
    } else if (n === list.head.data.length) {
      // first chunk is a perfect match
      ret = list.shift();
    } else {
      // result spans more than one buffer
      ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
    }
    return ret;
  }
  
  // Copies a specified amount of characters from the list of buffered data
  // chunks.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function copyFromBufferString(n, list) {
    var p = list.head;
    var c = 1;
    var ret = p.data;
    n -= ret.length;
    while (p = p.next) {
      var str = p.data;
      var nb = n > str.length ? str.length : n;
      if (nb === str.length) ret += str;else ret += str.slice(0, n);
      n -= nb;
      if (n === 0) {
        if (nb === str.length) {
          ++c;
          if (p.next) list.head = p.next;else list.head = list.tail = null;
        } else {
          list.head = p;
          p.data = str.slice(nb);
        }
        break;
      }
      ++c;
    }
    list.length -= c;
    return ret;
  }
  
  // Copies a specified amount of bytes from the list of buffered data chunks.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function copyFromBuffer(n, list) {
    var ret = bufferShim.allocUnsafe(n);
    var p = list.head;
    var c = 1;
    p.data.copy(ret);
    n -= p.data.length;
    while (p = p.next) {
      var buf = p.data;
      var nb = n > buf.length ? buf.length : n;
      buf.copy(ret, ret.length - n, 0, nb);
      n -= nb;
      if (n === 0) {
        if (nb === buf.length) {
          ++c;
          if (p.next) list.head = p.next;else list.head = list.tail = null;
        } else {
          list.head = p;
          p.data = buf.slice(nb);
        }
        break;
      }
      ++c;
    }
    list.length -= c;
    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;
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  
  /***/ }),
  /* 28 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(11).EventEmitter;
  
  
  /***/ }),
  /* 29 */
  /***/ (function(module, exports, __webpack_require__) {
  
  // 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 = __webpack_require__(0).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;
  }
  
  
  /***/ }),
  /* 30 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  // 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 = __webpack_require__(5);
  
  /*<replacement>*/
  var util = __webpack_require__(8);
  util.inherits = __webpack_require__(2);
  /*</replacement>*/
  
  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);
  
    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;
    }
  
    // When the writable side finishes, then flush out anything remaining.
    this.once('prefinish', function () {
      if (typeof this._flush === 'function') this._flush(function (er, data) {
        done(stream, er, data);
      });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('_transform() is 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 (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;
    }
  };
  
  function done(stream, er, data) {
    if (er) return stream.emit('error', er);
  
    if (data !== null && data !== undefined) stream.push(data);
  
    // 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);
  }
  
  /***/ }),
  /* 31 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Get an object's ES6 @@toStringTag.
   * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring|19.1.3.6 Object.prototype.toString ( )}
   * @version 1.4.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module to-string-tag-x
   */
  
  
  
  var isNull = __webpack_require__(63);
  var isUndefined = __webpack_require__(64);
  var toStr = Object.prototype.toString;
  
  /**
   * The `toStringTag` method returns "[object type]", where type is the
   * object type.
   *
   * @param {*} value - The object of which to get the object type string.
   * @returns {string} The object type string.
   * @example
   * var toStringTag = require('to-string-tag-x');
   *
   * var o = new Object();
   * toStringTag(o); // returns '[object Object]'
   */
  module.exports = function toStringTag(value) {
    if (isNull(value)) {
      return '[object Null]';
    }
  
    if (isUndefined(value)) {
      return '[object Undefined]';
    }
  
    return toStr.call(value);
  };
  
  
  /***/ }),
  /* 32 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Tests if ES6 @@toStringTag is supported.
   * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag|26.3.1 @@toStringTag}
   * @version 1.4.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module has-to-string-tag-x
   */
  
  
  
  /**
   * Indicates if `Symbol.toStringTag`exists and is the correct type.
   * `true`, if it exists and is the correct type, otherwise `false`.
   *
   * @type boolean
   */
  module.exports = __webpack_require__(65) && typeof Symbol.toStringTag === 'symbol';
  
  
  /***/ }),
  /* 33 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /*!
   * is-primitive <https://github.com/jonschlinkert/is-primitive>
   *
   * Copyright (c) 2014-2015, Jon Schlinkert.
   * Licensed under the MIT License.
   */
  
  
  
  // see http://jsperf.com/testing-value-is-primitive/7
  module.exports = function isPrimitive(value) {
    return value == null || (typeof value !== 'function' && typeof value !== 'object');
  };
  
  
  /***/ }),
  /* 34 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file ES6-compliant shim for ToString.
   * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-tostring|7.1.12 ToString ( argument )}
   * @version 1.4.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module to-string-x
   */
  
  
  
  var isSymbol = __webpack_require__(69);
  
  /**
   * The abstract operation ToString converts argument to a value of type String.
   *
   * @param {*} value - The value to convert to a string.
   * @throws {TypeError} If `value` is a Symbol.
   * @returns {string} The converted value.
   * @example
   * var $toString = require('to-string-x');
   *
   * $toString(); // 'undefined'
   * $toString(null); // 'null'
   * $toString('abc'); // 'abc'
   * $toString(true); // 'true'
   * $toString(Symbol('foo')); // TypeError
   * $toString(Symbol.iterator); // TypeError
   * $toString(Object(Symbol.iterator)); // TypeError
   */
  module.exports = function ToString(value) {
    if (isSymbol(value)) {
      throw new TypeError('Cannot convert a Symbol value to a string');
    }
  
    return String(value);
  };
  
  
  /***/ }),
  /* 35 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /*!
   * object.pick <https://github.com/jonschlinkert/object.pick>
   *
   * Copyright (c) 2014-2015 Jon Schlinkert, contributors.
   * Licensed under the MIT License
   */
  
  
  
  var isObject = __webpack_require__(73);
  
  module.exports = function pick(obj, keys) {
    if (!isObject(obj) && typeof obj !== 'function') {
      return {};
    }
  
    var res = {};
    if (typeof keys === 'string') {
      if (keys in obj) {
        res[keys] = obj[keys];
      }
      return res;
    }
  
    var len = keys.length;
    var idx = -1;
  
    while (++idx < len) {
      var key = keys[idx];
      if (key in obj) {
        res[key] = obj[key];
      }
    }
    return res;
  };
  
  
  /***/ }),
  /* 36 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  /**
   * Stringify query params, Watson-style
   *
   * Why? The server that processes auth tokens currently only accepts the *exact* string, even if it's invalid for a URL.
   * Properly url-encoding percent characters causes it to reject the token.
   * So, this is a custom qs.stringify function that properly encodes everything except watson-token, passing it along verbatim
   *
   * @param {Object} queryParams
   * @return {String}
   */
  exports.stringify = function stringify(queryParams) {
    return Object.keys(queryParams)
      .map(function(key) {
        return key + '=' + (key === 'watson-token' ? queryParams[key] : encodeURIComponent(queryParams[key])); // the server chokes if the token is correctly url-encoded
      })
      .join('&');
  };
  
  
  /***/ }),
  /* 37 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(process) {
  var Transform = __webpack_require__(1).Transform;
  var util = __webpack_require__(4);
  var defaults = __webpack_require__(10);
  // some versions of the buffer browser lib don't support Buffer.from (such as the one included by the current version of express-browserify)
  var bufferFrom = __webpack_require__(15);
  
  var TARGET_SAMPLE_RATE = 16000;
  /**
   * Transforms Buffers or AudioBuffers into a binary stream of l16 (raw wav) audio, downsampling in the process.
   *
   * The watson speech-to-text service works on 16kHz and internally downsamples audio received at higher samplerates.
   * WebAudio is usually 44.1kHz or 48kHz, so downsampling here reduces bandwidth usage by ~2/3.
   *
   * Format event + stream can be combined with https://www.npmjs.com/package/wav to generate a wav file with a proper header
   *
   * Todo: support multi-channel audio (for use with <audio>/<video> elements) - will require interleaving audio channels
   *
   * @param {Object} options
   * @constructor
   */
  function WebAudioL16Stream(options) {
    options = this.options = defaults(options, {
      sourceSampleRate: 48000,
      downsample: true
    });
  
    Transform.call(this, options);
  
    this.bufferUnusedSamples = [];
  
    if (options.objectMode || options.writableObjectMode) {
      this._transform = this.handleFirstAudioBuffer;
    } else {
      this._transform = this.transformBuffer;
      process.nextTick(this.emitFormat.bind(this));
    }
  }
  util.inherits(WebAudioL16Stream, Transform);
  
  WebAudioL16Stream.prototype.emitFormat = function emitFormat() {
    this.emit('format', {
      channels: 1,
      bitDepth: 16,
      sampleRate: this.options.downsample ? TARGET_SAMPLE_RATE : this.options.sourceSampleRate,
      signed: true,
      float: false
    });
  };
  
  /**
   * Downsamples WebAudio to 16 kHz.
   *
   * Browsers can downsample WebAudio natively with OfflineAudioContext's but it was designed for non-streaming use and
   * requires a new context for each AudioBuffer. Firefox can handle this, but chrome (v47) crashes after a few minutes.
   * So, we'll do it in JS for now.
   *
   * This really belongs in it's own stream, but there's no way to create new AudioBuffer instances from JS, so its
   * fairly coupled to the wav conversion code.
   *
   * @param  {AudioBuffer} bufferNewSamples Microphone/MediaElement audio chunk
   * @return {Float32Array} 'audio/l16' chunk
   */
  WebAudioL16Stream.prototype.downsample = function downsample(bufferNewSamples) {
    var buffer = null;
    var newSamples = bufferNewSamples.length;
    var unusedSamples = this.bufferUnusedSamples.length;
    var i;
    var offset;
  
    if (unusedSamples > 0) {
      buffer = new Float32Array(unusedSamples + newSamples);
      for (i = 0; i < unusedSamples; ++i) {
        buffer[i] = this.bufferUnusedSamples[i];
      }
      for (i = 0; i < newSamples; ++i) {
        buffer[unusedSamples + i] = bufferNewSamples[i];
      }
    } else {
      buffer = bufferNewSamples;
    }
  
    // Downsampling and low-pass filter:
    // Input audio is typically 44.1kHz or 48kHz, this downsamples it to 16kHz.
    // It uses a FIR (finite impulse response) Filter to remove (or, at least attinuate)
    // audio frequencies > ~8kHz because sampled audio cannot accurately represent
    // frequiencies greater than half of the sample rate.
    // (Human voice tops out at < 4kHz, so nothing important is lost for transcription.)
    // See http://dsp.stackexchange.com/a/37475/26392 for a good explination of this code.
    var filter = [
      -0.037935,
      -0.00089024,
      0.040173,
      0.019989,
      0.0047792,
      -0.058675,
      -0.056487,
      -0.0040653,
      0.14527,
      0.26927,
      0.33913,
      0.26927,
      0.14527,
      -0.0040653,
      -0.056487,
      -0.058675,
      0.0047792,
      0.019989,
      0.040173,
      -0.00089024,
      -0.037935
    ];
    var samplingRateRatio = this.options.sourceSampleRate / TARGET_SAMPLE_RATE;
    var nOutputSamples = Math.floor((buffer.length - filter.length) / samplingRateRatio) + 1;
    var outputBuffer = new Float32Array(nOutputSamples);
  
    for (i = 0; i + filter.length - 1 < buffer.length; i++) {
      offset = Math.round(samplingRateRatio * i);
      var sample = 0;
      for (var j = 0; j < filter.length; ++j) {
        sample += buffer[offset + j] * filter[j];
      }
      outputBuffer[i] = sample;
    }
  
    var indexSampleAfterLastUsed = Math.round(samplingRateRatio * i);
    var remaining = buffer.length - indexSampleAfterLastUsed;
    if (remaining > 0) {
      this.bufferUnusedSamples = new Float32Array(remaining);
      for (i = 0; i < remaining; ++i) {
        this.bufferUnusedSamples[i] = buffer[indexSampleAfterLastUsed + i];
      }
    } else {
      this.bufferUnusedSamples = new Float32Array(0);
    }
  
    return outputBuffer;
  };
  
  /**
   * Accepts a Float32Array of audio data and converts it to a Buffer of l16 audio data (raw wav)
   *
   * Explanation for the math: The raw values captured from the Web Audio API are
   * in 32-bit Floating Point, between -1 and 1 (per the specification).
   * The values for 16-bit PCM range between -32768 and +32767 (16-bit signed integer).
   * Filter & combine samples to reduce frequency, then multiply to by 0x7FFF (32767) to convert.
   * Store in little endian.
   *
   * @param {Float32Array} input
   * @return {Buffer}
   */
  WebAudioL16Stream.prototype.floatTo16BitPCM = function(input) {
    var output = new DataView(new ArrayBuffer(input.length * 2)); // length is in bytes (8-bit), so *2 to get 16-bit length
    for (var i = 0; i < input.length; i++) {
      var multiplier = input[i] < 0 ? 0x8000 : 0x7fff; // 16-bit signed range is -32768 to 32767
      output.setInt16(i * 2, (input[i] * multiplier) | 0, true); // index, value ("| 0" = convert to 32-bit int, round towards 0), littleEndian.
    }
    return bufferFrom(output.buffer);
  };
  
  /**
   * Does some one-time setup to grab sampleRate and emit format, then sets _transform to the actual audio buffer handler and calls it.
   * @param {AudioBuffer} audioBuffer
   * @param {String} encoding
   * @param {Function} next
   */
  WebAudioL16Stream.prototype.handleFirstAudioBuffer = function handleFirstAudioBuffer(audioBuffer, encoding, next) {
    this.options.sourceSampleRate = audioBuffer.sampleRate;
    this.emitFormat();
    this._transform = this.transformAudioBuffer;
    this._transform(audioBuffer, encoding, next);
  };
  
  /**
   * Accepts an AudioBuffer (for objectMode), then downsamples to 16000 and converts to a 16-bit pcm
   *
   * @param {AudioBuffer} audioBuffer
   * @param {String} encoding
   * @param {Function} next
   */
  WebAudioL16Stream.prototype.transformAudioBuffer = function(audioBuffer, encoding, next) {
    var source = audioBuffer.getChannelData(0);
    if (this.options.downsample) {
      source = this.downsample(source);
    }
    this.push(this.floatTo16BitPCM(source));
    next();
  };
  
  /**
   * Accepts a Buffer (for binary mode), then downsamples to 16000 and converts to a 16-bit pcm
   *
   * @param {Buffer} nodebuffer
   * @param {String} encoding
   * @param {Function} next
   */
  WebAudioL16Stream.prototype.transformBuffer = function(nodebuffer, encoding, next) {
    var source = new Float32Array(nodebuffer.buffer);
    if (this.options.downsample) {
      source = this.downsample(source);
    }
    this.push(this.floatTo16BitPCM(source));
    next();
  };
  // new Float32Array(nodebuffer.buffer)
  
  module.exports = WebAudioL16Stream;
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  
  /***/ }),
  /* 38 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var implementation = __webpack_require__(79);
  
  var lacksProperEnumerationOrder = function () {
  	if (!Object.assign) {
  		return false;
  	}
  	// v8, specifically in node 4.x, has a bug with incorrect property enumeration order
  	// note: this does not detect the bug unless there's 20 characters
  	var str = 'abcdefghijklmnopqrst';
  	var letters = str.split('');
  	var map = {};
  	for (var i = 0; i < letters.length; ++i) {
  		map[letters[i]] = letters[i];
  	}
  	var obj = Object.assign({}, map);
  	var actual = '';
  	for (var k in obj) {
  		actual += k;
  	}
  	return str !== actual;
  };
  
  var assignHasPendingExceptions = function () {
  	if (!Object.assign || !Object.preventExtensions) {
  		return false;
  	}
  	// Firefox 37 still has "pending exception" logic in its Object.assign implementation,
  	// which is 72% slower than our shim, and Firefox 40's native implementation.
  	var thrower = Object.preventExtensions({ 1: 2 });
  	try {
  		Object.assign(thrower, 'xy');
  	} catch (e) {
  		return thrower[1] === 'y';
  	}
  	return false;
  };
  
  module.exports = function getPolyfill() {
  	if (!Object.assign) {
  		return implementation;
  	}
  	if (lacksProperEnumerationOrder()) {
  		return implementation;
  	}
  	if (assignHasPendingExceptions()) {
  		return implementation;
  	}
  	return Object.assign;
  };
  
  
  /***/ }),
  /* 39 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  // modified from https://github.com/es-shims/es5-shim
  var has = Object.prototype.hasOwnProperty;
  var toStr = Object.prototype.toString;
  var slice = Array.prototype.slice;
  var isArgs = __webpack_require__(80);
  var isEnumerable = Object.prototype.propertyIsEnumerable;
  var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
  var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  var dontEnums = [
  	'toString',
  	'toLocaleString',
  	'valueOf',
  	'hasOwnProperty',
  	'isPrototypeOf',
  	'propertyIsEnumerable',
  	'constructor'
  ];
  var equalsConstructorPrototype = function (o) {
  	var ctor = o.constructor;
  	return ctor && ctor.prototype === o;
  };
  var excludedKeys = {
  	$console: true,
  	$external: true,
  	$frame: true,
  	$frameElement: true,
  	$frames: true,
  	$innerHeight: true,
  	$innerWidth: true,
  	$outerHeight: true,
  	$outerWidth: true,
  	$pageXOffset: true,
  	$pageYOffset: true,
  	$parent: true,
  	$scrollLeft: true,
  	$scrollTop: true,
  	$scrollX: true,
  	$scrollY: true,
  	$self: true,
  	$webkitIndexedDB: true,
  	$webkitStorageInfo: true,
  	$window: true
  };
  var hasAutomationEqualityBug = (function () {
  	/* global window */
  	if (typeof window === 'undefined') { return false; }
  	for (var k in window) {
  		try {
  			if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
  				try {
  					equalsConstructorPrototype(window[k]);
  				} catch (e) {
  					return true;
  				}
  			}
  		} catch (e) {
  			return true;
  		}
  	}
  	return false;
  }());
  var equalsConstructorPrototypeIfNotBuggy = function (o) {
  	/* global window */
  	if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
  		return equalsConstructorPrototype(o);
  	}
  	try {
  		return equalsConstructorPrototype(o);
  	} catch (e) {
  		return false;
  	}
  };
  
  var keysShim = function keys(object) {
  	var isObject = object !== null && typeof object === 'object';
  	var isFunction = toStr.call(object) === '[object Function]';
  	var isArguments = isArgs(object);
  	var isString = isObject && toStr.call(object) === '[object String]';
  	var theKeys = [];
  
  	if (!isObject && !isFunction && !isArguments) {
  		throw new TypeError('Object.keys called on a non-object');
  	}
  
  	var skipProto = hasProtoEnumBug && isFunction;
  	if (isString && object.length > 0 && !has.call(object, 0)) {
  		for (var i = 0; i < object.length; ++i) {
  			theKeys.push(String(i));
  		}
  	}
  
  	if (isArguments && object.length > 0) {
  		for (var j = 0; j < object.length; ++j) {
  			theKeys.push(String(j));
  		}
  	} else {
  		for (var name in object) {
  			if (!(skipProto && name === 'prototype') && has.call(object, name)) {
  				theKeys.push(String(name));
  			}
  		}
  	}
  
  	if (hasDontEnumBug) {
  		var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
  
  		for (var k = 0; k < dontEnums.length; ++k) {
  			if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
  				theKeys.push(dontEnums[k]);
  			}
  		}
  	}
  	return theKeys;
  };
  
  keysShim.shim = function shimObjectKeys() {
  	if (Object.keys) {
  		var keysWorksWithArguments = (function () {
  			// Safari 5.0 bug
  			return (Object.keys(arguments) || '').length === 2;
  		}(1, 2));
  		if (!keysWorksWithArguments) {
  			var originalKeys = Object.keys;
  			Object.keys = function keys(object) {
  				if (isArgs(object)) {
  					return originalKeys(slice.call(object));
  				} else {
  					return originalKeys(object);
  				}
  			};
  		}
  	} else {
  		Object.keys = keysShim;
  	}
  	return Object.keys || keysShim;
  };
  
  module.exports = keysShim;
  
  
  /***/ }),
  /* 40 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  /**
   * Returns true if the result is missing it's timestamps
   * @param {Object} data
   * @return {Boolean}
   */
  module.exports = function noTimestamps(data) {
    return data.results.some(function(result) {
      var alt = result.alternatives && result.alternatives[0];
      return !!(alt && ((alt.transcript.trim() && !alt.timestamps) || !alt.timestamps.length));
    });
  };
  
  module.exports.ERROR_NO_TIMESTAMPS = 'NO_TIMESTAMPS';
  
  
  /***/ }),
  /* 41 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var contentType = __webpack_require__(18);
  var bufferFrom = __webpack_require__(15);
  
  /**
   * Plays audio from a URL
   * Compatible with Mobile Safari if triggered in direct response to a user interaction (e.g. click)
   * @param {String} url
   * @constructor
   */
  function UrlPlayer(url) {
    var audio = (this.audio = new Audio());
    audio.src = url;
    audio.play();
    /**
     * Stops the audio
     */
    this.stop = function stop() {
      audio.pause();
      audio.currentTime = 0;
    };
  }
  
  /**
   * Plays audio from File/Blob instances
   * @param {File|Blob} file
   * @param {String} contentType
   * @constructor
   */
  function FilePlayer(file, contentType) {
    var audio = (this.audio = new Audio());
    if (audio.canPlayType(contentType)) {
      audio.src = URL.createObjectURL(new Blob([file], { type: contentType }));
      audio.play();
    } else {
      // if we emit an error, it prevents the promise from returning the actual result
      // however, most browsers do not support flac, so this is a reasonably scenario
      var err = new Error('Current browser is unable to play back ' + contentType);
      err.name = FilePlayer.ERROR_UNSUPPORTED_FORMAT;
      err.contentType = contentType;
      throw err;
    }
    /**
     * Stops the audio
     */
    this.stop = function stop() {
      audio.pause();
      audio.currentTime = 0;
    };
  }
  FilePlayer.ERROR_UNSUPPORTED_FORMAT = 'UNSUPPORTED_FORMAT';
  
  /**
   * Reads the first few bytes of a binary file and resolves to the content-type if recognized & supported
   * @param {File|Blob} file
   * @return {Promise}
   */
  function getContentTypeFromFile(file) {
    return new Promise(function(resolve, reject) {
      var blobToText = new Blob([file]).slice(0, 4);
      var r = new FileReader();
      r.readAsText(blobToText);
      r.onload = function() {
        var ct = contentType.fromHeader(bufferFrom(r.result));
        if (ct) {
          resolve(ct);
        } else {
          var err = new Error('Unable to determine content type from file header; only wav, flac, and ogg/opus are supported.');
          err.name = FilePlayer.ERROR_UNSUPPORTED_FORMAT;
          reject(err);
        }
      };
    });
  }
  
  /**
   * Determines the file's content-type and then resolves to a FilePlayer instance
   * @param {File|Blob|String} file - binary data or URL of audio file (binary data playback may not work on mobile Safari)
   * @param {String} [contentType] - optional content-type, will be sniffed from file header if unspecified
   * @return {Promise.<FilePlayer>}
   */
  function playFile(file, contentType) {
    if (typeof file === 'string') {
      return Promise.resolve(new UrlPlayer(file));
    }
    if (contentType) {
      return Promise.resolve(new FilePlayer(file, contentType));
    }
    return getContentTypeFromFile(file).then(function(sniffedContentType) {
      return new FilePlayer(file, sniffedContentType);
    });
  }
  
  module.exports = FilePlayer;
  module.exports.getContentType = getContentTypeFromFile;
  module.exports.playFile = playFile;
  
  
  /***/ }),
  /* 42 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(Buffer) {
  
  var Transform = __webpack_require__(1).Transform;
  var util = __webpack_require__(4);
  var defaults = __webpack_require__(10);
  var noTimestamps = __webpack_require__(40);
  
  /**
   * Slows results down to no faster than real time.
   *
   * Useful when running recognizeFile because the text can otherwise appear before the words are spoken
   *
   * @param {Object} [opts]
   * @param {*} [opts.emitAt=TimingStream.END] - set to TimingStream.START for a more subtitles-like output where results are returned as soon as the utterance begins
   * @param {Number} [opts.delay=0] - Additional delay (in seconds) to apply before emitting words, useful for precise syncing to audio tracks. May be negative
   * @constructor
   */
  function TimingStream(opts) {
    this.options = defaults(opts, {
      emitAt: TimingStream.END,
      delay: 0,
      allowHalfOpen: true, // keep the readable side open after the source closes
      writableObjectMode: true
    });
    Transform.call(this, opts);
  
    this.startTime = Date.now();
  
    // to support stopping mid-stream
    this.stopped = false;
    this.timeout = null;
  }
  util.inherits(TimingStream, Transform);
  
  TimingStream.START = 1;
  TimingStream.END = 2;
  
  TimingStream.prototype._transform = function(msg, encoding, next) {
    if (msg instanceof Buffer) {
      return next(new Error('TimingStream requires the source to be in objectMode'));
    }
    if (Array.isArray(msg.results) && msg.results.length && noTimestamps(msg)) {
      var err = new Error('TimingStream requires timestamps');
      err.name = noTimestamps.ERROR_NO_TIMESTAMPS;
      return next(err);
    }
  
    if (this.stopped) {
      return;
    }
  
    var delayMs = this.getDelayMs(msg);
  
    var objectMode = this.options.objectMode || this.options.readableObjectMode;
    var hasTranscript = Array.isArray(msg.results && msg.results.length);
  
    // to support text mode
    if (!objectMode && hasTranscript) {
      msg = msg.results[0].alternatives[0].transcript;
    }
  
    if (objectMode || hasTranscript) {
      this.timeout = setTimeout(function() {
        next(null, msg);
      }, delayMs);
    } else {
      return next();
    }
  };
  
  /**
   * Grabs the appropriate timestamp from the given message, depending on options.emitAt and the type of message
   *
   * @private
   * @param {Object} msg
   * @return {Number} timestamp
   */
  TimingStream.prototype.getMessageTime = function(msg) {
    if (this.options.emitAt === TimingStream.START) {
      if (Array.isArray(msg.results) && msg.results.length) {
        return msg.results[msg.results.length - 1].alternatives[0].timestamps[0][TimingStream.START];
      } else if (Array.isArray(msg.speaker_labels) && msg.speaker_labels.length) {
        return msg.speaker_labels[0].from;
      }
    } else {
      if (Array.isArray(msg.results) && msg.results.length) {
        var timestamps = msg.results[msg.results.length - 1].alternatives[0].timestamps;
        return timestamps[timestamps.length - 1][TimingStream.END];
      } else if (Array.isArray(msg.speaker_labels) && msg.speaker_labels.length) {
        return msg.speaker_labels[msg.speaker_labels.length - 1].to;
      }
    }
    return 0; // failsafe for unknown message types
  };
  
  /**
   * Gets the length of time to delay (in ms) before emitting the given message
   *
   * @private
   * @param {Object} msg
   * @return {Number} ms to delay
   */
  TimingStream.prototype.getDelayMs = function(msg) {
    var messageTime = this.getMessageTime(msg);
    var nextTickTime = this.startTime + messageTime * 1000; // ms since epoch
    var delayMs = nextTickTime - Date.now(); // ms from right now
    return Math.max(0, delayMs); // never return a negative number
  };
  
  /**
   * Overrides the start time, adjusting the delay applied to all pending results.
   *
   * Stream may emit up to 1 more result based on the older time after this is called.
   *
   * @param {Number} [time=Date.now()] Start time in Miliseconds since epoch
   */
  TimingStream.prototype.setStartTime = function(time) {
    this.startTime = time || Date.now();
  };
  
  TimingStream.prototype.promise = __webpack_require__(9);
  
  // when stop is called, immediately stop emitting results
  TimingStream.prototype.stop = function stop() {
    this.stopped = true;
    clearTimeout(this.timeout);
    this.emit('stop');
  };
  
  module.exports = TimingStream;
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 43 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  
  /**
   * IBM Watson Speech JavaScript SDK
   *
   * Top-level module includes the version, and both of the speech libraries.
   *
   * If using a bundler such as browserify, you may optionally include sub-modules directly to reduce the size of the final bundle
   *
   * @module watson-speech
   */
  
  /**
   * Release version
   *
   * (for pre-built bundles only - if using via npm, read the package.json to determine the version)
   *
   * (This previously did `require('package.json').version` which works in browserify but causes webpack to choke with confusing errors unless extra plugins are included)
   *
   * envify automatically rewrites this during the release process
   */
  exports.version = "0.34.1";
  
  /**
   *
   * @see module:watson-speech/speech-to-text
   */
  exports.SpeechToText = __webpack_require__(44);
  
  /**
   *
   * @see module:watson-speech/text-to-speech
   */
  exports.TextToSpeech = __webpack_require__(98);
  
  
  /***/ }),
  /* 44 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(Buffer) {
  
  /**
   * IBM Watson Speech to Text JavaScript SDK
   *
   * The primary methods for interacting with the Speech to Text JS SDK are:
   *  * `recognizeMicrophone()` for live microphone input
   *  * `recognizeFile()` for file `<input>`'s and other data sources (e.g. a Blob loaded via AJAX)
   *
   * However, the underlying streams and utils that they use are also exposed for advanced usage.
   *
   * @module watson-speech/speech-to-text
   */
  
  module.exports = {
    // "easy-mode" API
    /**
     * @see module:watson-speech/speech-to-text/recognize-microphone
     */
    recognizeMicrophone: __webpack_require__(47),
    /**
     * @see module:watson-speech/speech-to-text/recognize-blob
     */
    recognizeFile: __webpack_require__(85),
    /**
     * @see module:watson-speech/speech-to-text/get-models
     */
    getModels: __webpack_require__(97),
    // individual components to build more customized solutions
    /**
     * @see WebAudioL16Stream
     */
    WebAudioL16Stream: __webpack_require__(37),
    /**
     * @see RecognizeStream
     */
    RecognizeStream: __webpack_require__(17),
    /**
     * @see FilePlayer
     */
    FilePlayer: __webpack_require__(41),
    /**
     * @see FormatStream
     */
    FormatStream: __webpack_require__(19),
    /**
     * @see TimingStream
     */
    TimingStream: __webpack_require__(42),
    /**
     * @see ResultStream
     */
    ResultStream: __webpack_require__(22),
    /**
     * @see SpeakerStream
     */
    SpeakerStream: __webpack_require__(23),
    /**
     * @see WritableElementStream
     */
    WritableElementStream: __webpack_require__(21),
    // external components exposed for convenience
  
    /**
     * @see https://www.npmjs.com/package/get-user-media-promise
     */
    getUserMedia: __webpack_require__(25),
    /**
     * @see https://www.npmjs.com/package/microphone-stream
     */
    MicrophoneStream: __webpack_require__(26),
    /**
     * @see https://nodejs.org/api/buffer.html
     */
    Buffer: Buffer
  };
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 45 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  exports.byteLength = byteLength
  exports.toByteArray = toByteArray
  exports.fromByteArray = fromByteArray
  
  var lookup = []
  var revLookup = []
  var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  
  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
  
  function placeHoldersCount (b64) {
    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
    return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
  }
  
  function byteLength (b64) {
    // base64 is 4/3 + up to two characters of the original data
    return b64.length * 3 / 4 - placeHoldersCount(b64)
  }
  
  function toByteArray (b64) {
    var i, j, l, tmp, placeHolders, arr
    var len = b64.length
    placeHolders = placeHoldersCount(b64)
  
    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('')
  }
  
  
  /***/ }),
  /* 46 */
  /***/ (function(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
  }
  
  
  /***/ }),
  /* 47 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  var getUserMedia = __webpack_require__(25);
  var MicrophoneStream = __webpack_require__(26);
  var RecognizeStream = __webpack_require__(17);
  var L16 = __webpack_require__(37);
  var FormatStream = __webpack_require__(19);
  var assign = __webpack_require__(38)();
  var WritableElementStream = __webpack_require__(21);
  var Writable = __webpack_require__(1).Writable;
  var ResultStream = __webpack_require__(22);
  var SpeakerStream = __webpack_require__(23);
  
  var preservedMicStream;
  var bitBucket = new Writable({
    write: function(chunk, encoding, callback) {
      // when the keepMicrophone option is enabled, unused audio data is sent here so that it isn't buffered by other streams.
      callback();
    },
    objectMode: true, // can still accept strings/buffers
    decodeStrings: false
  });
  
  /**
   * @module watson-speech/speech-to-text/recognize-microphone
   */
  
  /**
   * Create and return a RecognizeStream sourcing audio from the user's microphone
   *
   * @param {Object} options - Also passed to {RecognizeStream}, and {FormatStream} when applicable
   * @param {String} options.token - Auth Token - see https://github.com/watson-developer-cloud/node-sdk#authorization
   * @param {Boolean} [options.format=true] - pipe the text through a FormatStream which performs light formatting. Also controls smart_formatting option unless explicitly set.
   * @param {Boolean} [options.keepMicrophone=false] - keeps an internal reference to the microphone stream to reuse in subsequent calls (prevents multiple permissions dialogs in firefox)
   * @param {String|DOMElement} [options.outputElement] pipe the text to a [WriteableElementStream](WritableElementStream.html) targeting the specified element. Also defaults objectMode to true to enable interim results.
   * @param {Boolean} [options.extractResults=false] pipe results through a ResultStream stream to simplify the objects. (Default behavior before v0.22) Requires objectMode.
   * @param {Boolean} [options.resultsBySpeaker=false] Pipe results through a SpeakerStream. Forces speaker_labels and objectMode to be true.
   * @param {MediaStream} [options.mediaStream] Optionally pass in an existing MediaStream
   *
   * @return {RecognizeStream|SpeakerStream|FormatStream|ResultStream}
   */
  module.exports = function recognizeMicrophone(options) {
    if (!options || !options.token) {
      throw new Error('WatsonSpeechToText: missing required parameter: opts.token');
    }
  
    // the WritableElementStream works best in objectMode
    if (options.outputElement && options.objectMode !== false) {
      options.objectMode = true;
    }
    // the ResultExtractor only works in objectMode
    if (options.extractResults) {
      options.objectMode = true;
    }
    // SpeakerStream requires objectMode and speaker_labels
    if (options.resultsBySpeaker) {
      options.objectMode = true;
      options.speaker_labels = true;
    }
  
    // default format to true (capitals and periods)
    // default smart_formatting to options.format value (dates, currency, etc.)
    options.format = options.format !== false;
    if (typeof options.smart_formatting === 'undefined') {
      options.smart_formatting = options.format;
    }
  
    var rsOpts = assign(
      {
        'content-type': 'audio/l16;rate=16000',
        interim_results: true
      },
      options
    );
  
    var recognizeStream = new RecognizeStream(rsOpts);
    var streams = [recognizeStream]; // collect all of the streams so that we can bundle up errors and send them to the last one
  
    // set up the output first so that we have a place to emit errors
    // if there's trouble with the input stream
    var stream = recognizeStream;
  
    var keepMic = options.keepMicrophone;
    var micStream;
    if (keepMic && preservedMicStream) {
      preservedMicStream.unpipe(bitBucket);
      micStream = preservedMicStream;
    } else {
      // create the MicrophoneStream synchronously to allow it to resume the context in Safari on iOS 11
      micStream = new MicrophoneStream({
        objectMode: true,
        bufferSize: options.bufferSize
      });
      var pm = options.mediaStream ? Promise.resolve(options.mediaStream) : getUserMedia({ video: false, audio: true });
      pm
        .then(function(mediaStream) {
          micStream.setStream(mediaStream);
          if (keepMic) {
            preservedMicStream = micStream;
          }
        })
        .catch(function(err) {
          stream.emit('error', err);
          if (err.name === 'NotSupportedError') {
            stream.end(); // end the stream
          }
        });
    }
  
    var l16Stream = new L16({ writableObjectMode: true });
  
    micStream.pipe(l16Stream).pipe(recognizeStream);
  
    streams.push(micStream, l16Stream);
  
    /**
     * unpipes the mic stream to prevent any more audio from being sent over the wire
     * temporarily re-pipes it to the bitBucket (basically /dev/null)  becuse
     * otherwise it will buffer the audio from in between calls and prepend it to the next one
     *
     * @private
     */
    function end() {
      micStream.unpipe(l16Stream);
      micStream.pipe(bitBucket);
      l16Stream.end();
    }
    // trigger on both stop and end events:
    // stop will not fire when a stream ends due to a timeout
    // but when stop does fire, we want to honor it immediately
    // end will always fire, but it may take a few moments after stop
    if (keepMic) {
      recognizeStream.on('end', end);
      recognizeStream.on('stop', end);
    } else {
      recognizeStream.on('end', micStream.stop.bind(micStream));
      recognizeStream.on('stop', micStream.stop.bind(micStream));
    }
  
    if (options.resultsBySpeaker) {
      stream = stream.pipe(new SpeakerStream(options));
      streams.push(stream);
    }
  
    if (options.format) {
      stream = stream.pipe(new FormatStream(options));
      streams.push(stream);
    }
  
    if (options.outputElement) {
      // we don't want to return the WES, just send data to it
      streams.push(stream.pipe(new WritableElementStream(options)));
    }
  
    if (options.extractResults) {
      stream = stream.pipe(new ResultStream());
      streams.push(stream);
    }
  
    // Capture errors from any stream except the last one and emit them on the last one
    streams.forEach(function(prevStream) {
      if (prevStream !== stream) {
        prevStream.on('error', stream.emit.bind(stream, 'error'));
      }
    });
  
    if (stream !== recognizeStream) {
      // add a stop button to whatever the final stream ends up being
      stream.stop = recognizeStream.stop.bind(recognizeStream);
    }
  
    // expose the original stream to for debugging (and to support the JSON tab on the STT demo)
    stream.recognizeStream = recognizeStream;
  
    return stream;
  };
  
  module.exports.isSupported = getUserMedia.isSupported;
  
  
  /***/ }),
  /* 48 */
  /***/ (function(module, exports) {
  
  /* (ignored) */
  
  /***/ }),
  /* 49 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var Buffer = __webpack_require__(0).Buffer;
  /*<replacement>*/
  var bufferShim = __webpack_require__(13);
  /*</replacement>*/
  
  module.exports = BufferList;
  
  function BufferList() {
    this.head = null;
    this.tail = null;
    this.length = 0;
  }
  
  BufferList.prototype.push = function (v) {
    var entry = { data: v, next: null };
    if (this.length > 0) this.tail.next = entry;else this.head = entry;
    this.tail = entry;
    ++this.length;
  };
  
  BufferList.prototype.unshift = function (v) {
    var entry = { data: v, next: this.head };
    if (this.length === 0) this.tail = entry;
    this.head = entry;
    ++this.length;
  };
  
  BufferList.prototype.shift = function () {
    if (this.length === 0) return;
    var ret = this.head.data;
    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
    --this.length;
    return ret;
  };
  
  BufferList.prototype.clear = function () {
    this.head = this.tail = null;
    this.length = 0;
  };
  
  BufferList.prototype.join = function (s) {
    if (this.length === 0) return '';
    var p = this.head;
    var ret = '' + p.data;
    while (p = p.next) {
      ret += s + p.data;
    }return ret;
  };
  
  BufferList.prototype.concat = function (n) {
    if (this.length === 0) return bufferShim.alloc(0);
    if (this.length === 1) return this.head.data;
    var ret = bufferShim.allocUnsafe(n >>> 0);
    var p = this.head;
    var i = 0;
    while (p) {
      p.data.copy(ret, i);
      i += p.data.length;
      p = p.next;
    }
    return ret;
  };
  
  /***/ }),
  /* 50 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var apply = Function.prototype.apply;
  
  // DOM APIs, for completeness
  
  exports.setTimeout = function() {
    return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  };
  exports.setInterval = function() {
    return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  };
  exports.clearTimeout =
  exports.clearInterval = function(timeout) {
    if (timeout) {
      timeout.close();
    }
  };
  
  function Timeout(id, clearFn) {
    this._id = id;
    this._clearFn = clearFn;
  }
  Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  Timeout.prototype.close = function() {
    this._clearFn.call(window, this._id);
  };
  
  // Does not start the time, just sets up the members needed.
  exports.enroll = function(item, msecs) {
    clearTimeout(item._idleTimeoutId);
    item._idleTimeout = msecs;
  };
  
  exports.unenroll = function(item) {
    clearTimeout(item._idleTimeoutId);
    item._idleTimeout = -1;
  };
  
  exports._unrefActive = exports.active = function(item) {
    clearTimeout(item._idleTimeoutId);
  
    var msecs = item._idleTimeout;
    if (msecs >= 0) {
      item._idleTimeoutId = setTimeout(function onTimeout() {
        if (item._onTimeout)
          item._onTimeout();
      }, msecs);
    }
  };
  
  // setimmediate attaches itself to the global object
  __webpack_require__(51);
  exports.setImmediate = setImmediate;
  exports.clearImmediate = clearImmediate;
  
  
  /***/ }),
  /* 51 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
      "use strict";
  
      if (global.setImmediate) {
          return;
      }
  
      var nextHandle = 1; // Spec says greater than zero
      var tasksByHandle = {};
      var currentlyRunningATask = false;
      var doc = global.document;
      var registerImmediate;
  
      function setImmediate(callback) {
        // Callback can either be a function or a string
        if (typeof callback !== "function") {
          callback = new Function("" + callback);
        }
        // Copy function arguments
        var args = new Array(arguments.length - 1);
        for (var i = 0; i < args.length; i++) {
            args[i] = arguments[i + 1];
        }
        // Store and register the task
        var task = { callback: callback, args: args };
        tasksByHandle[nextHandle] = task;
        registerImmediate(nextHandle);
        return nextHandle++;
      }
  
      function clearImmediate(handle) {
          delete tasksByHandle[handle];
      }
  
      function run(task) {
          var callback = task.callback;
          var args = task.args;
          switch (args.length) {
          case 0:
              callback();
              break;
          case 1:
              callback(args[0]);
              break;
          case 2:
              callback(args[0], args[1]);
              break;
          case 3:
              callback(args[0], args[1], args[2]);
              break;
          default:
              callback.apply(undefined, args);
              break;
          }
      }
  
      function runIfPresent(handle) {
          // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
          // So if we're currently running a task, we'll need to delay this invocation.
          if (currentlyRunningATask) {
              // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
              // "too much recursion" error.
              setTimeout(runIfPresent, 0, handle);
          } else {
              var task = tasksByHandle[handle];
              if (task) {
                  currentlyRunningATask = true;
                  try {
                      run(task);
                  } finally {
                      clearImmediate(handle);
                      currentlyRunningATask = false;
                  }
              }
          }
      }
  
      function installNextTickImplementation() {
          registerImmediate = function(handle) {
              process.nextTick(function () { runIfPresent(handle); });
          };
      }
  
      function canUsePostMessage() {
          // The test against `importScripts` prevents this implementation from being installed inside a web worker,
          // where `global.postMessage` means something completely different and can't be used for this purpose.
          if (global.postMessage && !global.importScripts) {
              var postMessageIsAsynchronous = true;
              var oldOnMessage = global.onmessage;
              global.onmessage = function() {
                  postMessageIsAsynchronous = false;
              };
              global.postMessage("", "*");
              global.onmessage = oldOnMessage;
              return postMessageIsAsynchronous;
          }
      }
  
      function installPostMessageImplementation() {
          // Installs an event handler on `global` for the `message` event: see
          // * https://developer.mozilla.org/en/DOM/window.postMessage
          // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  
          var messagePrefix = "setImmediate$" + Math.random() + "$";
          var onGlobalMessage = function(event) {
              if (event.source === global &&
                  typeof event.data === "string" &&
                  event.data.indexOf(messagePrefix) === 0) {
                  runIfPresent(+event.data.slice(messagePrefix.length));
              }
          };
  
          if (global.addEventListener) {
              global.addEventListener("message", onGlobalMessage, false);
          } else {
              global.attachEvent("onmessage", onGlobalMessage);
          }
  
          registerImmediate = function(handle) {
              global.postMessage(messagePrefix + handle, "*");
          };
      }
  
      function installMessageChannelImplementation() {
          var channel = new MessageChannel();
          channel.port1.onmessage = function(event) {
              var handle = event.data;
              runIfPresent(handle);
          };
  
          registerImmediate = function(handle) {
              channel.port2.postMessage(handle);
          };
      }
  
      function installReadyStateChangeImplementation() {
          var html = doc.documentElement;
          registerImmediate = function(handle) {
              // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
              // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
              var script = doc.createElement("script");
              script.onreadystatechange = function () {
                  runIfPresent(handle);
                  script.onreadystatechange = null;
                  html.removeChild(script);
                  script = null;
              };
              html.appendChild(script);
          };
      }
  
      function installSetTimeoutImplementation() {
          registerImmediate = function(handle) {
              setTimeout(runIfPresent, 0, handle);
          };
      }
  
      // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
      var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
      attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  
      // Don't get fooled by e.g. browserify environments.
      if ({}.toString.call(global.process) === "[object process]") {
          // For Node.js before 0.9
          installNextTickImplementation();
  
      } else if (canUsePostMessage()) {
          // For non-IE10 modern browsers
          installPostMessageImplementation();
  
      } else if (global.MessageChannel) {
          // For web workers, where supported
          installMessageChannelImplementation();
  
      } else if (doc && "onreadystatechange" in doc.createElement("script")) {
          // For IE 6–8
          installReadyStateChangeImplementation();
  
      } else {
          // For older browsers
          installSetTimeoutImplementation();
      }
  
      attachTo.setImmediate = setImmediate;
      attachTo.clearImmediate = clearImmediate;
  }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(3)))
  
  /***/ }),
  /* 52 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(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';
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
  
  /***/ }),
  /* 53 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  // a passthrough stream.
  // basically just the most minimal sort of Transform stream.
  // Every written chunk gets output as-is.
  
  
  
  module.exports = PassThrough;
  
  var Transform = __webpack_require__(30);
  
  /*<replacement>*/
  var util = __webpack_require__(8);
  util.inherits = __webpack_require__(2);
  /*</replacement>*/
  
  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);
  };
  
  /***/ }),
  /* 54 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(14);
  
  
  /***/ }),
  /* 55 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(5);
  
  
  /***/ }),
  /* 56 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(7).Transform
  
  
  /***/ }),
  /* 57 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(7).PassThrough
  
  
  /***/ }),
  /* 58 */
  /***/ (function(module, exports) {
  
  module.exports = function isBuffer(arg) {
    return arg && typeof arg === 'object'
      && typeof arg.copy === 'function'
      && typeof arg.fill === 'function'
      && typeof arg.readUInt8 === 'function';
  }
  
  /***/ }),
  /* 59 */
  /***/ (function(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
    }
  }
  
  
  /***/ }),
  /* 60 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Detect whether or not an object is an ArrayBuffer.
   * @version 1.4.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module is-array-buffer-x
   */
  
  /* global ArrayBuffer */
  
  
  
  var isObjectLike = __webpack_require__(61);
  var hasABuf = typeof ArrayBuffer === 'function';
  var toStringTag;
  var aBufTag;
  var bLength;
  
  if (hasABuf) {
    if (__webpack_require__(32)) {
      try {
        bLength = Object.getOwnPropertyDescriptor(
          ArrayBuffer.prototype,
          'byteLength'
        ).get;
        bLength = typeof bLength.call(new ArrayBuffer(4)) === 'number' && bLength;
      } catch (ignore) {}
    }
  
    if (Boolean(bLength) === false) {
      toStringTag = __webpack_require__(31);
      aBufTag = '[object ArrayBuffer]';
    }
  }
  
  /**
   * Determine if an `object` is an `ArrayBuffer`.
   *
   * @param {*} object - The object to test.
   * @returns {boolean} `true` if the `object` is an `ArrayBuffer`,
   *  else false`.
   * @example
   * var isArrayBuffer = require('is-array-buffer-x');
   *
   * isArrayBuffer(new ArrayBuffer(4)); // true
   * isArrayBuffer(null); // false
   * isArrayBuffer([]); // false
   */
  module.exports = function isArrayBuffer(object) {
    if (hasABuf === false || isObjectLike(object) === false) {
      return false;
    }
  
    if (Boolean(bLength) === false) {
      return toStringTag(object) === aBufTag;
    }
  
    try {
      return typeof bLength.call(object) === 'number';
    } catch (ignore) {}
  
    return false;
  };
  
  
  /***/ }),
  /* 61 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Determine if a value is object like.
   * @version 1.5.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module is-object-like-x
   */
  
  
  
  var isFunction = __webpack_require__(62);
  var isPrimitive = __webpack_require__(33);
  
  /**
   * Checks if `value` is object-like. A value is object-like if it's not a
   * primitive and not a function.
   *
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
   * @example
   * var isObjectLike = require('is-object-like-x');
   *
   * isObjectLike({});
   * // => true
   *
   * isObjectLike([1, 2, 3]);
   * // => true
   *
   * isObjectLike(_.noop);
   * // => false
   *
   * isObjectLike(null);
   * // => false
   */
  module.exports = function isObjectLike(value) {
    return isPrimitive(value) === false && isFunction(value, true) === false;
  };
  
  
  /***/ }),
  /* 62 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Determine whether a given value is a function object.
   * @version 3.1.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module is-function-x
   */
  
  
  
  var fToString = Function.prototype.toString;
  var toStringTag = __webpack_require__(31);
  var hasToStringTag = __webpack_require__(32);
  var isPrimitive = __webpack_require__(33);
  var normalise = __webpack_require__(66);
  var deComment = __webpack_require__(71);
  var funcTag = '[object Function]';
  var genTag = '[object GeneratorFunction]';
  var asyncTag = '[object AsyncFunction]';
  
  var hasNativeClass = true;
  try {
    // eslint-disable-next-line no-new-func
    Function('"use strict"; return class My {};')();
  } catch (ignore) {
    hasNativeClass = false;
  }
  
  var ctrRx = /^class /;
  var isES6ClassFn = function isES6ClassFunc(value) {
    try {
      return ctrRx.test(normalise(deComment(fToString.call(value), ' ')));
    } catch (ignore) {}
  
    // not a function
    return false;
  };
  
  /**
   * Checks if `value` is classified as a `Function` object.
   *
   * @private
   * @param {*} value - The value to check.
   * @param {boolean} allowClass - Whether to filter ES6 classes.
   * @returns {boolean} Returns `true` if `value` is correctly classified,
   * else `false`.
   */
  
  var tryFuncToString = function funcToString(value, allowClass) {
    try {
      if (hasNativeClass && allowClass === false && isES6ClassFn(value)) {
        return false;
      }
  
      fToString.call(value);
      return true;
    } catch (ignore) {}
  
    return false;
  };
  
  /**
   * Checks if `value` is classified as a `Function` object.
   *
   * @param {*} value - The value to check.
   * @param {boolean} [allowClass=false] - Whether to filter ES6 classes.
   * @returns {boolean} Returns `true` if `value` is correctly classified,
   * else `false`.
   * @example
   * var isFunction = require('is-function-x');
   *
   * isFunction(); // false
   * isFunction(Number.MIN_VALUE); // false
   * isFunction('abc'); // false
   * isFunction(true); // false
   * isFunction({ name: 'abc' }); // false
   * isFunction(function () {}); // true
   * isFunction(new Function ()); // true
   * isFunction(function* test1() {}); // true
   * isFunction(function test2(a, b) {}); // true
   * isFunction(async function test3() {}); // true
   * isFunction(class Test {}); // false
   * isFunction(class Test {}, true); // true
   * isFunction((x, y) => {return this;}); // true
   */
  module.exports = function isFunction(value) {
    if (isPrimitive(value)) {
      return false;
    }
  
    var allowClass = arguments.length > 0 ? Boolean(arguments[1]) : false;
    if (hasToStringTag) {
      return tryFuncToString(value, allowClass);
    }
  
    if (hasNativeClass && allowClass === false && isES6ClassFn(value)) {
      return false;
    }
  
    var strTag = toStringTag(value);
    return strTag === funcTag || strTag === genTag || strTag === asyncTag;
  };
  
  
  /***/ }),
  /* 63 */
  /***/ (function(module, exports) {
  
  /**
   * lodash 3.0.0 (Custom Build) <https://lodash.com/>
   * Build: `lodash modern modularize exports="npm" -o ./`
   * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
   * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
   * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   * Available under MIT license <https://lodash.com/license>
   */
  
  /**
   * Checks if `value` is `null`.
   *
   * @static
   * @memberOf _
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
   * @example
   *
   * _.isNull(null);
   * // => true
   *
   * _.isNull(void 0);
   * // => false
   */
  function isNull(value) {
    return value === null;
  }
  
  module.exports = isNull;
  
  
  /***/ }),
  /* 64 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
  *
  *	VALIDATE: undefined
  *
  *
  *	DESCRIPTION:
  *		- Validates if a value is undefined.
  *
  *
  *	NOTES:
  *		[1]
  *
  *
  *	TODO:
  *		[1]
  *
  *
  *	LICENSE:
  *		MIT
  *
  *	Copyright (c) 2014. Athan Reines.
  *
  *
  *	AUTHOR:
  *		Athan Reines. kgryte@gmail.com. 2014.
  *
  */
  
  
  
  /**
  * FUNCTION: isUndefined( value )
  *	Validates if a value is undefined.
  *
  * @param {*} value - value to be validated
  * @returns {Boolean} boolean indicating whether value is undefined
  */
  function isUndefined( value ) {
  	return value === void 0;
  } // end FUNCTION isUndefined()
  
  
  // EXPORTS //
  
  module.exports = isUndefined;
  
  
  /***/ }),
  /* 65 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Tests if ES6 Symbol is supported.
   * @version 1.4.0
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module has-symbol-support-x
   */
  
  
  
  /**
   * Indicates if `Symbol`exists and creates the correct type.
   * `true`, if it exists and creates the correct type, otherwise `false`.
   *
   * @type boolean
   */
  module.exports = typeof Symbol === 'function' && typeof Symbol('') === 'symbol';
  
  
  /***/ }),
  /* 66 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Trims and replaces sequences of whitespace characters by a single space.
   * @version 1.3.2
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module normalize-space-x
   */
  
  
  
  var trim = __webpack_require__(67);
  var reNormalize = new RegExp('[' + __webpack_require__(16).string + ']+', 'g');
  
  /**
   * This method strips leading and trailing white-space from a string,
   * replaces sequences of whitespace characters by a single space,
   * and returns the resulting string.
   *
   * @param {string} string - The string to be normalized.
   * @returns {string} The normalized string.
   * @example
   * var normalizeSpace = require('normalize-space-x');
   *
   * normalizeSpace(' \t\na \t\nb \t\n') === 'a b'; // true
   */
  module.exports = function normalizeSpace(string) {
    return trim(string).replace(reNormalize, ' ');
  };
  
  
  /***/ }),
  /* 67 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file This method removes whitespace from the left and right end of a string.
   * @version 1.0.2
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module trim-x
   */
  
  
  
  var trimLeft = __webpack_require__(68);
  var trimRight = __webpack_require__(70);
  
  /**
   * This method removes whitespace from the left and right end of a string.
   *
   * @param {string} string - The string to trim the whitespace from.
   * @returns {undefined|string} The trimmed string.
   * @example
   * var trim = require('trim-x');
   *
   * trim(' \t\na \t\n') === 'a'; // true
   */
  module.exports = function trim(string) {
    return trimLeft(trimRight(string));
  };
  
  
  /***/ }),
  /* 68 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file This method removes whitespace from the left end of a string.
   * @version 1.3.3
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module trim-left-x
   */
  
  
  
  var $toString = __webpack_require__(34);
  var reLeft = new RegExp('^[' + __webpack_require__(16).string + ']+');
  
  /**
   * This method removes whitespace from the left end of a string.
   *
   * @param {string} string - The string to trim the left end whitespace from.
   * @returns {undefined|string} The left trimmed string.
   * @example
   * var trimLeft = require('trim-left-x');
   *
   * trimLeft(' \t\na \t\n') === 'a \t\n'; // true
   */
  module.exports = function trimLeft(string) {
    return $toString(string).replace(reLeft, '');
  };
  
  
  /***/ }),
  /* 69 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var toStr = Object.prototype.toString;
  var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
  
  if (hasSymbols) {
  	var symToStr = Symbol.prototype.toString;
  	var symStringRegex = /^Symbol\(.*\)$/;
  	var isSymbolObject = function isSymbolObject(value) {
  		if (typeof value.valueOf() !== 'symbol') { return false; }
  		return symStringRegex.test(symToStr.call(value));
  	};
  	module.exports = function isSymbol(value) {
  		if (typeof value === 'symbol') { return true; }
  		if (toStr.call(value) !== '[object Symbol]') { return false; }
  		try {
  			return isSymbolObject(value);
  		} catch (e) {
  			return false;
  		}
  	};
  } else {
  	module.exports = function isSymbol(value) {
  		// this environment does not support Symbols.
  		return false;
  	};
  }
  
  
  /***/ }),
  /* 70 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file This method removes whitespace from the right end of a string.
   * @version 1.3.2
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module trim-right-x
   */
  
  
  
  var $toString = __webpack_require__(34);
  var reRight = new RegExp('[' + __webpack_require__(16).string + ']+$');
  
  /**
   * This method removes whitespace from the right end of a string.
   *
   * @param {string} string - The string to trim the right end whitespace from.
   * @returns {undefined|string} The right trimmed string.
   * @example
   * var trimRight = require('trim-right-x');
   *
   * trimRight(' \t\na \t\n') === ' \t\na'; // true
   */
  module.exports = function trimRight(string) {
    return $toString(string).replace(reRight, '');
  };
  
  
  /***/ }),
  /* 71 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * @file Replace the comments in a string.
   * @version 1.0.1
   * @author Xotic750 <Xotic750@gmail.com>
   * @copyright  Xotic750
   * @license {@link <https://opensource.org/licenses/MIT> MIT}
   * @module replace-comments-x
   */
  
  
  
  var isString = __webpack_require__(72);
  var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
  
  var $replaceComments = function replaceComments(string) {
    var replacement = arguments.length > 1 && isString(arguments[1]) ? arguments[1] : '';
    return isString(string) ? string.replace(STRIP_COMMENTS, replacement) : '';
  };
  
  /**
   * This method replaces comments in a string.
   *
   * @param {string} string - The string to be stripped.
   * @param {string} [replacement] - The string to be used as a replacement.
   * @returns {string} The new string with the comments replaced.
   * @example
   * var replaceComments = require('replace-comments-x');
   *
   * replaceComments(test;/* test * /, ''), // 'test;'
   * replaceComments(test; // test, ''), // 'test;'
   */
  module.exports = $replaceComments;
  
  
  /***/ }),
  /* 72 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var strValue = String.prototype.valueOf;
  var tryStringObject = function tryStringObject(value) {
  	try {
  		strValue.call(value);
  		return true;
  	} catch (e) {
  		return false;
  	}
  };
  var toStr = Object.prototype.toString;
  var strClass = '[object String]';
  var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
  
  module.exports = function isString(value) {
  	if (typeof value === 'string') { return true; }
  	if (typeof value !== 'object') { return false; }
  	return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;
  };
  
  
  /***/ }),
  /* 73 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /*!
   * isobject <https://github.com/jonschlinkert/isobject>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   */
  
  
  
  module.exports = function isObject(val) {
    return val != null && typeof val === 'object' && Array.isArray(val) === false;
  };
  
  
  /***/ }),
  /* 74 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var _global = (function() { return this; })();
  var NativeWebSocket = _global.WebSocket || _global.MozWebSocket;
  var websocket_version = __webpack_require__(75);
  
  
  /**
   * Expose a W3C WebSocket class with just one or two arguments.
   */
  function W3CWebSocket(uri, protocols) {
  	var native_instance;
  
  	if (protocols) {
  		native_instance = new NativeWebSocket(uri, protocols);
  	}
  	else {
  		native_instance = new NativeWebSocket(uri);
  	}
  
  	/**
  	 * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
  	 * class). Since it is an Object it will be returned as it is when creating an
  	 * instance of W3CWebSocket via 'new W3CWebSocket()'.
  	 *
  	 * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
  	 */
  	return native_instance;
  }
  
  
  /**
   * Module exports.
   */
  module.exports = {
      'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,
      'version'      : websocket_version
  };
  
  
  /***/ }),
  /* 75 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(76).version;
  
  
  /***/ }),
  /* 76 */
  /***/ (function(module, exports) {
  
  module.exports = {"_args":[[{"raw":"websocket@^1.0.24","scope":null,"escapedName":"websocket","name":"websocket","rawSpec":"^1.0.24","spec":">=1.0.24 <2.0.0","type":"range"},"/Users/nfriedly/watson-speech"]],"_from":"websocket@>=1.0.24 <2.0.0","_id":"websocket@1.0.24","_inCache":true,"_location":"/websocket","_nodeVersion":"7.3.0","_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/websocket-1.0.24.tgz_1482977757939_0.1858439394272864"},"_npmUser":{"name":"theturtle32","email":"brian@worlize.com"},"_npmVersion":"3.10.10","_phantomChildren":{},"_requested":{"raw":"websocket@^1.0.24","scope":null,"escapedName":"websocket","name":"websocket","rawSpec":"^1.0.24","spec":">=1.0.24 <2.0.0","type":"range"},"_requiredBy":["/","/watson-developer-cloud"],"_resolved":"https://registry.npmjs.org/websocket/-/websocket-1.0.24.tgz","_shasum":"74903e75f2545b6b2e1de1425bc1c905917a1890","_shrinkwrap":null,"_spec":"websocket@^1.0.24","_where":"/Users/nfriedly/watson-speech","author":{"name":"Brian McKelvey","email":"brian@worlize.com","url":"https://www.worlize.com/"},"browser":"lib/browser.js","bugs":{"url":"https://github.com/theturtle32/WebSocket-Node/issues"},"config":{"verbose":false},"contributors":[{"name":"Iñaki Baz Castillo","email":"ibc@aliax.net","url":"http://dev.sipdoc.net"}],"dependencies":{"debug":"^2.2.0","nan":"^2.3.3","typedarray-to-buffer":"^3.1.2","yaeti":"^0.0.6"},"description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","devDependencies":{"buffer-equal":"^1.0.0","faucet":"^0.0.1","gulp":"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jshint":"^2.0.4","jshint":"^2.0.0","jshint-stylish":"^2.2.1","tape":"^4.0.1"},"directories":{"lib":"./lib"},"dist":{"shasum":"74903e75f2545b6b2e1de1425bc1c905917a1890","tarball":"https://registry.npmjs.org/websocket/-/websocket-1.0.24.tgz"},"engines":{"node":">=0.8.0"},"gitHead":"0e15f9445953927c39ce84a232cb7dd6e3adf12e","homepage":"https://github.com/theturtle32/WebSocket-Node","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"license":"Apache-2.0","main":"index","maintainers":[{"name":"theturtle32","email":"brian@worlize.com"}],"name":"websocket","optionalDependencies":{},"readme":"ERROR: No README data found!","repository":{"type":"git","url":"git+https://github.com/theturtle32/WebSocket-Node.git"},"scripts":{"gulp":"gulp","install":"(node-gyp rebuild 2> builderror.log) || (exit 0)","test":"faucet test/unit"},"version":"1.0.24"}
  
  /***/ }),
  /* 77 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
  //
  // Permission is hereby granted, free of charge, to any person obtaining a
  // 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.
  
  // resolves . and .. elements in a path array with directory names there
  // must be no slashes, empty elements, or device names (c:\) in the array
  // (so also no leading and trailing slashes - it does not distinguish
  // relative and absolute paths)
  function normalizeArray(parts, allowAboveRoot) {
    // if the path tries to go above the root, `up` ends up > 0
    var up = 0;
    for (var i = parts.length - 1; i >= 0; i--) {
      var last = parts[i];
      if (last === '.') {
        parts.splice(i, 1);
      } else if (last === '..') {
        parts.splice(i, 1);
        up++;
      } else if (up) {
        parts.splice(i, 1);
        up--;
      }
    }
  
    // if the path is allowed to go above the root, restore leading ..s
    if (allowAboveRoot) {
      for (; up--; up) {
        parts.unshift('..');
      }
    }
  
    return parts;
  }
  
  // Split a filename into [root, dir, basename, ext], unix version
  // 'root' is just a slash, or nothing.
  var splitPathRe =
      /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  var splitPath = function(filename) {
    return splitPathRe.exec(filename).slice(1);
  };
  
  // path.resolve([from ...], to)
  // posix version
  exports.resolve = function() {
    var resolvedPath = '',
        resolvedAbsolute = false;
  
    for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
      var path = (i >= 0) ? arguments[i] : process.cwd();
  
      // Skip empty and invalid entries
      if (typeof path !== 'string') {
        throw new TypeError('Arguments to path.resolve must be strings');
      } else if (!path) {
        continue;
      }
  
      resolvedPath = path + '/' + resolvedPath;
      resolvedAbsolute = path.charAt(0) === '/';
    }
  
    // At this point the path should be resolved to a full absolute path, but
    // handle relative paths to be safe (might happen when process.cwd() fails)
  
    // Normalize the path
    resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
      return !!p;
    }), !resolvedAbsolute).join('/');
  
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  };
  
  // path.normalize(path)
  // posix version
  exports.normalize = function(path) {
    var isAbsolute = exports.isAbsolute(path),
        trailingSlash = substr(path, -1) === '/';
  
    // Normalize the path
    path = normalizeArray(filter(path.split('/'), function(p) {
      return !!p;
    }), !isAbsolute).join('/');
  
    if (!path && !isAbsolute) {
      path = '.';
    }
    if (path && trailingSlash) {
      path += '/';
    }
  
    return (isAbsolute ? '/' : '') + path;
  };
  
  // posix version
  exports.isAbsolute = function(path) {
    return path.charAt(0) === '/';
  };
  
  // posix version
  exports.join = function() {
    var paths = Array.prototype.slice.call(arguments, 0);
    return exports.normalize(filter(paths, function(p, index) {
      if (typeof p !== 'string') {
        throw new TypeError('Arguments to path.join must be strings');
      }
      return p;
    }).join('/'));
  };
  
  
  // path.relative(from, to)
  // posix version
  exports.relative = function(from, to) {
    from = exports.resolve(from).substr(1);
    to = exports.resolve(to).substr(1);
  
    function trim(arr) {
      var start = 0;
      for (; start < arr.length; start++) {
        if (arr[start] !== '') break;
      }
  
      var end = arr.length - 1;
      for (; end >= 0; end--) {
        if (arr[end] !== '') break;
      }
  
      if (start > end) return [];
      return arr.slice(start, end - start + 1);
    }
  
    var fromParts = trim(from.split('/'));
    var toParts = trim(to.split('/'));
  
    var length = Math.min(fromParts.length, toParts.length);
    var samePartsLength = length;
    for (var i = 0; i < length; i++) {
      if (fromParts[i] !== toParts[i]) {
        samePartsLength = i;
        break;
      }
    }
  
    var outputParts = [];
    for (var i = samePartsLength; i < fromParts.length; i++) {
      outputParts.push('..');
    }
  
    outputParts = outputParts.concat(toParts.slice(samePartsLength));
  
    return outputParts.join('/');
  };
  
  exports.sep = '/';
  exports.delimiter = ':';
  
  exports.dirname = function(path) {
    var result = splitPath(path),
        root = result[0],
        dir = result[1];
  
    if (!root && !dir) {
      // No dirname whatsoever
      return '.';
    }
  
    if (dir) {
      // It has a dirname, strip trailing slash
      dir = dir.substr(0, dir.length - 1);
    }
  
    return root + dir;
  };
  
  
  exports.basename = function(path, ext) {
    var f = splitPath(path)[2];
    // TODO: make this comparison case-insensitive on windows?
    if (ext && f.substr(-1 * ext.length) === ext) {
      f = f.substr(0, f.length - ext.length);
    }
    return f;
  };
  
  
  exports.extname = function(path) {
    return splitPath(path)[3];
  };
  
  function filter (xs, f) {
      if (xs.filter) return xs.filter(f);
      var res = [];
      for (var i = 0; i < xs.length; i++) {
          if (f(xs[i], i, xs)) res.push(xs[i]);
      }
      return res;
  }
  
  // String.prototype.substr - negative index don't work in IE8
  var substr = 'ab'.substr(-1) === 'b'
      ? function (str, start, len) { return str.substr(start, len) }
      : function (str, start, len) {
          if (start < 0) start = str.length + start;
          return str.substr(start, len);
      }
  ;
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
  
  /***/ }),
  /* 78 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {var clone = (function() {
  'use strict';
  
  /**
   * Clones (copies) an Object using deep copying.
   *
   * This function supports circular references by default, but if you are certain
   * there are no circular references in your object, you can save some CPU time
   * by calling clone(obj, false).
   *
   * Caution: if `circular` is false and `parent` contains circular references,
   * your program may enter an infinite loop and crash.
   *
   * @param `parent` - the object to be cloned
   * @param `circular` - set to true if the object to be cloned may contain
   *    circular references. (optional - true by default)
   * @param `depth` - set to a number if the object is only to be cloned to
   *    a particular depth. (optional - defaults to Infinity)
   * @param `prototype` - sets the prototype to be used when cloning an object.
   *    (optional - defaults to parent prototype).
  */
  function clone(parent, circular, depth, prototype) {
    var filter;
    if (typeof circular === 'object') {
      depth = circular.depth;
      prototype = circular.prototype;
      filter = circular.filter;
      circular = circular.circular
    }
    // maintain two arrays for circular references, where corresponding parents
    // and children have the same index
    var allParents = [];
    var allChildren = [];
  
    var useBuffer = typeof Buffer != 'undefined';
  
    if (typeof circular == 'undefined')
      circular = true;
  
    if (typeof depth == 'undefined')
      depth = Infinity;
  
    // recurse this function so we don't reset allParents and allChildren
    function _clone(parent, depth) {
      // cloning null always returns null
      if (parent === null)
        return null;
  
      if (depth == 0)
        return parent;
  
      var child;
      var proto;
      if (typeof parent != 'object') {
        return parent;
      }
  
      if (clone.__isArray(parent)) {
        child = [];
      } else if (clone.__isRegExp(parent)) {
        child = new RegExp(parent.source, __getRegExpFlags(parent));
        if (parent.lastIndex) child.lastIndex = parent.lastIndex;
      } else if (clone.__isDate(parent)) {
        child = new Date(parent.getTime());
      } else if (useBuffer && Buffer.isBuffer(parent)) {
        child = new Buffer(parent.length);
        parent.copy(child);
        return child;
      } else {
        if (typeof prototype == 'undefined') {
          proto = Object.getPrototypeOf(parent);
          child = Object.create(proto);
        }
        else {
          child = Object.create(prototype);
          proto = prototype;
        }
      }
  
      if (circular) {
        var index = allParents.indexOf(parent);
  
        if (index != -1) {
          return allChildren[index];
        }
        allParents.push(parent);
        allChildren.push(child);
      }
  
      for (var i in parent) {
        var attrs;
        if (proto) {
          attrs = Object.getOwnPropertyDescriptor(proto, i);
        }
  
        if (attrs && attrs.set == null) {
          continue;
        }
        child[i] = _clone(parent[i], depth - 1);
      }
  
      return child;
    }
  
    return _clone(parent, depth);
  }
  
  /**
   * Simple flat clone using prototype, accepts only objects, usefull for property
   * override on FLAT configuration object (no nested props).
   *
   * USE WITH CAUTION! This may not behave as you wish if you do not know how this
   * works.
   */
  clone.clonePrototype = function clonePrototype(parent) {
    if (parent === null)
      return null;
  
    var c = function () {};
    c.prototype = parent;
    return new c();
  };
  
  // private utility functions
  
  function __objToStr(o) {
    return Object.prototype.toString.call(o);
  };
  clone.__objToStr = __objToStr;
  
  function __isDate(o) {
    return typeof o === 'object' && __objToStr(o) === '[object Date]';
  };
  clone.__isDate = __isDate;
  
  function __isArray(o) {
    return typeof o === 'object' && __objToStr(o) === '[object Array]';
  };
  clone.__isArray = __isArray;
  
  function __isRegExp(o) {
    return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
  };
  clone.__isRegExp = __isRegExp;
  
  function __getRegExpFlags(re) {
    var flags = '';
    if (re.global) flags += 'g';
    if (re.ignoreCase) flags += 'i';
    if (re.multiline) flags += 'm';
    return flags;
  };
  clone.__getRegExpFlags = __getRegExpFlags;
  
  return clone;
  })();
  
  if (typeof module === 'object' && module.exports) {
    module.exports = clone;
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 79 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  // modified from https://github.com/es-shims/es6-shim
  var keys = __webpack_require__(39);
  var bind = __webpack_require__(81);
  var canBeObject = function (obj) {
  	return typeof obj !== 'undefined' && obj !== null;
  };
  var hasSymbols = __webpack_require__(83)();
  var toObject = Object;
  var push = bind.call(Function.call, Array.prototype.push);
  var propIsEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
  var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
  
  module.exports = function assign(target, source1) {
  	if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
  	var objTarget = toObject(target);
  	var s, source, i, props, syms, value, key;
  	for (s = 1; s < arguments.length; ++s) {
  		source = toObject(arguments[s]);
  		props = keys(source);
  		var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
  		if (getSymbols) {
  			syms = getSymbols(source);
  			for (i = 0; i < syms.length; ++i) {
  				key = syms[i];
  				if (propIsEnumerable(source, key)) {
  					push(props, key);
  				}
  			}
  		}
  		for (i = 0; i < props.length; ++i) {
  			key = props[i];
  			value = source[key];
  			if (propIsEnumerable(source, key)) {
  				objTarget[key] = value;
  			}
  		}
  	}
  	return objTarget;
  };
  
  
  /***/ }),
  /* 80 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var toStr = Object.prototype.toString;
  
  module.exports = function isArguments(value) {
  	var str = toStr.call(value);
  	var isArgs = str === '[object Arguments]';
  	if (!isArgs) {
  		isArgs = str !== '[object Array]' &&
  			value !== null &&
  			typeof value === 'object' &&
  			typeof value.length === 'number' &&
  			value.length >= 0 &&
  			toStr.call(value.callee) === '[object Function]';
  	}
  	return isArgs;
  };
  
  
  /***/ }),
  /* 81 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var implementation = __webpack_require__(82);
  
  module.exports = Function.prototype.bind || implementation;
  
  
  /***/ }),
  /* 82 */
  /***/ (function(module, exports) {
  
  var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  var slice = Array.prototype.slice;
  var toStr = Object.prototype.toString;
  var funcType = '[object Function]';
  
  module.exports = function bind(that) {
      var target = this;
      if (typeof target !== 'function' || toStr.call(target) !== funcType) {
          throw new TypeError(ERROR_MESSAGE + target);
      }
      var args = slice.call(arguments, 1);
  
      var bound;
      var binder = function () {
          if (this instanceof bound) {
              var result = target.apply(
                  this,
                  args.concat(slice.call(arguments))
              );
              if (Object(result) === result) {
                  return result;
              }
              return this;
          } else {
              return target.apply(
                  that,
                  args.concat(slice.call(arguments))
              );
          }
      };
  
      var boundLength = Math.max(0, target.length - args.length);
      var boundArgs = [];
      for (var i = 0; i < boundLength; i++) {
          boundArgs.push('$' + i);
      }
  
      bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
  
      if (target.prototype) {
          var Empty = function Empty() {};
          Empty.prototype = target.prototype;
          bound.prototype = new Empty();
          Empty.prototype = null;
      }
  
      return bound;
  };
  
  
  /***/ }),
  /* 83 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var keys = __webpack_require__(39);
  
  module.exports = function hasSymbols() {
  	if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
  	if (typeof Symbol.iterator === 'symbol') { return true; }
  
  	var obj = {};
  	var sym = Symbol('test');
  	var symObj = Object(sym);
  	if (typeof sym === 'string') { return false; }
  
  	if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
  	if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
  
  	// temp disabled per https://github.com/ljharb/object.assign/issues/17
  	// if (sym instanceof Symbol) { return false; }
  	// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  	// if (!(symObj instanceof Symbol)) { return false; }
  
  	var symVal = 42;
  	obj[sym] = symVal;
  	for (sym in obj) { return false; }
  	if (keys(obj).length !== 0) { return false; }
  	if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
  
  	if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
  
  	var syms = Object.getOwnPropertySymbols(obj);
  	if (syms.length !== 1 || syms[0] !== sym) { return false; }
  
  	if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
  
  	if (typeof Object.getOwnPropertyDescriptor === 'function') {
  		var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
  		if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
  	}
  
  	return true;
  };
  
  
  /***/ }),
  /* 84 */
  /***/ (function(module, exports) {
  
  /**
   * lodash (Custom Build) <https://lodash.com/>
   * Build: `lodash modularize exports="npm" -o ./`
   * Copyright jQuery Foundation and other contributors <https://jquery.org/>
   * Released under MIT license <https://lodash.com/license>
   * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
   * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   */
  
  /**
   * A specialized version of `_.map` for arrays without support for iteratee
   * shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns the new mapped array.
   */
  function arrayMap(array, iteratee) {
    var index = -1,
        length = array ? array.length : 0,
        result = Array(length);
  
    while (++index < length) {
      result[index] = iteratee(array[index], index, array);
    }
    return result;
  }
  
  /**
   * The base implementation of `_.findIndex` and `_.findLastIndex` without
   * support for iteratee shorthands.
   *
   * @private
   * @param {Array} array The array to search.
   * @param {Function} predicate The function invoked per iteration.
   * @param {number} fromIndex The index to search from.
   * @param {boolean} [fromRight] Specify iterating from right to left.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseFindIndex(array, predicate, fromIndex, fromRight) {
    var length = array.length,
        index = fromIndex + (fromRight ? 1 : -1);
  
    while ((fromRight ? index-- : ++index < length)) {
      if (predicate(array[index], index, array)) {
        return index;
      }
    }
    return -1;
  }
  
  /**
   * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
   *
   * @private
   * @param {Array} array The array to search.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseIndexOf(array, value, fromIndex) {
    if (value !== value) {
      return baseFindIndex(array, baseIsNaN, fromIndex);
    }
    var index = fromIndex - 1,
        length = array.length;
  
    while (++index < length) {
      if (array[index] === value) {
        return index;
      }
    }
    return -1;
  }
  
  /**
   * This function is like `baseIndexOf` except that it accepts a comparator.
   *
   * @private
   * @param {Array} array The array to search.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @param {Function} comparator The comparator invoked per element.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseIndexOfWith(array, value, fromIndex, comparator) {
    var index = fromIndex - 1,
        length = array.length;
  
    while (++index < length) {
      if (comparator(array[index], value)) {
        return index;
      }
    }
    return -1;
  }
  
  /**
   * The base implementation of `_.isNaN` without support for number objects.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
   */
  function baseIsNaN(value) {
    return value !== value;
  }
  
  /**
   * The base implementation of `_.unary` without support for storing metadata.
   *
   * @private
   * @param {Function} func The function to cap arguments for.
   * @returns {Function} Returns the new capped function.
   */
  function baseUnary(func) {
    return function(value) {
      return func(value);
    };
  }
  
  /** Used for built-in method references. */
  var arrayProto = Array.prototype;
  
  /** Built-in value references. */
  var splice = arrayProto.splice;
  
  /**
   * The base implementation of `_.pullAllBy` without support for iteratee
   * shorthands.
   *
   * @private
   * @param {Array} array The array to modify.
   * @param {Array} values The values to remove.
   * @param {Function} [iteratee] The iteratee invoked per element.
   * @param {Function} [comparator] The comparator invoked per element.
   * @returns {Array} Returns `array`.
   */
  function basePullAll(array, values, iteratee, comparator) {
    var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
        index = -1,
        length = values.length,
        seen = array;
  
    if (array === values) {
      values = copyArray(values);
    }
    if (iteratee) {
      seen = arrayMap(array, baseUnary(iteratee));
    }
    while (++index < length) {
      var fromIndex = 0,
          value = values[index],
          computed = iteratee ? iteratee(value) : value;
  
      while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
        if (seen !== array) {
          splice.call(seen, fromIndex, 1);
        }
        splice.call(array, fromIndex, 1);
      }
    }
    return array;
  }
  
  /**
   * Copies the values of `source` to `array`.
   *
   * @private
   * @param {Array} source The array to copy values from.
   * @param {Array} [array=[]] The array to copy values to.
   * @returns {Array} Returns `array`.
   */
  function copyArray(source, array) {
    var index = -1,
        length = source.length;
  
    array || (array = Array(length));
    while (++index < length) {
      array[index] = source[index];
    }
    return array;
  }
  
  /**
   * This method is like `_.pullAll` except that it accepts `comparator` which
   * is invoked to compare elements of `array` to `values`. The comparator is
   * invoked with two arguments: (arrVal, othVal).
   *
   * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
   *
   * @static
   * @memberOf _
   * @since 4.6.0
   * @category Array
   * @param {Array} array The array to modify.
   * @param {Array} values The values to remove.
   * @param {Function} [comparator] The comparator invoked per element.
   * @returns {Array} Returns `array`.
   * @example
   *
   * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
   *
   * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
   * console.log(array);
   * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
   */
  function pullAllWith(array, values, comparator) {
    return (array && array.length && values && values.length)
      ? basePullAll(array, values, undefined, comparator)
      : array;
  }
  
  module.exports = pullAllWith;
  
  
  /***/ }),
  /* 85 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  var BlobStream = __webpack_require__(86);
  var RecognizeStream = __webpack_require__(17);
  var FilePlayer = __webpack_require__(41);
  var FormatStream = __webpack_require__(19);
  var TimingStream = __webpack_require__(42);
  var assign = __webpack_require__(38)();
  var WritableElementStream = __webpack_require__(21);
  var ResultStream = __webpack_require__(22);
  var SpeakerStream = __webpack_require__(23);
  var contentType = __webpack_require__(18);
  var fetch = __webpack_require__(87); // like regular fetch, but with an extra method on the response to get a node-style ReadableStream
  
  /**
   * @module watson-speech/speech-to-text/recognize-file
   */
  
  /**
   * Create and return a RecognizeStream from a File or Blob
   * (e.g. from a file <input>, a dragdrop target, or an ajax request)
   *
   * @param {Object} options - Also passed to {MediaElementAudioStream} and to {RecognizeStream}
   * @param {String} options.token - Auth Token - see https://github.com/watson-developer-cloud/node-sdk#authorization
   * @param {Blob|FileString} options.file - String url or the raw audio data as a Blob or File instance to be transcribed (and optionally played). Playback may not with with Blob or File on mobile Safari.
   * @param {Boolean} [options.play=false] - If a file is set, play it locally as it's being uploaded
   * @param {Boolena} [options.format=true] - pipe the text through a {FormatStream} which performs light formatting. Also controls smart_formatting option unless explicitly set.
   * @param {Boolena} [options.realtime=options.play] - pipe the text through a {TimingStream} which slows the output down to real-time to match the audio playback.
   * @param {String|DOMElement} [options.outputElement] pipe the text to a WriteableElementStream targeting the specified element. Also defaults objectMode to true to enable interim results.
   * @param {Boolean} [options.extractResults=false] pipe results through a ResultExtractor stream to simplify the objects. (Default behavior before v0.22) Automatically enables objectMode.
   * @param {Boolean} [options.resultsBySpeaker=false] pipe results through a SpeakerStream. Causes each data event to include multiple results, each with a speaker field. Automatically enables objectMode and speaker_labels.  Adds some delay to processing.
   *
   * @return {RecognizeStream|SpeakerStream|FormatStream|ResultStream|TimingStream}
   */
  module.exports = function recognizeFile(options) {
    // eslint-disable-line complexity
    if (!options || !options.token) {
      throw new Error('WatsonSpeechToText: missing required parameter: opts.token');
    }
  
    if (options.data && !options.file) {
      options.file = options.data;
      delete options.data;
      if (!options.silent) {
        // eslint-disable-next-line no-console
        console.log(new Error('WatsonSpeechToText recognizeFile(): Warning data option was renamed to file. Set silent: true to hide this warning.'));
      }
    }
  
    // the WritableElementStream works best in objectMode
    if (options.outputElement && options.objectMode !== false) {
      options.objectMode = true;
    }
    // the ResultExtractor only works in objectMode
    if (options.extractResults) {
      options.objectMode = true;
    }
    // SpeakerStream requires objectMode and speaker_labels
    if (options.resultsBySpeaker) {
      options.objectMode = true;
      options.speaker_labels = true;
    }
  
    // default format to true (capitals and periods)
    // default smart_formatting to options.format value (dates, currency, etc.)
    options.format = options.format !== false;
    if (typeof options.smart_formatting === 'undefined') {
      options.smart_formatting = options.format;
    }
  
    var realtime = options.realtime || (typeof options.realtime === 'undefined' && options.play);
  
    // the timing stream requires timestamps to work, so enable them automatically
    if (realtime) {
      options.timestamps = true;
    }
  
    // Attempt to guess content-type based on filename
    // If this fails, recognizeStream will make a second attempt based on the file header
    if (!options['content-type']) {
      options['content-type'] = contentType.fromFilename(options.file);
    }
  
    var rsOpts = assign(
      {
        interim_results: true
      },
      options
    );
  
    var recognizeStream = new RecognizeStream(rsOpts);
    var streams = [recognizeStream]; // collect all of the streams so that we can bundle up errors and send them to the last one
    var stream = recognizeStream;
    if (typeof options.file === 'string') {
      fetch(options.file)
        .then(function(response) {
          return response.readable();
        })
        .then(function(source) {
          source.pipe(recognizeStream);
          streams.unshift(source);
        })
        .catch(function(er) {
          recognizeStream.emit('error', er);
        });
    } else {
      var source = new BlobStream(options.file);
      source.pipe(recognizeStream);
      streams.unshift(source);
    }
  
    // note: the TimingStream cannot currently handle results as regrouped by the SpeakerStream
    // so it must come first
    var timingStream;
    if (realtime) {
      timingStream = new TimingStream(options);
      stream = stream.pipe(timingStream);
      streams.push(stream);
      stream.on('stop', recognizeStream.stop.bind(recognizeStream));
    } else {
      stream.stop = recognizeStream.stop.bind(recognizeStream);
    }
  
    if (options.resultsBySpeaker) {
      stream = stream.pipe(new SpeakerStream(options));
      streams.push(stream);
    }
  
    // note: the format stream should come after the speaker stream to format sentences correctly
    if (options.format) {
      stream = stream.pipe(new FormatStream(options));
      streams.push(stream);
    }
  
    if (options.play) {
      // when file playback actually begins
      // (mostly important for downloaded files)
      FilePlayer.playFile(options.file, options['content-type'])
        .then(function(player) {
          recognizeStream.on('stop', player.stop.bind(player));
          recognizeStream.on('error', player.stop.bind(player));
  
          // for files loaded via URL, restet the start time of the timing stream to when it begins playing
          if (timingStream && typeof options.file === 'string') {
            // eslint-disable-next-line func-style
            var fn = function() {
              timingStream.setStartTime(); // defaults to Date.now()
              player.audio.removeEventListener('playing', fn);
            };
            player.audio.addEventListener('playing', fn);
          }
        })
        .catch(function(err) {
          // Node.js automatically unpipes any source stream(s) when an error is emitted (on the assumption that the previous stream's output caused the error.)
          // In this case, we don't want that behavior - a playback error should not stop the transcription
          // So, we have to:
          //   1. find the source streams
          //   2. emit the error (causing the automatic unpipe)
          //   3. re-pipe the source streams
  
          var sources = streams.filter(function(s) {
            return (
              s._readableState &&
              s._readableState.pipes &&
              (s._readableState.pipes === stream || (Array.isArray(s._readableState.pipes) && s._readableState.pipes.indexOf(stream) !== -1))
            );
          });
  
          stream.emit('error', err);
  
          sources.forEach(function(s) {
            s.pipe(stream);
          });
        });
    }
  
    if (options.outputElement) {
      // we don't want to return the WES, just send data to it
      streams.push(stream.pipe(new WritableElementStream(options)));
    }
  
    if (options.extractResults) {
      var stop = stream.stop ? stream.stop.bind(stream) : recognizeStream.stop.bind(recognizeStream);
      stream = stream.pipe(new ResultStream());
      stream.stop = stop;
      streams.push(stream);
    }
  
    // Capture errors from any stream except the last one and emit them on the last one
    streams.forEach(function(prevStream) {
      if (prevStream !== stream) {
        prevStream.on('error', stream.emit.bind(stream, 'error'));
      }
    });
  
    if (!stream.stop) {
      if (timingStream) {
        stream.stop = timingStream.stop.bind(timingStream);
      } else {
        stream.stop = recognizeStream.stop.bind(recognizeStream);
      }
    }
  
    // expose the original stream to for debugging (and to support the JSON tab on the STT demo)
    stream.recognizeStream = recognizeStream;
  
    return stream;
  };
  
  
  /***/ }),
  /* 86 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(global, Buffer) {
  
  var Readable = __webpack_require__(1).Readable;
  // When required from browserify, Buffer is also an Uint8Array, which is important for ejson.
  var inherits = __webpack_require__(2);
  var FileReader = global.FileReader;
  var Uint8Array = global.Uint8Array;
  
  /**
   * Read W3C Blob & File objects as a Node stream.
   * @param {Blob} blob
   * @constructor
   */
  function ReadableBlobStream(blob, opts)
  {
          if (!(this instanceof ReadableBlobStream)) {
            return new ReadableBlobStream(blob, opts);
          }
  
          opts = opts || {};
          opts.objectMode = false;
          Readable.call(this, opts);
  
          if (!blob)
          {
                  throw Error('Missing argument "blob"');
          }
  
          if (typeof blob.slice !== 'function')
          {
                  throw Error('Given argument "blob" is not really a Blob/File or your environment does not support .slice()');
          }
  
          if (!FileReader)
          {
                  throw Error('Your environment does not support FileReader');
          }
  
          if (!Uint8Array)
          {
                  throw Error('Your environment does not support Uint8Array');
          }
  
          this.totalSize = blob.size;
          this._blob = blob;
          this._nextByteStart = 0;
  }
  module.exports = ReadableBlobStream;
  inherits(ReadableBlobStream, Readable);
  
  function uint8ArrayToBuffer(buf)
  {
          if (typeof Buffer._augment === 'function')
          {
                  buf = Buffer._augment(buf);
  
                  if (!(buf instanceof Uint8Array))
                  {
                          throw Error('Assertion error, buf should be an Uint8Array');
                  }
          }
          else
          {
                  buf = new Buffer(buf);
          }
  
          return buf;
  }
  
  function bufferToUint8Array(buf)
  {
          buf = new Uint8Array(buf);
          if (typeof Buffer._augment === 'function')
          {
                  buf = Buffer._augment(buf);
                  // buf is now both an Uint8Array and an Buffer
          }
  
          if (!(buf instanceof Uint8Array))  // this is the check ejson uses
          {
                  // this is the check ejson uses
                  throw Error('Assertion error, buf should be an Uint8Array');
          }
  
          return buf;
  }
  
  ReadableBlobStream.prototype.read = function()
  {
          var buf = ReadableBlobStream.super_.prototype.read.apply(this, arguments);
  
          // make sure it is a Uint8Array in case browserify's Buffer
          // stops using Uint8Array
          if (Buffer.isBuffer(buf) && !(buf instanceof Uint8Array))
          {
                  buf = bufferToUint8Array(buf);
          }
  
          return buf;
  };
  
  ReadableBlobStream.prototype._read = function(chunkSize)
  {
          var size = this._blob.size;
          var start, end;
  
          start = this._nextByteStart;
          end = Math.min(start + chunkSize, size); // exclusive
          this._nextByteStart = end;
  
          if (start >= this._blob.size)
          {
                  return void this.push(null);
          }
  
          var chunk = this._blob.slice(start, end);
          var reader = new FileReader();
  
          reader.onload = function()
          {
                  // reader.result is an ArrayBuffer
                  var buf = new Uint8Array(reader.result);
                  buf = uint8ArrayToBuffer(buf);
  
                  this.push(buf);
          }.bind(this);
  
          reader.onerror = function()
          {
                  this.emit('error', reader.error);
          }.bind(this);
  
          reader.readAsArrayBuffer(chunk);
  };
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 87 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var isoFetch = __webpack_require__(88)
  var patchRequest = __webpack_require__(90)
  var patchResponse = __webpack_require__(94)
  
  function fetch (url, options) {
    return patchRequest(options).then(function (options) {
      return isoFetch(url, options).then(function (res) {
        return patchResponse(res)
      })
    })
  }
  
  module.exports = fetch
  
  
  /***/ }),
  /* 88 */
  /***/ (function(module, exports, __webpack_require__) {
  
  // the whatwg-fetch polyfill installs the fetch() function
  // on the global object (window or self)
  //
  // Return that as the export for use in Webpack, Browserify etc.
  __webpack_require__(89);
  module.exports = self.fetch.bind(self);
  
  
  /***/ }),
  /* 89 */
  /***/ (function(module, exports) {
  
  (function(self) {
    'use strict';
  
    if (self.fetch) {
      return
    }
  
    var support = {
      searchParams: 'URLSearchParams' in self,
      iterable: 'Symbol' in self && 'iterator' in Symbol,
      blob: 'FileReader' in self && 'Blob' in self && (function() {
        try {
          new Blob()
          return true
        } catch(e) {
          return false
        }
      })(),
      formData: 'FormData' in self,
      arrayBuffer: 'ArrayBuffer' in self
    }
  
    if (support.arrayBuffer) {
      var viewClasses = [
        '[object Int8Array]',
        '[object Uint8Array]',
        '[object Uint8ClampedArray]',
        '[object Int16Array]',
        '[object Uint16Array]',
        '[object Int32Array]',
        '[object Uint32Array]',
        '[object Float32Array]',
        '[object Float64Array]'
      ]
  
      var isDataView = function(obj) {
        return obj && DataView.prototype.isPrototypeOf(obj)
      }
  
      var isArrayBufferView = ArrayBuffer.isView || function(obj) {
        return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
      }
    }
  
    function normalizeName(name) {
      if (typeof name !== 'string') {
        name = String(name)
      }
      if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
        throw new TypeError('Invalid character in header field name')
      }
      return name.toLowerCase()
    }
  
    function normalizeValue(value) {
      if (typeof value !== 'string') {
        value = String(value)
      }
      return value
    }
  
    // Build a destructive iterator for the value list
    function iteratorFor(items) {
      var iterator = {
        next: function() {
          var value = items.shift()
          return {done: value === undefined, value: value}
        }
      }
  
      if (support.iterable) {
        iterator[Symbol.iterator] = function() {
          return iterator
        }
      }
  
      return iterator
    }
  
    function Headers(headers) {
      this.map = {}
  
      if (headers instanceof Headers) {
        headers.forEach(function(value, name) {
          this.append(name, value)
        }, this)
      } else if (Array.isArray(headers)) {
        headers.forEach(function(header) {
          this.append(header[0], header[1])
        }, this)
      } else if (headers) {
        Object.getOwnPropertyNames(headers).forEach(function(name) {
          this.append(name, headers[name])
        }, this)
      }
    }
  
    Headers.prototype.append = function(name, value) {
      name = normalizeName(name)
      value = normalizeValue(value)
      var oldValue = this.map[name]
      this.map[name] = oldValue ? oldValue+','+value : value
    }
  
    Headers.prototype['delete'] = function(name) {
      delete this.map[normalizeName(name)]
    }
  
    Headers.prototype.get = function(name) {
      name = normalizeName(name)
      return this.has(name) ? this.map[name] : null
    }
  
    Headers.prototype.has = function(name) {
      return this.map.hasOwnProperty(normalizeName(name))
    }
  
    Headers.prototype.set = function(name, value) {
      this.map[normalizeName(name)] = normalizeValue(value)
    }
  
    Headers.prototype.forEach = function(callback, thisArg) {
      for (var name in this.map) {
        if (this.map.hasOwnProperty(name)) {
          callback.call(thisArg, this.map[name], name, this)
        }
      }
    }
  
    Headers.prototype.keys = function() {
      var items = []
      this.forEach(function(value, name) { items.push(name) })
      return iteratorFor(items)
    }
  
    Headers.prototype.values = function() {
      var items = []
      this.forEach(function(value) { items.push(value) })
      return iteratorFor(items)
    }
  
    Headers.prototype.entries = function() {
      var items = []
      this.forEach(function(value, name) { items.push([name, value]) })
      return iteratorFor(items)
    }
  
    if (support.iterable) {
      Headers.prototype[Symbol.iterator] = Headers.prototype.entries
    }
  
    function consumed(body) {
      if (body.bodyUsed) {
        return Promise.reject(new TypeError('Already read'))
      }
      body.bodyUsed = true
    }
  
    function fileReaderReady(reader) {
      return new Promise(function(resolve, reject) {
        reader.onload = function() {
          resolve(reader.result)
        }
        reader.onerror = function() {
          reject(reader.error)
        }
      })
    }
  
    function readBlobAsArrayBuffer(blob) {
      var reader = new FileReader()
      var promise = fileReaderReady(reader)
      reader.readAsArrayBuffer(blob)
      return promise
    }
  
    function readBlobAsText(blob) {
      var reader = new FileReader()
      var promise = fileReaderReady(reader)
      reader.readAsText(blob)
      return promise
    }
  
    function readArrayBufferAsText(buf) {
      var view = new Uint8Array(buf)
      var chars = new Array(view.length)
  
      for (var i = 0; i < view.length; i++) {
        chars[i] = String.fromCharCode(view[i])
      }
      return chars.join('')
    }
  
    function bufferClone(buf) {
      if (buf.slice) {
        return buf.slice(0)
      } else {
        var view = new Uint8Array(buf.byteLength)
        view.set(new Uint8Array(buf))
        return view.buffer
      }
    }
  
    function Body() {
      this.bodyUsed = false
  
      this._initBody = function(body) {
        this._bodyInit = body
        if (!body) {
          this._bodyText = ''
        } else if (typeof body === 'string') {
          this._bodyText = body
        } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
          this._bodyBlob = body
        } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
          this._bodyFormData = body
        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
          this._bodyText = body.toString()
        } else if (support.arrayBuffer && support.blob && isDataView(body)) {
          this._bodyArrayBuffer = bufferClone(body.buffer)
          // IE 10-11 can't handle a DataView body.
          this._bodyInit = new Blob([this._bodyArrayBuffer])
        } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
          this._bodyArrayBuffer = bufferClone(body)
        } else {
          throw new Error('unsupported BodyInit type')
        }
  
        if (!this.headers.get('content-type')) {
          if (typeof body === 'string') {
            this.headers.set('content-type', 'text/plain;charset=UTF-8')
          } else if (this._bodyBlob && this._bodyBlob.type) {
            this.headers.set('content-type', this._bodyBlob.type)
          } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
            this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
          }
        }
      }
  
      if (support.blob) {
        this.blob = function() {
          var rejected = consumed(this)
          if (rejected) {
            return rejected
          }
  
          if (this._bodyBlob) {
            return Promise.resolve(this._bodyBlob)
          } else if (this._bodyArrayBuffer) {
            return Promise.resolve(new Blob([this._bodyArrayBuffer]))
          } else if (this._bodyFormData) {
            throw new Error('could not read FormData body as blob')
          } else {
            return Promise.resolve(new Blob([this._bodyText]))
          }
        }
  
        this.arrayBuffer = function() {
          if (this._bodyArrayBuffer) {
            return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
          } else {
            return this.blob().then(readBlobAsArrayBuffer)
          }
        }
      }
  
      this.text = function() {
        var rejected = consumed(this)
        if (rejected) {
          return rejected
        }
  
        if (this._bodyBlob) {
          return readBlobAsText(this._bodyBlob)
        } else if (this._bodyArrayBuffer) {
          return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
        } else if (this._bodyFormData) {
          throw new Error('could not read FormData body as text')
        } else {
          return Promise.resolve(this._bodyText)
        }
      }
  
      if (support.formData) {
        this.formData = function() {
          return this.text().then(decode)
        }
      }
  
      this.json = function() {
        return this.text().then(JSON.parse)
      }
  
      return this
    }
  
    // HTTP methods whose capitalization should be normalized
    var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
  
    function normalizeMethod(method) {
      var upcased = method.toUpperCase()
      return (methods.indexOf(upcased) > -1) ? upcased : method
    }
  
    function Request(input, options) {
      options = options || {}
      var body = options.body
  
      if (input instanceof Request) {
        if (input.bodyUsed) {
          throw new TypeError('Already read')
        }
        this.url = input.url
        this.credentials = input.credentials
        if (!options.headers) {
          this.headers = new Headers(input.headers)
        }
        this.method = input.method
        this.mode = input.mode
        if (!body && input._bodyInit != null) {
          body = input._bodyInit
          input.bodyUsed = true
        }
      } else {
        this.url = String(input)
      }
  
      this.credentials = options.credentials || this.credentials || 'omit'
      if (options.headers || !this.headers) {
        this.headers = new Headers(options.headers)
      }
      this.method = normalizeMethod(options.method || this.method || 'GET')
      this.mode = options.mode || this.mode || null
      this.referrer = null
  
      if ((this.method === 'GET' || this.method === 'HEAD') && body) {
        throw new TypeError('Body not allowed for GET or HEAD requests')
      }
      this._initBody(body)
    }
  
    Request.prototype.clone = function() {
      return new Request(this, { body: this._bodyInit })
    }
  
    function decode(body) {
      var form = new FormData()
      body.trim().split('&').forEach(function(bytes) {
        if (bytes) {
          var split = bytes.split('=')
          var name = split.shift().replace(/\+/g, ' ')
          var value = split.join('=').replace(/\+/g, ' ')
          form.append(decodeURIComponent(name), decodeURIComponent(value))
        }
      })
      return form
    }
  
    function parseHeaders(rawHeaders) {
      var headers = new Headers()
      rawHeaders.split(/\r?\n/).forEach(function(line) {
        var parts = line.split(':')
        var key = parts.shift().trim()
        if (key) {
          var value = parts.join(':').trim()
          headers.append(key, value)
        }
      })
      return headers
    }
  
    Body.call(Request.prototype)
  
    function Response(bodyInit, options) {
      if (!options) {
        options = {}
      }
  
      this.type = 'default'
      this.status = 'status' in options ? options.status : 200
      this.ok = this.status >= 200 && this.status < 300
      this.statusText = 'statusText' in options ? options.statusText : 'OK'
      this.headers = new Headers(options.headers)
      this.url = options.url || ''
      this._initBody(bodyInit)
    }
  
    Body.call(Response.prototype)
  
    Response.prototype.clone = function() {
      return new Response(this._bodyInit, {
        status: this.status,
        statusText: this.statusText,
        headers: new Headers(this.headers),
        url: this.url
      })
    }
  
    Response.error = function() {
      var response = new Response(null, {status: 0, statusText: ''})
      response.type = 'error'
      return response
    }
  
    var redirectStatuses = [301, 302, 303, 307, 308]
  
    Response.redirect = function(url, status) {
      if (redirectStatuses.indexOf(status) === -1) {
        throw new RangeError('Invalid status code')
      }
  
      return new Response(null, {status: status, headers: {location: url}})
    }
  
    self.Headers = Headers
    self.Request = Request
    self.Response = Response
  
    self.fetch = function(input, init) {
      return new Promise(function(resolve, reject) {
        var request = new Request(input, init)
        var xhr = new XMLHttpRequest()
  
        xhr.onload = function() {
          var options = {
            status: xhr.status,
            statusText: xhr.statusText,
            headers: parseHeaders(xhr.getAllResponseHeaders() || '')
          }
          options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
          var body = 'response' in xhr ? xhr.response : xhr.responseText
          resolve(new Response(body, options))
        }
  
        xhr.onerror = function() {
          reject(new TypeError('Network request failed'))
        }
  
        xhr.ontimeout = function() {
          reject(new TypeError('Network request failed'))
        }
  
        xhr.open(request.method, request.url, true)
  
        if (request.credentials === 'include') {
          xhr.withCredentials = true
        }
  
        if ('responseType' in xhr && support.blob) {
          xhr.responseType = 'blob'
        }
  
        request.headers.forEach(function(value, name) {
          xhr.setRequestHeader(name, value)
        })
  
        xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
      })
    }
    self.fetch.polyfill = true
  })(typeof self !== 'undefined' ? self : this);
  
  
  /***/ }),
  /* 90 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var bufferFromReadable = __webpack_require__(91)
  
  function patch (options) {
    options = options || {}
  
    if (options.body && options.body.readable) {
      return bufferFromReadable(options.body).then(function (buffer) {
        options.body = buffer
  
        return options
      })
    } else {
      return Promise.resolve(options)
    }
  }
  
  module.exports = patch
  
  
  /***/ }),
  /* 91 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var concat = __webpack_require__(92)
  
  function bufferFromReadable (readable) {
    return new Promise(function (resolve, reject) {
      var stream = concat()
  
      readable.on('error', reject)
      readable.on('end', function () {
        resolve(stream.getBody())
      })
  
      readable.pipe(stream)
    })
  }
  
  module.exports = bufferFromReadable
  
  
  /***/ }),
  /* 92 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {var Writable = __webpack_require__(7).Writable
  var inherits = __webpack_require__(2)
  
  if (typeof Uint8Array === 'undefined') {
    var U8 = __webpack_require__(93).Uint8Array
  } else {
    var U8 = Uint8Array
  }
  
  function ConcatStream(opts, cb) {
    if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb)
  
    if (typeof opts === 'function') {
      cb = opts
      opts = {}
    }
    if (!opts) opts = {}
  
    var encoding = opts.encoding
    var shouldInferEncoding = false
  
    if (!encoding) {
      shouldInferEncoding = true
    } else {
      encoding =  String(encoding).toLowerCase()
      if (encoding === 'u8' || encoding === 'uint8') {
        encoding = 'uint8array'
      }
    }
  
    Writable.call(this, { objectMode: true })
  
    this.encoding = encoding
    this.shouldInferEncoding = shouldInferEncoding
  
    if (cb) this.on('finish', function () { cb(this.getBody()) })
    this.body = []
  }
  
  module.exports = ConcatStream
  inherits(ConcatStream, Writable)
  
  ConcatStream.prototype._write = function(chunk, enc, next) {
    this.body.push(chunk)
    next()
  }
  
  ConcatStream.prototype.inferEncoding = function (buff) {
    var firstBuffer = buff === undefined ? this.body[0] : buff;
    if (Buffer.isBuffer(firstBuffer)) return 'buffer'
    if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array'
    if (Array.isArray(firstBuffer)) return 'array'
    if (typeof firstBuffer === 'string') return 'string'
    if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object'
    return 'buffer'
  }
  
  ConcatStream.prototype.getBody = function () {
    if (!this.encoding && this.body.length === 0) return []
    if (this.shouldInferEncoding) this.encoding = this.inferEncoding()
    if (this.encoding === 'array') return arrayConcat(this.body)
    if (this.encoding === 'string') return stringConcat(this.body)
    if (this.encoding === 'buffer') return bufferConcat(this.body)
    if (this.encoding === 'uint8array') return u8Concat(this.body)
    return this.body
  }
  
  var isArray = Array.isArray || function (arr) {
    return Object.prototype.toString.call(arr) == '[object Array]'
  }
  
  function isArrayish (arr) {
    return /Array\]$/.test(Object.prototype.toString.call(arr))
  }
  
  function isBufferish (p) {
    return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function')
  }
  
  function stringConcat (parts) {
    var strings = []
    var needsToString = false
    for (var i = 0; i < parts.length; i++) {
      var p = parts[i]
      if (typeof p === 'string') {
        strings.push(p)
      } else if (Buffer.isBuffer(p)) {
        strings.push(p)
      } else if (isBufferish(p)) {
        strings.push(new Buffer(p))
      } else {
        strings.push(new Buffer(String(p)))
      }
    }
    if (Buffer.isBuffer(parts[0])) {
      strings = Buffer.concat(strings)
      strings = strings.toString('utf8')
    } else {
      strings = strings.join('')
    }
    return strings
  }
  
  function bufferConcat (parts) {
    var bufs = []
    for (var i = 0; i < parts.length; i++) {
      var p = parts[i]
      if (Buffer.isBuffer(p)) {
        bufs.push(p)
      } else if (isBufferish(p)) {
        bufs.push(new Buffer(p))
      } else {
        bufs.push(new Buffer(String(p)))
      }
    }
    return Buffer.concat(bufs)
  }
  
  function arrayConcat (parts) {
    var res = []
    for (var i = 0; i < parts.length; i++) {
      res.push.apply(res, parts[i])
    }
    return res
  }
  
  function u8Concat (parts) {
    var len = 0
    for (var i = 0; i < parts.length; i++) {
      if (typeof parts[i] === 'string') {
        parts[i] = new Buffer(parts[i])
      }
      len += parts[i].length
    }
    var u8 = new U8(len)
    for (var i = 0, offset = 0; i < parts.length; i++) {
      var part = parts[i]
      for (var j = 0; j < part.length; j++) {
        u8[offset++] = part[j]
      }
    }
    return u8
  }
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 93 */
  /***/ (function(module, exports) {
  
  var undefined = (void 0); // Paranoia
  
  // Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to
  // create, and consume so much memory, that the browser appears frozen.
  var MAX_ARRAY_LENGTH = 1e5;
  
  // Approximations of internal ECMAScript conversion functions
  var ECMAScript = (function() {
    // Stash a copy in case other scripts modify these
    var opts = Object.prototype.toString,
        ophop = Object.prototype.hasOwnProperty;
  
    return {
      // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues:
      Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); },
      HasProperty: function(o, p) { return p in o; },
      HasOwnProperty: function(o, p) { return ophop.call(o, p); },
      IsCallable: function(o) { return typeof o === 'function'; },
      ToInt32: function(v) { return v >> 0; },
      ToUint32: function(v) { return v >>> 0; }
    };
  }());
  
  // Snapshot intrinsics
  var LN2 = Math.LN2,
      abs = Math.abs,
      floor = Math.floor,
      log = Math.log,
      min = Math.min,
      pow = Math.pow,
      round = Math.round;
  
  // ES5: lock down object properties
  function configureProperties(obj) {
    if (getOwnPropNames && defineProp) {
      var props = getOwnPropNames(obj), i;
      for (i = 0; i < props.length; i += 1) {
        defineProp(obj, props[i], {
          value: obj[props[i]],
          writable: false,
          enumerable: false,
          configurable: false
        });
      }
    }
  }
  
  // emulate ES5 getter/setter API using legacy APIs
  // http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx
  // (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but
  // note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless)
  var defineProp
  if (Object.defineProperty && (function() {
        try {
          Object.defineProperty({}, 'x', {});
          return true;
        } catch (e) {
          return false;
        }
      })()) {
    defineProp = Object.defineProperty;
  } else {
    defineProp = function(o, p, desc) {
      if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object");
      if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); }
      if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); }
      if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; }
      return o;
    };
  }
  
  var getOwnPropNames = Object.getOwnPropertyNames || function (o) {
    if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object");
    var props = [], p;
    for (p in o) {
      if (ECMAScript.HasOwnProperty(o, p)) {
        props.push(p);
      }
    }
    return props;
  };
  
  // ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value)
  // for index in 0 ... obj.length
  function makeArrayAccessors(obj) {
    if (!defineProp) { return; }
  
    if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill");
  
    function makeArrayAccessor(index) {
      defineProp(obj, index, {
        'get': function() { return obj._getter(index); },
        'set': function(v) { obj._setter(index, v); },
        enumerable: true,
        configurable: false
      });
    }
  
    var i;
    for (i = 0; i < obj.length; i += 1) {
      makeArrayAccessor(i);
    }
  }
  
  // Internal conversion functions:
  //    pack<Type>()   - take a number (interpreted as Type), output a byte array
  //    unpack<Type>() - take a byte array, output a Type-like number
  
  function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; }
  function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; }
  
  function packI8(n) { return [n & 0xff]; }
  function unpackI8(bytes) { return as_signed(bytes[0], 8); }
  
  function packU8(n) { return [n & 0xff]; }
  function unpackU8(bytes) { return as_unsigned(bytes[0], 8); }
  
  function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; }
  
  function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; }
  function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); }
  
  function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; }
  function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); }
  
  function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; }
  function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); }
  
  function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; }
  function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); }
  
  function packIEEE754(v, ebits, fbits) {
  
    var bias = (1 << (ebits - 1)) - 1,
        s, e, f, ln,
        i, bits, str, bytes;
  
    function roundToEven(n) {
      var w = floor(n), f = n - w;
      if (f < 0.5)
        return w;
      if (f > 0.5)
        return w + 1;
      return w % 2 ? w + 1 : w;
    }
  
    // Compute sign, exponent, fraction
    if (v !== v) {
      // NaN
      // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping
      e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0;
    } else if (v === Infinity || v === -Infinity) {
      e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0;
    } else if (v === 0) {
      e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0;
    } else {
      s = v < 0;
      v = abs(v);
  
      if (v >= pow(2, 1 - bias)) {
        e = min(floor(log(v) / LN2), 1023);
        f = roundToEven(v / pow(2, e) * pow(2, fbits));
        if (f / pow(2, fbits) >= 2) {
          e = e + 1;
          f = 1;
        }
        if (e > bias) {
          // Overflow
          e = (1 << ebits) - 1;
          f = 0;
        } else {
          // Normalized
          e = e + bias;
          f = f - pow(2, fbits);
        }
      } else {
        // Denormalized
        e = 0;
        f = roundToEven(v / pow(2, 1 - bias - fbits));
      }
    }
  
    // Pack sign, exponent, fraction
    bits = [];
    for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); }
    for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); }
    bits.push(s ? 1 : 0);
    bits.reverse();
    str = bits.join('');
  
    // Bits to bytes
    bytes = [];
    while (str.length) {
      bytes.push(parseInt(str.substring(0, 8), 2));
      str = str.substring(8);
    }
    return bytes;
  }
  
  function unpackIEEE754(bytes, ebits, fbits) {
  
    // Bytes to bits
    var bits = [], i, j, b, str,
        bias, s, e, f;
  
    for (i = bytes.length; i; i -= 1) {
      b = bytes[i - 1];
      for (j = 8; j; j -= 1) {
        bits.push(b % 2 ? 1 : 0); b = b >> 1;
      }
    }
    bits.reverse();
    str = bits.join('');
  
    // Unpack sign, exponent, fraction
    bias = (1 << (ebits - 1)) - 1;
    s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
    e = parseInt(str.substring(1, 1 + ebits), 2);
    f = parseInt(str.substring(1 + ebits), 2);
  
    // Produce number
    if (e === (1 << ebits) - 1) {
      return f !== 0 ? NaN : s * Infinity;
    } else if (e > 0) {
      // Normalized
      return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
    } else if (f !== 0) {
      // Denormalized
      return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
    } else {
      return s < 0 ? -0 : 0;
    }
  }
  
  function unpackF64(b) { return unpackIEEE754(b, 11, 52); }
  function packF64(v) { return packIEEE754(v, 11, 52); }
  function unpackF32(b) { return unpackIEEE754(b, 8, 23); }
  function packF32(v) { return packIEEE754(v, 8, 23); }
  
  
  //
  // 3 The ArrayBuffer Type
  //
  
  (function() {
  
    /** @constructor */
    var ArrayBuffer = function ArrayBuffer(length) {
      length = ECMAScript.ToInt32(length);
      if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer');
  
      this.byteLength = length;
      this._bytes = [];
      this._bytes.length = length;
  
      var i;
      for (i = 0; i < this.byteLength; i += 1) {
        this._bytes[i] = 0;
      }
  
      configureProperties(this);
    };
  
    exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
  
    //
    // 4 The ArrayBufferView Type
    //
  
    // NOTE: this constructor is not exported
    /** @constructor */
    var ArrayBufferView = function ArrayBufferView() {
      //this.buffer = null;
      //this.byteOffset = 0;
      //this.byteLength = 0;
    };
  
    //
    // 5 The Typed Array View Types
    //
  
    function makeConstructor(bytesPerElement, pack, unpack) {
      // Each TypedArray type requires a distinct constructor instance with
      // identical logic, which this produces.
  
      var ctor;
      ctor = function(buffer, byteOffset, length) {
        var array, sequence, i, s;
  
        if (!arguments.length || typeof arguments[0] === 'number') {
          // Constructor(unsigned long length)
          this.length = ECMAScript.ToInt32(arguments[0]);
          if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer');
  
          this.byteLength = this.length * this.BYTES_PER_ELEMENT;
          this.buffer = new ArrayBuffer(this.byteLength);
          this.byteOffset = 0;
        } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) {
          // Constructor(TypedArray array)
          array = arguments[0];
  
          this.length = array.length;
          this.byteLength = this.length * this.BYTES_PER_ELEMENT;
          this.buffer = new ArrayBuffer(this.byteLength);
          this.byteOffset = 0;
  
          for (i = 0; i < this.length; i += 1) {
            this._setter(i, array._getter(i));
          }
        } else if (typeof arguments[0] === 'object' &&
                   !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
          // Constructor(sequence<type> array)
          sequence = arguments[0];
  
          this.length = ECMAScript.ToUint32(sequence.length);
          this.byteLength = this.length * this.BYTES_PER_ELEMENT;
          this.buffer = new ArrayBuffer(this.byteLength);
          this.byteOffset = 0;
  
          for (i = 0; i < this.length; i += 1) {
            s = sequence[i];
            this._setter(i, Number(s));
          }
        } else if (typeof arguments[0] === 'object' &&
                   (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
          // Constructor(ArrayBuffer buffer,
          //             optional unsigned long byteOffset, optional unsigned long length)
          this.buffer = buffer;
  
          this.byteOffset = ECMAScript.ToUint32(byteOffset);
          if (this.byteOffset > this.buffer.byteLength) {
            throw new RangeError("byteOffset out of range");
          }
  
          if (this.byteOffset % this.BYTES_PER_ELEMENT) {
            // The given byteOffset must be a multiple of the element
            // size of the specific type, otherwise an exception is raised.
            throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");
          }
  
          if (arguments.length < 3) {
            this.byteLength = this.buffer.byteLength - this.byteOffset;
  
            if (this.byteLength % this.BYTES_PER_ELEMENT) {
              throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");
            }
            this.length = this.byteLength / this.BYTES_PER_ELEMENT;
          } else {
            this.length = ECMAScript.ToUint32(length);
            this.byteLength = this.length * this.BYTES_PER_ELEMENT;
          }
  
          if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) {
            throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");
          }
        } else {
          throw new TypeError("Unexpected argument type(s)");
        }
  
        this.constructor = ctor;
  
        configureProperties(this);
        makeArrayAccessors(this);
      };
  
      ctor.prototype = new ArrayBufferView();
      ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
      ctor.prototype._pack = pack;
      ctor.prototype._unpack = unpack;
      ctor.BYTES_PER_ELEMENT = bytesPerElement;
  
      // getter type (unsigned long index);
      ctor.prototype._getter = function(index) {
        if (arguments.length < 1) throw new SyntaxError("Not enough arguments");
  
        index = ECMAScript.ToUint32(index);
        if (index >= this.length) {
          return undefined;
        }
  
        var bytes = [], i, o;
        for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT;
             i < this.BYTES_PER_ELEMENT;
             i += 1, o += 1) {
          bytes.push(this.buffer._bytes[o]);
        }
        return this._unpack(bytes);
      };
  
      // NONSTANDARD: convenience alias for getter: type get(unsigned long index);
      ctor.prototype.get = ctor.prototype._getter;
  
      // setter void (unsigned long index, type value);
      ctor.prototype._setter = function(index, value) {
        if (arguments.length < 2) throw new SyntaxError("Not enough arguments");
  
        index = ECMAScript.ToUint32(index);
        if (index >= this.length) {
          return undefined;
        }
  
        var bytes = this._pack(value), i, o;
        for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT;
             i < this.BYTES_PER_ELEMENT;
             i += 1, o += 1) {
          this.buffer._bytes[o] = bytes[i];
        }
      };
  
      // void set(TypedArray array, optional unsigned long offset);
      // void set(sequence<type> array, optional unsigned long offset);
      ctor.prototype.set = function(index, value) {
        if (arguments.length < 1) throw new SyntaxError("Not enough arguments");
        var array, sequence, offset, len,
            i, s, d,
            byteOffset, byteLength, tmp;
  
        if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) {
          // void set(TypedArray array, optional unsigned long offset);
          array = arguments[0];
          offset = ECMAScript.ToUint32(arguments[1]);
  
          if (offset + array.length > this.length) {
            throw new RangeError("Offset plus length of array is out of range");
          }
  
          byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
          byteLength = array.length * this.BYTES_PER_ELEMENT;
  
          if (array.buffer === this.buffer) {
            tmp = [];
            for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
              tmp[i] = array.buffer._bytes[s];
            }
            for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) {
              this.buffer._bytes[d] = tmp[i];
            }
          } else {
            for (i = 0, s = array.byteOffset, d = byteOffset;
                 i < byteLength; i += 1, s += 1, d += 1) {
              this.buffer._bytes[d] = array.buffer._bytes[s];
            }
          }
        } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') {
          // void set(sequence<type> array, optional unsigned long offset);
          sequence = arguments[0];
          len = ECMAScript.ToUint32(sequence.length);
          offset = ECMAScript.ToUint32(arguments[1]);
  
          if (offset + len > this.length) {
            throw new RangeError("Offset plus length of array is out of range");
          }
  
          for (i = 0; i < len; i += 1) {
            s = sequence[i];
            this._setter(offset + i, Number(s));
          }
        } else {
          throw new TypeError("Unexpected argument type(s)");
        }
      };
  
      // TypedArray subarray(long begin, optional long end);
      ctor.prototype.subarray = function(start, end) {
        function clamp(v, min, max) { return v < min ? min : v > max ? max : v; }
  
        start = ECMAScript.ToInt32(start);
        end = ECMAScript.ToInt32(end);
  
        if (arguments.length < 1) { start = 0; }
        if (arguments.length < 2) { end = this.length; }
  
        if (start < 0) { start = this.length + start; }
        if (end < 0) { end = this.length + end; }
  
        start = clamp(start, 0, this.length);
        end = clamp(end, 0, this.length);
  
        var len = end - start;
        if (len < 0) {
          len = 0;
        }
  
        return new this.constructor(
          this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
      };
  
      return ctor;
    }
  
    var Int8Array = makeConstructor(1, packI8, unpackI8);
    var Uint8Array = makeConstructor(1, packU8, unpackU8);
    var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8);
    var Int16Array = makeConstructor(2, packI16, unpackI16);
    var Uint16Array = makeConstructor(2, packU16, unpackU16);
    var Int32Array = makeConstructor(4, packI32, unpackI32);
    var Uint32Array = makeConstructor(4, packU32, unpackU32);
    var Float32Array = makeConstructor(4, packF32, unpackF32);
    var Float64Array = makeConstructor(8, packF64, unpackF64);
  
    exports.Int8Array = exports.Int8Array || Int8Array;
    exports.Uint8Array = exports.Uint8Array || Uint8Array;
    exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray;
    exports.Int16Array = exports.Int16Array || Int16Array;
    exports.Uint16Array = exports.Uint16Array || Uint16Array;
    exports.Int32Array = exports.Int32Array || Int32Array;
    exports.Uint32Array = exports.Uint32Array || Uint32Array;
    exports.Float32Array = exports.Float32Array || Float32Array;
    exports.Float64Array = exports.Float64Array || Float64Array;
  }());
  
  //
  // 6 The DataView View Type
  //
  
  (function() {
    function r(array, index) {
      return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
    }
  
    var IS_BIG_ENDIAN = (function() {
      var u16array = new(exports.Uint16Array)([0x1234]),
          u8array = new(exports.Uint8Array)(u16array.buffer);
      return r(u8array, 0) === 0x12;
    }());
  
    // Constructor(ArrayBuffer buffer,
    //             optional unsigned long byteOffset,
    //             optional unsigned long byteLength)
    /** @constructor */
    var DataView = function DataView(buffer, byteOffset, byteLength) {
      if (arguments.length === 0) {
        buffer = new exports.ArrayBuffer(0);
      } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
        throw new TypeError("TypeError");
      }
  
      this.buffer = buffer || new exports.ArrayBuffer(0);
  
      this.byteOffset = ECMAScript.ToUint32(byteOffset);
      if (this.byteOffset > this.buffer.byteLength) {
        throw new RangeError("byteOffset out of range");
      }
  
      if (arguments.length < 3) {
        this.byteLength = this.buffer.byteLength - this.byteOffset;
      } else {
        this.byteLength = ECMAScript.ToUint32(byteLength);
      }
  
      if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) {
        throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");
      }
  
      configureProperties(this);
    };
  
    function makeGetter(arrayType) {
      return function(byteOffset, littleEndian) {
  
        byteOffset = ECMAScript.ToUint32(byteOffset);
  
        if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
          throw new RangeError("Array index out of range");
        }
        byteOffset += this.byteOffset;
  
        var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT),
            bytes = [], i;
        for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
          bytes.push(r(uint8Array, i));
        }
  
        if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
          bytes.reverse();
        }
  
        return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0);
      };
    }
  
    DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
    DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
    DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
    DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
    DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
    DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
    DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
    DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
  
    function makeSetter(arrayType) {
      return function(byteOffset, value, littleEndian) {
  
        byteOffset = ECMAScript.ToUint32(byteOffset);
        if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
          throw new RangeError("Array index out of range");
        }
  
        // Get bytes
        var typeArray = new arrayType([value]),
            byteArray = new exports.Uint8Array(typeArray.buffer),
            bytes = [], i, byteView;
  
        for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
          bytes.push(r(byteArray, i));
        }
  
        // Flip if necessary
        if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
          bytes.reverse();
        }
  
        // Write them
        byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
        byteView.set(bytes);
      };
    }
  
    DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
    DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
    DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
    DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
    DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
    DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
    DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
    DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
  
    exports.DataView = exports.DataView || DataView;
  
  }());
  
  
  /***/ }),
  /* 94 */
  /***/ (function(module, exports, __webpack_require__) {
  
  var ReadableFromArrayBuffer = __webpack_require__(95)
  var ReadableFromWhatwg = __webpack_require__(96)
  
  function patch (res) {
    // not implemented in Firefix 51
    /* if (!res.body) {
      return res
    } */
  
    if (res.body && res.body.getReader) {
      res.readable = function () {
        return Promise.resolve(new ReadableFromWhatwg(res.body.getReader()))
      }
    } else {
      res.readable = function () {
        if (res.body && res.body.readable) {
          return Promise.resolve(res.body)
        } else {
          if (res.bodyUsed) {
            return Promise.reject(new Error('body already in use'))
          }
  
          return res.arrayBuffer().then(function (arrayBuffer) {
            return new ReadableFromArrayBuffer(arrayBuffer)
          })
        }
      }
    }
  
    return res
  }
  
  module.exports = patch
  
  
  /***/ }),
  /* 95 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(2)
  var Readable = __webpack_require__(7)
  
  function ReadableFromArrayBuffer (arrayBuffer) {
    var self = this
  
    Readable.call(this)
  
    this._read = function () {
      self.push(new Buffer(arrayBuffer))
      self.push(null)
    }
  }
  
  inherits(ReadableFromArrayBuffer, Readable)
  
  module.exports = ReadableFromArrayBuffer
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 96 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(2)
  var Readable = __webpack_require__(7)
  
  function ReadableFromWhatwg (stream) {
    var self = this
  
    Readable.call(this)
  
    this._read = function () {
      stream.read().then(function (chunk) {
        if (chunk.done) {
          self.push(null)
        } else {
          self.push(new Buffer(chunk.value))
        }
      }).catch(function (err) {
        self.emit('error', err)
      })
    }
  }
  
  inherits(ReadableFromWhatwg, Readable)
  
  module.exports = ReadableFromWhatwg
  
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  
  /***/ }),
  /* 97 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  /**
   * @module watson-speech/speech-to-text/get-models
   */
  
  /**
   Returns a promise that resolves to an array of objects representing the available voice models.  Example:
  
   ```js
   [{
      "url": "https://stream.watsonplatform.net/speech-to-text/api/v1/models/en-UK_BroadbandModel",
      "rate": 16000,
      "name": "en-UK_BroadbandModel",
      "language": "en-UK",
      "description": "UK English broadband model."
   },
   //...
   ]
   ```
   Requires fetch, pollyfill available at https://github.com/github/fetch
  
   * @todo define format in @return statement
   * @param {Object} options
   * @param {String} options.token auth token
   * @return {Promise.<T>}
   */
  module.exports = function getModels(options) {
    if (!options || !options.token) {
      throw new Error('Watson SpeechToText: missing required parameter: options.token');
    }
    var reqOpts = {
      credentials: 'omit',
      headers: {
        accept: 'application/json'
      }
    };
    return fetch('https://stream.watsonplatform.net/speech-to-text/api/v1/models?watson-token=' + options.token, reqOpts)
      .then(function(response) {
        return response.json();
      })
      .then(function(obj) {
        return obj.models;
      });
  };
  
  
  /***/ }),
  /* 98 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  /**
   * @module watson-speech/text-to-speech
   */
  
  /**
   * @see module:watson-speech/text-to-speech/synthesize
   */
  exports.synthesize = __webpack_require__(99);
  
  /**
   * @see module:watson-speech/text-to-speech/get-voices
   */
  exports.getVoices = __webpack_require__(100);
  
  
  /***/ }),
  /* 99 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  var pick = __webpack_require__(35);
  var qs = __webpack_require__(36);
  
  var QUERY_PARAMS_ALLOWED = ['voice', 'X-WDC-PL-OPT-OUT', 'X-Watson-Learning-Opt-Out', 'text', 'watson-token', 'accept', 'customization_id'];
  
  /**
   * @module watson-speech/text-to-speech/synthesize
   */
  
  /**
   * Synthesize and play the supplied text over the computers speakers.
   *
   * Creates and returns a HTML5 `<audio>` element
   *
   * @param {Object} options
   * @param {String} options.token auth token
   * @param {String} options.text text to speak
   * @param {String} [options.voice=en-US_MichaelVoice] what voice to use - call getVoices() for a complete list.
   * @param {String} [options.customization_id] GUID of a custom voice model. Omit to use the voice with no customization.
   * @param {String} [options.accept] - specify desired audio format. Leave unset to allow (most) browsers to automatically negotiate an ideal format.
   * @param {Number} [options.X-Watson-Learning-Opt-Out=0] set to 1 to opt-out of allowing Watson to use this request to improve it's services
   * @param {Boolean} [options.autoPlay=true] automatically play the audio
   * @param {DOMAudioElement} [options.element] <audio> element - will be used instead of creating a new one if provided
   * @return {Audio}
   * @see module:watson-speech/text-to-speech/get-voices
   */
  module.exports = function synthesize(options) {
    if (!options || !options.token) {
      throw new Error('Watson TextToSpeech: missing required parameter: options.token');
    }
    options['watson-token'] = options.token;
    delete options.token;
    var audio = options.element || new Audio();
    audio.crossOrigin = 'anonymous';
    audio.src = 'https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?' + qs.stringify(pick(options, QUERY_PARAMS_ALLOWED));
    if (options.autoPlay !== false) {
      audio.play();
    }
    return audio;
  };
  
  
  /***/ }),
  /* 100 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /**
   * Copyright 2015 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  
  /**
   * @module watson-speech/text-to-speech/get-voices
   */
  
  /**
   Returns a promise that resolves to an array of objects representing the available voices.  Example:
  
   ```js
   [{
      "name": "en-US_MichaelVoice",
      "language": "en-US",
      "customizable": true,
      "gender": "male",
      "url": "https://stream.watsonplatform.net/text-to-speech/api/v1/voices/en-US_MichaelVoice",
      "description": "Michael: American English male voice."
   },
   //...
   ]
   ```
   Requires fetch, pollyfill available at https://github.com/github/fetch
  
   * @todo define format in @return statement
   * @param {Object} options
   * @param {String} options.token auth token
   * @return {Promise.<T>}
   */
  module.exports = function getVoices(options) {
    if (!options || !options.token) {
      throw new Error('Watson TextToSpeech: missing required parameter: options.token');
    }
    var reqOpts = {
      credentials: 'omit',
      headers: {
        accept: 'application/json'
      }
    };
    return fetch('https://stream.watsonplatform.net/text-to-speech/api/v1/voices?watson-token=' + options.token, reqOpts)
      .then(function(response) {
        return response.json();
      })
      .then(function(obj) {
        return obj.voices;
      });
  };
  
  
  /***/ })
  /******/ ]);
  });